Crdb utility

is a utility used to create and update MTA (on-disk) database files.

Syntax
imsimta crdb input-file-spec output-database-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.

The initial name string of the file to which to write the database; the database will consist of a file named   .

Description
is a utility to create and or update MTA (on disk) database files. simply converts a plain text file into MTA database records and from them either creates a new  database or adds the records to an existing database.

If run from the  account,   will set the ownership of the database it creates to the  MTA user account; see the   option from the   file, or in older versions of the MTA, see the   MTA Tailor option. If run from an unprivileged account, then the database will be owned by that unprivileged user.

In general, each line of the input file must consist of a left hand side and a right hand side. The two sides are separated by one or more spaces or tabs. The left hand side is limited to 32 characters in a short database (the default variety) and 80 characters in a long  database. The right hand 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 hand side (but see the description of the    switch below).

The format of the input file is described in the sections describing each particular MTA database. For instance, the format of the input file for an alias database is described in  Alias database format;  the format  of the input file for the domain database (rewrite rule database) is  described in Domain database;  the format of the input file for the forward database is described in Forward database; the format of the input file for the general database is described in General database; the format of the  input file for the address reversal database is described in  Reverse database.

,  (default)
When the default,, switch is in effect, a new  database is created, overwriting any old database of that name. Use the   switch to instruct the MTA to instead add the new  records to an existing database.

(default),
Controls whether or not a count is output after each group of 100 input lines are processed.

is a synonym for. It is used to dump an existing database to a flat text file---or to stdout if no output file is specified. The parameters are interpreted as the input database specification, and optionally a flat text file to  which to write the output. No other switches are valid when   is specified.

,  (default)
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.

,  (default)
may encounter records that cannot be loaded into the database. This usually means that these records had keys (left hand sides) that were duplicates of other keys previously encountered in the  input file. These exception records can optionally be written to a separate output file for later examination; the    switch controls the writing of this  file. Note that the lines in this file are not plain text; they are formatted as database entries.

,  (default), ,
These switches control the size of the output records. By default left hand sides are limited to 32 characters and right hand sides are  limited to 80 characters. If  is specified,  the limits are changed to 80 and 256, respectively. If   is specified, the limits are changed to 252  and 1024, respectively. Currently,  databases  are supported only for the alias database.

,  (default)
This switch controls the handling of quotes. Normally   pays no particular attention to double quotes. If   is specified,   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 hand 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. Note: The quotes are not removed unless the   switch is also specified.

,  (default)
These switches control the removal of quotes. If  is instructed to pay attention to quotes, the quotes are  normally retained. If  is specified,   removes the outermost set of quotes from the left hand side  of each input line. Spaces and tabs are then allowed in the left hand 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. Note:  is ignored if   is  not in effect.

(default),
Controls whether or not some simple statistics are output by, 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. suppresses output of this information.

,  (default)
The  switch instructs   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.

Examples
The above example shows UNIX commands that may be used to create an alias database with "long" record entries; note that 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 MTA.
 * 1) imsimta crdb -long_records IMTA_DATAROOT:db/aliases.txt IMTA_DATAROOT:db/tmpdb
 * 2) imsimta renamedb IMTA_DATAROOT:db/tmpdb IMTA_DATAROOT:db/aliasesdb

See also:
 * Alias file
 * Alias database
 * Domain database
 * Forward database
 * General database
 * Reverse database
 * MTA command line utilities