1.\"	$OpenBSD: makemap.8,v 1.12 2010/09/23 14:51:57 jmc Exp $
2.\"
3.\" Copyright (c) 1998-2002 Sendmail, Inc. and its suppliers.
4.\"	 All rights reserved.
5.\" Copyright (c) 1988, 1991, 1993
6.\"	The Regents of the University of California.  All rights reserved.
7.\"
8.\" By using this file, you agree to the terms and conditions set
9.\" forth in the LICENSE file which can be found at the top level of
10.\" the sendmail distribution.
11.\"
12.\"
13.\"     $Id: makemap.8,v 8.32 2013-11-22 20:51:52 ca Exp $
14.\"
15.Dd $Mdocdate: June 9 2014 $
16.Dt MAKEMAP 8
17.Os
18.Sh NAME
19.Nm makemap
20.Nd create database maps for sendmail
21.Sh SYNOPSIS
22.Nm makemap
23.Op Fl C Ar file
24.Op Fl N
25.Op Fl c Ar cachesize
26.Op Fl D Ar commentchar
27.Op Fl d
28.Op Fl e
29.Op Fl f
30.Op Fl l
31.Op Fl o
32.Op Fl r
33.Op Fl s
34.Op Fl t Ar delim
35.Op Fl u
36.Op Fl v
37.Ar maptype
38.Ar mapname
39.Sh DESCRIPTION
40.Nm
41creates the database maps used by the keyed map lookups in
42.Xr sendmail 8 .
43It reads input from the standard input
44and outputs them to the indicated
45.Ar mapname .
46.Pp
47Depending on how it is compiled,
48.Nm
49handles up to three different database formats,
50selected using the
51.Ar maptype
52parameter.
53They may be
54.Bl -tag -width Fl
55.It Li dbm
56DBM format maps.
57This requires the
58.Xr ndbm 3
59library.
60.It Li btree
61B-Tree format maps.
62This requires the new Berkeley DB
63library.
64.It Li hash
65Hash format maps.
66This also requires the Berkeley DB
67library.
68.El
69.Pp
70In all cases,
71.Nm
72reads lines from the standard input consisting of two
73words separated by whitespace.
74The first is the database key,
75the second is the value.
76The value may contain
77``%\fIn\fP''
78strings to indicated parameter substitution.
79Literal percents should be doubled
80(``%%'').
81Blank lines and lines beginning with ``#'' are ignored.
82.Pp
83Notice: do
84.Em not
85use
86.Nm
87to create the aliases data base, but
88.Xr newaliases 8
89which puts a special token into the data base that is required by
90.Xr sendmail 8 .
91.Pp
92If the
93.Li TrustedUser
94option is set in the sendmail configuration file and
95.Nm
96is invoked as root, the generated files will be owned by
97the specified
98.Li TrustedUser .
99.Ss Flags
100.Bl -tag -width Fl
101.It Fl C Ar file
102Use the specified
103.Xr sendmail 8
104configuration
105.Ar file
106for looking up the
107.Li TrustedUser
108option.
109.It Fl N
110Include the null byte that terminates strings
111in the map.
112This must match the
113.Fl N
114flag in the sendmail.cf
115.Dq K
116line.
117.It Fl c
118Use the specified hash and B-Tree cache size.
119.It Fl D
120Use to specify the character to use to indicate a comment (which is ignored)
121instead of the default of
122.Sq # .
123.It Fl d
124Allow duplicate keys in the map.
125This is only allowed on B-Tree format maps.
126If two identical keys are read,
127they will both be inserted into the map.
128.It Fl e
129Allow empty value (right hand side).
130.It Fl f
131Normally all upper case letters in the key
132are folded to lower case.
133This flag disables that behaviour.
134This is intended to mesh with the
135.Fl f
136flag in the
137.Dq K
138line in sendmail.cf.
139The value is never case folded.
140.It Fl l
141List supported map types.
142.It Fl o
143Append to an old file.
144This allows you to augment an existing file.
145.It Fl r
146Allow replacement of existing keys.
147Normally
148.Nm
149complains if you repeat a key,
150and does not do the insert.
151.It Fl s
152Ignore safety checks on maps being created.
153This includes checking for hard or symbolic
154links in world writable directories.
155.It Fl t
156Use the specified delimiter instead of white space
157(also for dumping a map).
158.It Fl u
159dump (unmap) the content of the database to standard output.
160.It Fl v
161Verbosely print what it is doing.
162.El
163.Sh SEE ALSO
164.Xr editmap 8 ,
165.Xr newaliases 8 ,
166.Xr sendmail 8
167.Sh HISTORY
168The
169.Nm
170command appeared in
171.Bx 4.4 .
172