maildrop.makegdbm textfile tmpfile gdbmfile makegdbm textfile tmpfile gdbmfile
You can use any program that uses the GDBM library in order to create the GDBM database files. maildrop.makegdbm is a quick utility to create GDBM files from plain text files.
The maildrop.makegdbm command may not be available to you. GDBM support in maildrop is optional, and the system administrator may choose not to install GDBM support and the maildrop.makegdbm command.
The system administrator may also install the alias makegdbm for the maildrop.makegdbm command. The makegdbm alias should only be used manually, scripts should always execute maildrop.makegdbm.
The first argument to maildrop.makegdbm is a plain text file containing key/value pairs. Each line in the text file contains a key value, followed by a tab and a data value. The data value may be omitted, which maildrop.makegdbm will default to "1". For example, the following three lines:
example.com domain.com<tab>ok foo.domain.com<tab>bad
Three key/value pairs are created: example.com, value "1"; domain.com, value "ok", and "foo.domain.com", value "bad".
Empty lines in textfile, and lines starting with the # character, are ignored.
textfile can be "-", in which case standard input is used.
gdbmfile is the GDBM file to create. If this file exists, its existing contents are replaced.
tmpfile is a name of a temporary file in the same directory as gdbmfile. tmpfile is used by maildrop.makegdbm to create the GDBM file, then tmpfile is renamed to gdbmfile.
This approach foregoes any need for locking in order to be able to dynamically update GDBM files used by maildrop's gdbm functions. However, maildrop.makegdbm does not use any locks on tmpfile, so multiple instances of maildrop.makegdbm using the same tmpfile are prohibited.
maildrop.makegdbm blacklist /etc/mail/blacklist.tmp /etc/mail/blacklist.dat
Takes blacklist, and creates /etc/mail/blacklist.dat, using /etc/mail/blacklist.tmp as a temporary file.