Sun Java System Messaging Server 6.3 Administration Reference

imsimta crdb

The imsimta crdb command creates and updates MTA database files. imsimta crdb converts a plain text file into MTA 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 unless the -quoted option is specified. Comment lines may be included in input files. A comment line is a line that begins with an exclamation mark (!) in column 1.

Syntax


imsimta crdb input-file-spec output-database-spec [-append | -noappend]
[-count | -nocount] [-duplicates | -noduplicates] [-long_records |
-nolong_records] [-quoted | -noquoted] [-remove | -noremove] [-statistics |
-nostatistics] [-strip_colons | -nostrip_colons]

Options

The options for this command are:

Option  

Description  

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. This attribute is mandatory. 

output-database-spec

The initial name string of the files to which to write the database (unless -dump is specified). The .db extension is appended to the file name. This attribute is mandatory.

-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 MTA to instead add the new records to an existing database. The -noappend option is the default. In the event of a duplicate record, the newly appended record overwrites the old record when -noduplicates is specified.

-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 imsimta crdb pays no attention to double quotes. If -quoted is specified, imsimta 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 imsimta crdb is instructed to pay attention to quotes, the quotes are normally retained. If -remove is specified, imsimta 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 imsimta 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 imsimta 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.

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 MTA.


imsimta crdb -long_records aliases-tmp

imsimta renamedb aliases-tmp IMTA_ALIAS_DATABASE

imsimta crdb -dump

The imsimta crdb -dump command writes the entries in MTA databases to a flat ASCII file. In particular, this command may be used to write the contents of an old style database to a file from which a new style database may be built using the imsimta crdb command. The output begins with a comment line that displays a proper imsimta crdb command to use in order to return the ASCII output to a database.


Note –

Make sure you are logged in as mailsrv (the mail server user) before performing this command.


Syntax


imsimta crdb -dump input-database-spec [output-file-spec]

Parameters

The parameters for this command are:

Parameter  

Description  

input-database-spec

Database from which to read entries. By default, the MTA looks for a current format database of the given name; if this does not exist, the MTA will look for an old format database of the given name. The special keywords IMTA_ALIAS_DATABASE, IMTA_REVERSE_DATABASE, and IMTA_GENERAL_DATABASE are supported; the use of such a special keyword tells the MTA to dump the database specified by the corresponding MTA tailor file option.

output-file-spec

ASCII file to which the entries stored in the database are written. This file should be in a directory where you have write permissions. If an output file is not specified, the output is written to stdout.

Examples

The following command can be used to dump the contents of an alias database to a file, and then to recreate the alias database from that file


imsimta crdb -dump IMTA_ALIAS_DATABASE alias.txt
imsimta crdb alias.txt alias-tmp
imsimta renamedb alias-tmp IMTA_ALIAS_DATABASE