imta crdb

The imta crdb command creates and updates IMTA database files. imta crdb converts a plain text file into IMTA database records; from them, it either creates a new database or adds the records to an existing database.

In general, each line of the input file must consist of a left side and a right side. The two sides are separated by one or more spaces or tabs. The left side is limited to 32 characters in a short database (the default variety) and 80 characters in a long database. The right side is limited to 80 characters in a short database and 256 in a long database. Spaces and tabs may not appear in the left side.


Syntax

 
imta crdb options input-file-spec output-database-spec
 

The options for this command are:

-append

-noappend  

When the default, -noappend, option is in effect, a new database is created, overwriting any old database of that name. Use the -append option to instruct the IMTA to instead add the new records to an existing database. The -noappend option is the default.  

-count

-nocount  

Controls whether or not a count is output after each group of 100 input lines are processed. The -count option is the default.  

-duplicates

-noduplicates  

Controls whether or not duplicate records are allowed in the output files. Currently, duplicate records are of use only in the domain database (rewrite rules database) and databases associated with the directory channel. The -noduplicates option is the default.  

-long_records

-nolong_records  

Controls the size of the output records. By default, left sides are limited to 32 characters and right sides are limited to 80 characters. If -long_records is specified, the limits are changed to 80 and 256, respectively. The -nolong_records option is the default.  

-quoted

-noquoted  

Controls the handling of quotes. Normally imta crdb pays no attention to double quotes. If -quoted is specified, imta crdb matches up double quotes in the process of determining the break between the left and right hand sides of each input line. Spaces and tabs are then allowed in the left side if they are within a matching pair of quotes. This is useful for certain kinds of databases, where spaces may form a part of database keys. The quotes are not removed unless the -remove option is also specified. The -noquoted option is the default.  

-remove

-noremove  

Controls the removal of quotes. If imta crdb is instructed to pay attention to quotes, the quotes are normally retained. If -remove is specified, imta crdb removes the outermost set of quotes from the left hand side of each input line. Spaces and tabs are then allowed in the left side if they are within a matching pair of quotes. This is useful for certain kinds of databases, where spaces may form a part of database keys. -remove is ignored if -quoted is not in effect. The -noremove option is the default.  

-statistics

-nostatistics  

Controls whether or not some simple statistics are output by imta crdb, including the number of entries (lines) converted, the number of exceptions (usually duplicate records) detected, and the number of entries that could not be converted because they were too long to fit in the output database. -nostatistics suppresses output of this information. The -statistics option is the default.  

-strip_colons

-nostrip_colons  

Instructs imta crdb to strip a trailing colon from the right end of the left hand side of each line it reads from the input file. This is useful for turning alias file entries into an alias database. The -nostrip_colons is the default.  

The input and output parameters for this command are:

input-file-spec  

A text file containing the entries to be placed into the database. Each line of the text file must correspond to a single entry.  

output-database-spec  

The initial name string of the files to which to write the database. The database consists of three files named output-database-spec.idx, output-database-spec.dat, and output-database-spec.lock, respectively.  


Example

The following commands create an alias database with "long" record entries. The creation is performed in a two-step process using a temporary database to minimize any window of time, such as during database generation, when the database would be locked and inaccessible to the IMTA.

 
% imta crdb -long_records /var/opt/SUNWmail/imta/aliases.txt \ 
/var/opt/SUNWmail/imta/tmpdb
 
%imta renamedb /var/opt/SUNWmail/imta/tmpdb IMTA_ALIAS_DATABASE
 




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