NAME
mkdbm − build a DBM file suitable for use by smail
SYNOPSIS
/usr/lib/smail/mkdbm [ −f ] [ −v ] [ −n ] [ −d ] [ −y ]
[ −o output-name ] [ file ... ]
DESCRIPTION
Mkdbm takes lines as input and writes them to a set of files in the format produced by the dbm(3X) function library. The key is formed from the characters up to, but not including, a colon (’’:’’) or white space character. The data after the colon or white space character forms the value associated with the key. If −f is given, the key is folded to lower case before being stored in the database.
If no input files are specified, the standard input is read. In addition, if a filename of − is given, the standard input is inserted at that point.
The −o option sets the name for the DBM database. If not specified explicitly, the name of the database is taken from the first file argument. If no file arguments are given, or the first file argument is − then a database is created in the current directory with the name dbm.
The mkdbm program can be used to produce DBM files which can then be read by a smail(8) pathalias router or aliasfile director. The router or directory should be configured to use the dbm file access protocol. See smail(5) for more information on routers and directors. For some databases, mkline(8) should be used to form single line records with comments and extra white-space removed.
The generated database contains a single nul byte at the end of each key and value. Also a single record containing ’’@’’ as a key and value is created for compatibility with the Berkeley sendmail(8) program’s alias files. The trailing NUL bytes can be suppressed with the −n option, and the extra ’’@’’ record can be suppressed with the −d option. Use of −n is incompatible with the smail dbm file access method.
When creating the database, temporary DBM files are built in the same directory as the eventual output files. Then, when it is completed, any DBM files currently existing under the target name are removed, mkdbm sleeps between one and two seconds, and then the temporary DBM files are moved to the target names. This database creation method is not compatible with the locking method used by Berkeley sendmail.
If the −v flags is specified mkdbm writes statistics to the standard output.
The −y flag is used to create YP-compatible dbm files. This obviates the need for keeping sendmail around to recreate the YP alias database. Calling mkdbm with the arguments -ynd generates dbm files that are compatible with regular YP databases. Using just the argument −y generates a database that is compatible with the YP mail.alias database.
EXAMPLE
As an example of the use of mkdbm consider a file, paths, containing the routing information:
.COM |
sun!%s | |
Stargate.COM |
ames!cmcl2!uiucdcs!stargate!%s | |
ames |
ames!%s | |
.ATT.COM |
mtune!%s | |
mtune |
mtune!%s |
Given this file, the command mkdbm -f paths will produce a dbm database in the files paths.pag and paths.dir containing the above entries, with downcased keys. For example, one entry will contain the key stargate.com with an associated value of ames!cmcl2!uiucdcs!stargate!%s.
SEE ALSO
mkaliases(8), mkline(8), mksort(8), smail(5), smail(8), pathalias(8).
FILES
dbmXXXXXX.pag |
|||
dbmXXXXXX.dir |
The temporary files created in the same directory as the eventual output files. |
COPYRIGHT
Copyright
(C) 1987, 1988 Ronald S. Karr and Landon Curt Noll
Copyright (C) 1992 Ronald S. Karr
See a file COPYING, distributed with the source code, or type smail -bc, to view distribution rights and restrictions associated with this software.