xref: /openbsd/usr.sbin/smtpd/makemap.8 (revision 404b540a)
1.\"	$OpenBSD: makemap.8,v 1.10 2009/10/11 17:40:49 gilles Exp $
2.\"
3.\" Copyright (c) 2009 Jacek Masiulaniec <jacekm@openbsd.org>
4.\" Copyright (c) 2008-2009 Gilles Chechade <gilles@openbsd.org>
5.\"
6.\" Permission to use, copy, modify, and distribute this software for any
7.\" purpose with or without fee is hereby granted, provided that the above
8.\" copyright notice and this permission notice appear in all copies.
9.\"
10.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17.\"
18.Dd $Mdocdate: October 11 2009 $
19.Dt MAKEMAP 8
20.Os
21.Sh NAME
22.Nm makemap
23.Nd create database maps for smtpd
24.Sh SYNOPSIS
25.Nm makemap
26.Op Fl o Ar dbfile
27.Op Fl t Ar type
28.Ar file
29.Sh DESCRIPTION
30Maps provide a generic interface for associating textual key to a value.
31Such associations may be accessed through a plaintext file, database, or DNS.
32The format of these file types is described below.
33.Nm
34itself creates the database maps used by keyed map lookups specified in
35.Xr smtpd.conf 5 .
36.Pp
37.Nm
38reads input from
39.Ar file
40and writes data to a file whose name is made by adding a
41.Dq .db
42suffix to
43.Ar file .
44In all cases,
45.Nm
46reads lines consisting of words separated by whitespace.
47The first word of a line is the database key;
48the remainder represents the mapped value.
49The database key and value may optionally be separated
50by the colon character.
51.Pp
52The options are as follows:
53.Bl -tag -width Ds
54.It Fl o Ar dbfile
55Write the generated database to
56.Ar dbfile .
57.It Fl t Ar type
58Specify the format of the resulting map file.
59The default map format is suitable for storing simple, unstructured,
60key-to-value string associations.
61However, if the mapped value has special meaning,
62as in the case of the virtual domains file,
63a suitable
64.Ar type
65must be provided.
66The available output types are:
67.Bl -tag -width "aliases"
68.It Cm aliases
69The mapped value is a comma-separated list of mail destinations.
70This format can be used for building user aliases and
71virtual domains files.
72.El
73.Pp
74.El
75.Ex -std makemap
76.Sh VIRTUAL DOMAINS
77Virtual domains are kept in maps.
78To create single virtual address, add
79.Dq user@example.com	user
80to the virtual map.
81To handle all mail destined to any user at example.com, add
82.Dq @example.com	user
83to the virtual map.
84.Pp
85In addition to adding an entry to the virtual map,
86one must add a filter rule that accepts mail for virtual domains,
87for example:
88.Bd -literal -offset indent
89map "vdomains" { source db "/etc/mail/vdomains.db" }
90
91accept for virtual map "vdomains" deliver to mbox
92.Ed
93.Sh FILES
94.Bl -tag -width "/etc/mail/aliasesXXX" -compact
95.It Pa /etc/mail/aliases
96List of user mail aliases.
97.It Pa /etc/mail/virtual
98List of hosted virtual domains.
99.It Pa /etc/mail/secrets
100List of remote host credentials.
101.El
102.Sh SEE ALSO
103.Xr aliases 5 ,
104.Xr smtpd.conf 5 ,
105.Xr editmap 8 ,
106.Xr newaliases 8 ,
107.Xr smtpd 8
108.Sh HISTORY
109The
110.Nm
111command first appeared in
112.Ox 4.6
113as a replacement for the equivalent command shipped with sendmail.
114