1MAKEMAP(8) System Manager's Manual MAKEMAP(8)
2
3
4
6 makemap - create database maps for smtpd
7
9 makemap [-U] [-d dbtype] [-o dbfile] [-t type] file
10
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
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 "/etc/opensmtpd/domains"
67 accept for domain <domains> deliver to mbox
68
70 Virtual domains may also be kept in tables. To create a virtual domain
71 table, add each virtual domain on a single line by itself.
72
73 Virtual domains expect a mapping of virtual users to real users in
74 order to determine if a recipient is accepted or not. The mapping for‐
75 mat is an extension to aliases(5), which allows the use of
76 ``user@domain.tld'' to accept user only on the specified domain,
77 ``user'' to accept the user for any of the virtual domains,
78 ``@domain.tld'' to provide a catch-all for the specified domain and
79 ``@'' to provide a global catch-all for all domains. smtpd(8) will
80 perform the lookups in that specific order.
81
82 To create single virtual address, add ``user@example.com user'' to the
83 users map. To handle all mail destined to any user at example.com, add
84 ``@example.com user'' to the virtual map.
85
86 In addition to adding an entry to the virtual map, one must add a fil‐
87 ter rule that accepts mail for virtual domains, for example:
88 table vdomains "/etc/opensmtpd/vdomains"
89 table vusers "/etc/opensmtpd/users"
90 accept for domain <vdomains> virtual <vusers> deliver to mbox
91 accept for domain example.org virtual <vusers> deliver to mbox
92
94 /etc/opensmtpd/aliases
95 List of user mail aliases.
96
97 /etc/opensmtpd/secrets
98 List of remote host credentials.
99
101 The makemap utility exits 0 on success, and >0 if an error occurs.
102 makemap
103
105 aliases(5), smtpd.conf(5), table(5), newaliases(8), smtpd(8)
106
108 The makemap command first appeared in OpenBSD 4.6 as a replacement for
109 the equivalent command shipped with sendmail.
110
111
112
113 $Mdocdate: February 13 2016 $ MAKEMAP(8)