maildrop.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 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
This creates three key/value pairs: 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.
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.
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.