1MAKEMAP(8)                  System Manager's Manual                 MAKEMAP(8)
2
3
4

NAME

6       makemap - create database maps for smtpd
7

SYNOPSIS

9       makemap [-U] [-d dbtype] [-o dbfile] [-t type] file
10

DESCRIPTION

12       Maps provide a generic interface for associating textual key to a
13       value.  Such associations may be accessed through a plaintext file,
14       database, or DNS.  The format of these file types is described below.
15       makemap itself creates the database maps used by keyed map lookups
16       specified in smtpd.conf(5).
17
18       makemap reads input from file and writes data to a file whose name is
19       made by adding a ``.db'' suffix to file.  The current line can be
20       extended over multiple lines using a backslash (Sq \.)  Comments can be
21       put anywhere in the file using a hash mark (Sq #,) and extend to the
22       end of the current line.  Care should be taken when commenting out
23       multi-line text: the comment is effective until the end of the entire
24       block.  In all cases, makemap reads lines consisting of words separated
25       by whitespace.  The first word of a line is the database key; the
26       remainder represents the mapped value.  The database key and value may
27       optionally be separated by the colon character.
28
29       The options are as follows:
30
31            -d dbtype
32                   Specify the format of the database.  Available formats are
33                   hash and btree.  The default value is hash.
34
35            -o dbfile
36                   Write the generated database to dbfile.
37
38            -t type
39                   Specify the format of the resulting map file.  The default
40                   map format is suitable for storing simple, unstructured,
41                   key-to-value string associations.  However, if the mapped
42                   value has special meaning, as in the case of the virtual
43                   domains file, a suitable type must be provided.  The avail‐
44                   able output types are:
45
46                 aliases
47                        The mapped value is a comma-separated list of mail
48                        destinations.  This format can be used for building
49                        user aliases and user mappings for virtual domain
50                        files.
51
52                 set    There is no mapped value – a map of this type will
53                        only allow for the lookup of keys.  This format can be
54                        used for building primary domain maps.
55
56            -U     Instead of generating a database map from text input, dump
57                   the contents of a database map as text with the key and
58                   value separated with a tab.
59

PRIMARY DOMAINS

61       Primary domains can be kept in tables.  To create a primary domain ta‐
62       ble, add each primary domain on a single line by itself.
63
64       In addition to adding an entry to the primary domain map, one must add
65       a filter rule that accepts mail for the domain map, for example:
66           table domains db:/etc/opensmtpd/domains.db
67           action "local" mbox
68           match for domain <domains> action "local"
69

VIRTUAL DOMAINS

71       Virtual domains may also be kept in tables.  To create a virtual domain
72       table, add each virtual domain on a single line by itself.
73
74       Virtual domains expect a mapping of virtual users to real users in
75       order to determine if a recipient is accepted or not.  The mapping for‐
76       mat is an extension to aliases(5), which allows the use of
77       ``user@domain.tld'' to accept user only on the specified domain,
78       ``user'' to accept the user for any of the virtual domains,
79       ``@domain.tld'' to provide a catch-all for the specified domain and
80       ``@'' to provide a global catch-all for all domains.  smtpd(8) will
81       perform the lookups in that specific order.
82
83       To create single virtual address, add ``user@example.com user'' to the
84       users map.  To handle all mail destined to any user at example.com, add
85       ``@example.com user'' to the virtual map.
86
87       In addition to adding an entry to the virtual map, one must add a fil‐
88       ter rule that accepts mail for virtual domains, for example:
89           table vdomains db:/etc/opensmtpd/vdomains.db
90           table vusers db:/etc/opensmtpd/users.db
91           action "local" mbox virtual <vusers>
92           match for domain <vdomains> action "local"
93           match for domain "example.org" action "local"
94

FILES

96            /etc/opensmtpd/aliases
97                   List of user mail aliases.
98
99            /etc/opensmtpd/secrets
100                   List of remote host credentials.
101

EXIT STATUS

103       The makemap utility exits 0 on success, and >0 if an error occurs.
104       makemap
105

SEE ALSO

107       aliases(5), smtpd.conf(5), table(5), newaliases(8), smtpd(8)
108

HISTORY

110       The makemap command first appeared in OpenBSD 4.6 as a replacement for
111       the equivalent command shipped with sendmail.
112
113
114
115                         $Mdocdate: November 25 2018 $              MAKEMAP(8)
Impressum