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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
|
.\" BSDI $Id: checksendmail.8,v 1.1.1.1 1994/01/13 21:15:31 polk Exp $
.Dd January 12, 1994
.Dt CHECKSENDMAIL 8
.Os
.Sh NAME
.Nm checksendmail
.Nd verify sendmail address transformations.
.Sh SYNOPSIS
.Nm checksendmail
.Op Fl C Ar file.cf
.Op Fl r Ar resolve
.Op Fl T Ar test.address
.Op Fl b Ar sendmail_binary
.Sh DESCRIPTION
.Pp
The
.Nm checksendmail
program is a
.Xr perl
script that aids the testing of
.Xr sendmail 8 's
various configuration files.
.Nm checksendmail
passes typical addresses (supplied in input files) through
.Xr sendmail
and prints the results of the resolution and transformation routines.
.Pp
The input files contain a list of addresses, one per line.
For example:
.Bd -literal -offset indent
user
user@site
user@site.com
.Ed
.Pp
The input file can contain comments started with a
.Em #
and blank lines.
.Sh OPTIONS
.Pp
.Bl -tag -width Fl -compact -offset left
.It Fl C Ar file.cf
Use the
.Xr sendmail
configuration file
.Ar file.cf
instead of the default
.Pa /etc/sendmail.cf
file.
.It Fl r Ar resolve
Use
.Ar resolve
as the input file for the addresses to be used for mail resolving. Defaults
to
.Ar address.resolve .
.It Fl T Ar test.address
Use
.Ar test.address
as the single address to test. Cannot be used in conjunction with
file setting flags.
.It Fl B Ar sendmail_binary
Use the specified
.Ar sendmail_binary
as the path to invoke sendmail (instead of
.Pa /usr/sbin/sendmail ) .
.El
.Sh EXAMPLES
.Pp
The following command will pass the addresses in
.Ar address.resolve
through
.Xr sendmail
using the configuration information in
.Ar myconfig.cf .
.Bd -literal -offset left
example% cat address.resolve
user
user@site
user@site.com
example% checksendmail \-C myconfig.cf
config file: myconfig.cf resolve file: address.resolve
towhom file: address.resolve fromwhom file: address.resolve
Mail address resolution
user --(ether )--> user[rmtc]
user@site --(ether )--> user@site[rmtc]
user@site.com --(ether )--> user@site.com[rmtc]
`To' address transformations for mailer ether:
user ----> user
user@site ----> user@site
user@site.com ----> user@site.com
`From' address transformations for mailer ether:
user ----> user
user@site ----> user
user@site.com ----> user
.Ed
.Pp
The first section of the output shows how the addresses in the input
files are resolved by
.Xr sendmail 8 .
Consider the following output line:
.Pp
.Dl user@site.com --(ether )--> user@site.com[rmtc]
.Pp
The input address
.Em user@site.com
resolves to use the
.Em ether
mailer. That mailer is directed to send the mail to
to the user
.Em user@site.com
at site
.Em rmtc
(as indicated in the square brackets).
.Pp
The two later sections of output show how the addresses specified as
the
.Em To
and
.Em From
address are transformed in the text of the
headers. In the example above, the
.Em To
addresses are untouched.
The
.Em From
addresses, however, all lose their machine information on
the way through the mailer:
.Pp
.Dl user@site ----> user
.Pp
This may be desirable when using a configuration file on a
workstation which is to be hidden as a mailhost from the rest of the
network.
.Pp
The following is a set of addresses used at one site for the purposes of
testing address resolution. Comments after the addresses detail why
particular addresses are present:
.Bl -tag -width "user@machine.com" -compact -offset indent
.It user
Standard trivial address
.It user@rmtc
qualified at one level
.It user@rmtc.central
qualified at two levels
.It user@rmtc.central.sun.com
qualified all the way
.It rmtc!user
local but specified as uucp
.It user@summit
a workstation (normally delivered locally, though)
.It user@summit.central
same but more qualified
.It user@summit.central.sun.com
same but fully qualified
.It summit!user
same but specified as uucp
.It user@prisma
Backward compatibility tests
.It user@prisma.com
.It prisma!user
.It user@central
Superior domain testing
.It user@machine.central
more qualified, but unknown
.It user@summit.central
more qualified and known
.It user@eng
name in faraway domain
.It user@machine.eng
unknown machine in faraway domain
.It user@summit.eng
local machine, far away domain
.It user@hoback
far away machine
.It user@machine
apparently local but unknown machine
.It user@sun.com
Standard trivial address
.It user@machine.dom.sun.com
fully qualified but unknown machine
.It user@foo.com
standard, known, really far away domain
.It user@foo.dom
standard, unknown, really far away domain
.It site!user
Single level uucp
.It site1!site2!user
Double level uucp
.It user@foo.dom@bar.dom
Trickier address
.It site!user@foo.dom
Mixed uucp/domain
.It site!user@uunet.uu.net
Mixed double uucp/domain
.El
.Sh NOTES
Note that
.Nm checksendmail
is a
.Xr perl
script. If your site does not have
.Xr perl 1 ,
it can be obtained via anonymous
.Xr ftp
from
.Em ftp.uu.net .
.Pp
.Xr sendmail
requires that the user have access to directory specified by the
.Em OQ
parameter in the configuration file (normally
.Pa /usr/spool/mqueue ) .
.Nm checksendmail
verifies that the user has access to this directory before allowing the
test to continue.
.Sh AUTHORS
.Bd -literal
Gene Kim
Rob Kolstad
Jeff Polk
.Ed
.Sh "SEE ALSO"
.Xr sendmail 8
|