blob: 71434898dd30dc394e3dcbac0369ae1ba28e1dd1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
.\" Copyright (c) 2000-2001 Sendmail, Inc. and its suppliers.
.\" All rights reserved.
.\"
.\" By using this file, you agree to the terms and conditions set
.\" forth in the LICENSE file which can be found at the top level of
.\" the sendmail distribution.
.\"
.\"
.\" $Sendmail: editmap.8,v 1.8 2001/06/15 21:33:19 ca Exp $
.\"
.Dd June 15, 2001
.Dt EDITMAP 8
.Os
.Sh NAME
.Nm editmap
.Nd query and edit single records in database maps for sendmail
.Sh SYNOPSIS
.Nm editmap
.Op Fl C Ar file
.Op Fl N
.Op Fl f
.Op Fl q | Fl u | Fl x
maptype mapname key
.Op Dq value ...
.Sh DESCRIPTION
.Nm editmap
queries or edits one record in a database maps used by the keyed map lookups in
.Xr sendmail 8 .
Arguments are passed on the command line and output (for queries) is
directed to standard output.
.Pp
Depending on how it is compiled,
.Nm
handles up to three different database formats,
selected using the
.Ar maptype
parameter.
They may be
.Bl -tag -width Fl
.It Li dbm
DBM format maps.
This requires the
.Xr ndbm 3
library.
.It Li btree
B-Tree format maps.
This requires the new Berkeley DB
library.
.It Li hash
Hash format maps.
This also requires the Berkeley DB
library.
.El
.Pp
If the
.Li TrustedUser
option is set in the sendmail configuration file and
.Nm
is invoked as root, the generated files will be owned by
the specified
.Li TrustedUser .
.Ss Flags
.Bl -tag -width Fl
.It Fl C Ar file
Use the specified
.Xr sendmail 8
configuration
.Ar file
for looking up the
.Li TrustedUser
option.
.It Fl N
Include the null byte that terminates strings
in the map (for alias maps).
.It Fl f
Normally all upper case letters in the key
are folded to lower case.
This flag disables that behaviour.
This is intended to mesh with the
.Fl f
flag in the
.Dq K
line in sendmail.cf.
The value is never case folded.
.It Fl q
Query the map for the specified key.
If found, print value to standard output and exit with 0.
If not found then print an error message to stdout and exit with
.Dv EX_UNAVAILABLE .
.It Fl u
Updates the record for
.Ar key
with
.Ar value
or inserts a new record if one doesn't exist.
Exits with 0 on success or
.Dv EX_IOERR
on failure.
.It Fl x
Deletes the specific key from the map.
Exits with 0 on success or
.Dv EX_IOERR
on failure.
.El
.Sh SEE ALSO
.Xr makemap 8 ,
.Xr sendmail 8
.Sh HISTORY
The
.Nm
command appeared in
.Ox 3.0 .
|