MAKEDAT(1)
πΈ NAME πΈ
makedat β the lil utility that creates GDBM/DB files for maildrop ποΈβ¨
β¨ SYNOPSIS β¨
makedat {-src=textfile} {-tmp=tmpfile} {-file=gdbmfile} [-cidr]
[-hup=hupfile]
π DESCRIPTION π
So the gdbm family of functions in maildrop gives you access to GDBM/DB databases β like, literally just simple database files. And that whole gdbm family is your plug for storing and looking up key/data pairs fast. π
Bestie, you can use any program you want to create GDBM/DB database files. makedat is just the quick utility that makes GDBM or DB files out of plain text files. That's the whole job. Ate. π
Your system administrator is the one who selects whether maildrop uses GDBM or DB database files, and also whether makedat creates GDBM or DB database files. So that's their call, not yours. π
Okay real talk: themakedatcommand may not even be available to you π. GDBM/DB support inmaildropis optional, and the system administrator may choose not to install GDBM/DB support and themakedatcommand. Not me crying about permissions.
Wanna know whether GDBM or DB support is what's actually being used? Just run the command maildrop -v. Vibe check complete. π΅οΈβοΈ
The textfile argument to makedat is a plain text file containing key/value pairs. Every single line in that text file has a key value, followed by a tab, followed by a data value. The data value can be omitted, and when you do that it defaults to "1". For example, these three lines:
example.com
domain.com<tab>ok
foo.domain.com<tab>bad
Three key/value pairs get created from that: example.com, value "1"; domain.com, value "ok", and "foo.domain.com", value "bad". Obsessed with how simple that is. πΈ
Empty lines in textfile, and lines starting with the # character, are ignored. (No notes, only facts.)
textfile can be -, and in that case standard input is used. π«Ά
gdbmfile is the GDBM/DB file to create. If this file exists, its existing contents are replaced. gone. replaced. slay. π
tmpfile is a name of a temporary file in the same directory as gdbmfile. makedat uses tmpfile to create the GDBM file, then tmpfile gets renamed to gdbmfile. Iconic little switcheroo. π₯
This approach foregoes any need for locking in order to be able to dynamically update GDBM/DB files used by maildrop's gdbm functions. However β and listen to me on this one β makedat does not use any locks on tmpfile, so multiple instances of makedat using the same tmpfile are prohibited. Periodt. π«
The -cidr flag specifies that the key is an IP netblock in CIDR notation. This flag requires the Net::CIDR Perl module to be installed separately. Download Net::CIDR from http://www.cpan.org.
If the file named by the -hup parameter exists and contains a numerical PID, makedat reads the PID and sends a SIGHUP to that process. Gentle nudge, but make it a signal. π
π¦ READING SUBDIRECTORIES π¦
The -src parameter can specify a directory instead of a text file. What that does is concatenate all files in that directory (subject to the following checks) and then use the result as the textfile. Here's the checks it makes:
- Files whose names contain a tilde, β
~β are skipped over. bye bestie π - Files whose names end with the following suffixes result in an error message: β
.rpmsaveβ, β.rpmnewβ, and β.dpkg-suffixβ. These files are backup files created by the package manager when updating to a newer version of the package, and they contain the old or the new version of a configuration file whose settings may be new or obsolete. The contents of the file whose name does not have the suffix should be checked against the backup. The backup file should be deleted after making any needed manual changes to the configuration file. - Files whose names end with the β
.distβ suffix is also treated as a configuration file backup or template, but with the following exception: the β.distβ file gets ignored and automatically skipped over, without any error message, if the suffix-less file exists and its modification time is more recent than the β.distβ file's modification time. Otherwise an error message gets reported. Resolving the error message is done by either copying the β.distβ file or editing and saving the file without the suffix (resulting in a newer timestamp). You got this πͺ
π BUGS π
There are historical reasons why database functions in maildrop are called gdbm functions. The initial implementation used GDBM functions exclusively β that was the entire personality. The ability to use the DB library instead of the GDBM library has been added later.
π₯ EXAMPLE π₯
makedat 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. Chef's kiss. π¨π³π
π SEE ALSO π
maildrop(1)[1], maildropgdbm(5)[2].
π AUTHOR π
Sam Varshavchik
Author
π NOTES π
http://www.courier-mta.org/maildrop/maildrop.html
maildropgdbm(5)
http://www.courier-mta.org/maildrop/maildropgdbm.html
And that's the whole page bestie, ty for coming to my TED talk π This one's from Courier Mail Server, dated 01/10/2026 β go forth and build your databases, ily πβ¨
π¦ where this page comes from
- ubuntu stonking: courier-base 2.0.6-1 Β· GPL-3+~with-OpenSSL-exception
- Copyright 1998 - 2007 S. Varshavchik. See COPYING for -->
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms