imta cnbuild

The imta cnbuild command compiles the textual configuration, option, mapping, conversion, and alias files, and loads the resulting image file into shared memory. The resulting image is saved to a file usually named /opt/SUNWmail/imta/lib/config_data by the IMTA_CONFIG_DATA option of the IMTA tailor file, /etc/opt/SUNWmail/imta/imta_tailor.

Whenever a component of the IMTA (for example, a channel program) must read a compiled configuration component, it first checks to see whether the file named by the IMTA tailor file option IMTA_CONFIG_DATA is loaded into shared memory; if this compiled image exists but is not loaded, the IMTA loads it into shared memory. If the IMTA finds (or not finding, is able to load itself) a compiled image in shared memory, the running program uses that image. This rule has two exceptions:

  1. The first is imta cnbuild itself, which always reads the text files and never tries to use an image form of the configuration data.
  2. The second exception is imta test -rewrite, which can be instructed with the -image_file option to use a different compiled configuration file. This facility in imta test -rewrite is useful for testing changes prior to compiling them.

The reason for compiling configuration information is simple: performance. The only penalty paid for compilation is the need to recompile and reload the image any time the configuration or alias files are edited. Also, be sure to restart any programs or channels that load the configuration data only once when they start up-for example, the IMTA multithreaded TCP SMTP server.

It is necessary to recompile the configuration every time changes are made to any of the following files:

IMTA configuration file (or any files referenced by it)
IMTA system alias file, the IMTA mapping file
IMTA option file
IMTA conversion file

Specifically, these are the files pointed at the IMTA tailor file options IMTA_CONFIG_FILE, IMTA_ALIAS_FILE, IMTA_MAPPING_FILE, IMTA_OPTION_FILE, and IMTA_CONVERSION_FILE, respectively, which usually point to the following files:

/etc/opt/SUNWmail/imta/imta.cnf
/etc/opt/SUNWmail/imta/aliases
/etc/opt/SUNWmail/imta/mappings
/etc/opt/SUNWmail/imta/option.dat
/etc/opt/SUNWmail/imta/conversions

Note - Until the configuration is rebuilt, changes to any of these files are not visible to the running IMTA system.

Syntax

 
imta cnbuild [-remove] [-resize_tables] [-sizes] [-statistics]
 

The options for this command are:

-resize_tables  

This option is used to get past size restriction in order to build a properly-sized option file so that a proportionately-sized configuration can be built with a subsequent imta cnbuild invocation. Use this option only if the current table sizes are inadequate, and you need to create a new option file. To be precise, use it only if you get a "No room in table" error when building the configuration or starting the IMTA.  

-remove  

Remove any existing compiled configuration; for example, remove the file named by the IMTA_CONFIG_DATA option of the IMTA tailor file, /etc/opt/SUNWmail/imta/imta_tailor.  

-sizes  

The -sizes option instructs imta cnbuild to output information on the sizes of uncompiled IMTA tables.  

-statistics  

The -statistics command instructs imta cnbuild to output information on how much of the various tables in the compiled configuration were actually used to store data. These numbers give a rough measurement of the efficiency of the compilation, and may indicate whether or not an additional rebuild with the -resize_tables option is needed.  


Examples

The standard command you use to regenerate a compiled configuration is:

 
% imta cnbuild
 

After compiling the configuration, restart any programs that may need to reload the new configuration. For example, the TCP SMTP server should be restarted:

 
% imta restart dispatcher
 

Execute the following two commands if you encounter the No room in table: error message:

 
% imta cnbuild -resize_tables
 
# imta restart
 


Note - By default, imta cnbuild is executed whenever the imta start or imta restart commands are invoked.



Copyright © 1999 Sun Microsystems, Inc. All Rights Reserved.