MAKEDAT(1)
β¨ MAKEDAT(1) β¨ β like, the manual page, but make it make sense π
okay bestie, sit down, we're learning makedat(1) today. Double Precision, Inc. made this one. it's giving β¨databaseβ¨, it's giving β¨blacklistβ¨, let's go π¦
πΈ NAME πΈ
makedat β create GDBM/DB files for maildrop. that's it, that's the whole job, she's a one-trick pony and she ate π
π SYNOPSIS π
makedat {-src=textfile} {-tmp=tmpfile} {-file=gdbmfile} [-cidr]
literally exactly that. don't freestyle it π
π DESCRIPTION π
so the gdbm family of functions in maildrop gives you access to GDBM/DB databases β which are, bestie, just simple database files. and what do they do? they give you a way of quickly storing and looking up key/data pairs. fast. efficient. main character energy π
ngl you can use any program you want to create GDBM/DB database files. but makedat is the quick little utility that creates GDBM or DB files from plain text files. it's the shortcut. the cheat code. the girl who does the group project in one night π₯
here's the thing though β your system administrator is the one who picks whether maildrop uses GDBM or DB database files, and also whether makedat creates GDBM or DB database files. so it's giving β¨her choice, her rulesβ¨
β οΈ also, themakedatcommand may not even be available to you!! GDBM/DB support in maildrop is optional, and the system administrator may choose not to install GDBM/DB support and themakedatcommand. so if you can't find her... she might just not be invited to this party π
wanna know which one you're running? run this:
maildrop -v
that tells you whether GDBM or DB support is being used. vibe check complete β
π§ the textfile argument π§
the textfile argument is a plain text file containing key/value pairs. each line in the text file has a key value, followed by a tab and a data value. the data value may be omitted β and if you do that, it defaults to "1". no cap.
for example, these three lines:
example.com
domain.com<tab>ok
foo.domain.com<tab>bad
create three key/value pairs:
example.comwith value"1"domain.comwith value"ok"foo.domain.comwith value"bad"
iconic. three lines, three pairs, no drama β¨
empty lines in textfile, and lines starting with the # character, are ignored. so go ahead, leave yourself little notes, she won't read them π
and plot twist: textfile can be -, in which case standard input is used. very flexible of her π«Ά
π the gdbmfile argument π
gdbmfile is the GDBM/DB file to create. if this file already exists, its existing contents are replaced. gone. bye. not sorry. π
π the tmpfile argument π
tmpfile is a name of a temporary file in the same directory as gdbmfile. makedat uses tmpfile to create the GDBM file, and then tmpfile gets renamed to gdbmfile. sneaky? no, genius. β¨
this approach foregoes any need for locking in order to be able to dynamically update GDBM/DB files used by maildrop's gdbm functions. that's the whole point of the little rename dance π§
β οΈ BUT. and this is a big but.makedatdoes not use any locks on tmpfile, so multiple instances ofmakedatusing the same tmpfile are prohibited. do not do it. do not try it. do not text your friend "watch this" π΅
π the -cidr flag π
the -cidr flag specifies that the key is an IP netblock in CIDR notation.
heads up though: this flag requires the Net::CIDR Perl module to be installed separately. download Net::CIDR from http://www.cpan.org. go get her, she's free π
π BUGS π
there are historical reasons why database functions in maildrop are called gdbm functions. the initial implementation used GDBM functions exclusively. the ability to use the DB library instead of the GDBM library has been added later. so it's a naming thing. a legacy thing. a "we've been calling it that for years and we're not stopping now" thing π
β 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. slay. that's it. that's the whole thing π
π¦ SEE ALSO π¦
maildrop(1)[1]maildropgdbm(5)[2]
π AUTHOR π
Sam Varshavchik
- Author
(the one, the only, the legend herself π«Ά)
π NOTES π
maildrop(1)http://www.courier-mta.org/maildrop/maildrop.htmlmaildropgdbm(5)http://www.courier-mta.org/maildrop/maildropgdbm.html
and that's the whole page bestie!! this one came out of the Courier Mail Server, dated 11/04/2020, and yeah the manpage header says MAKEDAT(1) three times because that's just how manpages are, she's a little extra like that π
β¨ stay slaying, go build your databases, and don't share your tmpfile π
π¦ where this page comes from
- epel 9: maildrop 3.0.8-1.el9 Β· GPLv2 with exceptions
- fedora 43: maildrop 3.1.0-7.fc43 Β· GPL-3.0-only WITH Classpath-exception-2.0
- fedora 44: maildrop 3.1.0-8.fc44 Β· GPL-3.0-only WITH Classpath-exception-2.0
- nixos 26.05: maildrop 3.2.1
- Copyright 1998 - 2007 Double Precision, Inc. See COPYING for -->
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms