MAKEMAP(8)
β¨ MAKEMAP(8) β¨
okay bestie, so this is makemap from section 8 of the manual β the system manager's one π
. buckle up, we're making database maps for smtpd and it's gonna slay.
π NAME π
makemap β create database maps for smtpd. that's literally it, that's the whole vibe π«Ά
πΈ SYNOPSIS πΈ
makemap [-U] [-d dbtype] [-o dbfile] [-t type] file
π DESCRIPTION π
so maps are like this generic interface for associating a textual key to a value, right? like a little matching game for your data π₯. these associations can be accessed through a plaintext file, a database, or DNS β pick your fighter. the formats of these file types are described below, don't worry.
makemap itself creates the database maps that get used by keyed map lookups specified in smtpd.conf(5). it's giving behind-the-scenes main character energy honestly.
here's the tea β: makemap reads input from file and writes data to a file which is named by adding a β.dbβ suffix to file. the current line can be extended over multiple lines using a backslash (\). comments can be put anywhere in the file using a hash mark (#), and they extend to the end of the current line.
β οΈ care should be taken when commenting out multi-line text: the comment is effective until the end of the entire block. like it doesn't stop at the next line, bestie, it keeps going π. be careful!
in all cases, makemap reads lines consisting of words separated by whitespace. the first word of a line is the database key; the remainder represents the mapped value. the database key and value may optionally be separated by the colon character. iconic behavior fr fr π
the options are as follows:
β¨ OPTIONS β¨
-ddbtype β specify the format of the database. available formats arehashandbtree. the default value ishash. slay, we love a default π-odbfile β write the generated database to dbfile. simple as that, no cap π-ttype β specify the format of the resulting map file. the default map format is suitable for storing simple, unstructured, key-to-value string associations. however, if the mapped value has special meaning, as in the case of a virtual domains file, a suitable type must be provided. the available output types are:aliasesβ the mapped value is a comma-separated list of mail destinations. this format can be used for building user aliases and user mappings for virtual domain files. very demure, very mindful πsetβ there is no mapped value β a map of this type will only allow for the lookup of keys. this format can be used for building primary domain maps. it's giving minimalist queen π
-Uβ instead of generating a database map from text input, dump the contents of a database map as text with the key and value separated with a tab. it's the reverse uno card of this whole operation π
π PRIMARY DOMAINS π
primary domains can be kept in tables. to create a primary domain table, add each primary domain on a single line by itself. easy peasy π
in addition to adding an entry to the primary domain map, one must add a filter rule that accepts mail for the domain map, for example:
table domains db:/etc/smtpd/domains.db
action "local" mbox
match for domain <domains> action "local"
see? we love a complete example that actually works π
π¦ VIRTUAL DOMAINS π¦
virtual domains may also be kept in tables. to create a virtual domain table, add each virtual domain on a single line by itself.
virtual domains expect a mapping of virtual users to real users in order to determine if a recipient is accepted or not. the mapping format is an extension to aliases(5), which allows the use of:
- β
user@domain.tldβ to accept user only on the specified domain - β
userβ to accept the user for any of the virtual domains - β
@domain.tldβ to provide a catch-all for the specified domain - β
@β to provide a global catch-all for all domains
smtpd(8) will perform the lookups in that specific order. like it checks them in sequence, no skipping ahead bestie π
to create a single virtual address, add βuser@example.com userβ to the users map. to handle all mail destined to any user at example.com, add β@example.com userβ to the virtual map. it's giving specificity, it's giving catch-all energy π
in addition to adding an entry to the virtual map, one must add a filter rule that accepts mail for virtual domains, for example:
table vdomains db:/etc/smtpd/vdomains.db
table vusers db:/etc/smtpd/users.db
action "local" mbox virtual <vusers>
match for domain <vdomains> action "local"
match for domain "example.org" action "local"
obsessed with how clean that looks ngl π
π FILES π
/etc/smtpd/aliasesβ list of user mail aliases. you know, the classic π/etc/smtpd/secretsβ list of remote host credentials. secrets are secrets, keep them safe π«£
β EXIT STATUS β
the makemap utility exits 0 on success, and >0 if an error occurs. that's the whole thing, no surprises π₯
π SEE ALSO π
aliases(5), smtpd.conf(5), table(5), newaliases(8), smtpd(8)
go read those if you wanna understand the whole ecosystem, iykyk π
π§ HISTORY π§
the makemap command first appeared in OpenBSD 4.6 as a replacement for the equivalent command shipped with sendmail. it's giving glow-up era, we love an upgrade β¨
and that's the whole manual, bestie! this page is from the Debian crew, dated February 13, 2021 β shoutout to them for keeping the docs alive π. now go forth and make those maps, you've got this π«Άβ¨
π¦ where this page comes from
- alpine 3.24: opensmtpd-doc 7.8.0_p0-r0 Β· ISC
- arch rolling: opensmtpd 7.9.0p0-1 Β· custom
- Copyright (c) 2009 Jacek Masiulaniec <jacekm@openbsd.org>
- Copyright (c) 2008-2009 Gilles Chehade <gilles@poolp.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms