chiark / gitweb /
Merge branches 'idx/verh' and 'idx/qmqpc'
[qmail] / qmail-smtpd.8
CommitLineData
2117e02e
MW
1.TH qmail-smtpd 8
2.SH NAME
3qmail-smtpd \- receive mail via SMTP
4.SH SYNOPSIS
5.B qmail-smtpd
6.SH DESCRIPTION
7.B qmail-smtpd
8receives mail messages via the Simple Mail Transfer Protocol (SMTP)
9and invokes
10.B qmail-queue
11to deposit them into the outgoing queue.
12.B qmail-smtpd
13must be supplied several environment variables;
14see
15.BR tcp-environ(5) .
16
17.B qmail-smtpd
18is responsible for counting hops.
19It rejects any message with 100 or more
20.B Received
21or
22.B Delivered-To
23header fields.
24
25.B qmail-smtpd
26supports ESMTP, including the 8BITMIME and PIPELINING options.
27.SH TRANSPARENCY
28.B qmail-smtpd
29converts the SMTP newline convention into the UNIX newline convention
30by converting CR LF into LF.
212b6f5d
MW
31It returns a temporary error and drops the connection on bare LFs;
32see
33.BR http://pobox.com/~djb/docs/smtplf.html .
2117e02e
MW
34
35.B qmail-smtpd
36accepts messages that contain long lines or non-ASCII characters,
37even though such messages violate the SMTP protocol.
38.SH "CONTROL FILES"
39.TP 5
ca51b51d
MW
40.I addrcheck.cdb
41A database of acceptable mailboxes. If present, this is used to report
42erroneous RCPT TO commands, which can reduce the amount of junk mail
43accepted. It contains an encoding of the virtual domains map
44.RB ( \c
45.BI V domain
46maps to
47.IR prefix ),
48the local domains
49.RB ( \c
50.BI @ domain
51maps to an empty string), and the available local parts
52.RB ( \c
53.BI L mailbox
54maps to
55.B +
56if the address is valid or
57.B \-
58if not). It's best made using
59.BR qmail-valid-addresses (8).
60.TP 5
61.I addrcheck-delay
62Delay in seconds before reporting bad mailbox names after the
63.I addrcheck-slow
64limit is reached. The default is 2.
65.TP 5
66.I addrcheck-limit
67Number of bad mailbox names to tolerate before dropping the connection.
68Zero means an infinite number. The default is 50.
69.TP 5
70.I addrcheck-slow
71Number of bad mailbox names to tolerate before imposing delays. The
72default is 5.
73.TP 5
2117e02e
MW
74.I badmailfrom
75Unacceptable envelope sender addresses.
76.B qmail-smtpd
77will reject every recipient address for a message
78if the envelope sender address is listed in
79.IR badmailfrom .
80A line in
81.I badmailfrom
82may be of the form
83.BR @\fIhost ,
84meaning every address at
85.IR host .
86.TP 5
212b6f5d
MW
87.I databytes
88Maximum number of bytes allowed in a message,
89or 0 for no limit.
90Default: 0.
91If a message exceeds this limit,
92.B qmail-smtpd
93returns a permanent error code to the client;
94in contrast, if
95the disk is full or
96.B qmail-smtpd
97hits a resource limit,
98.B qmail-smtpd
99returns a temporary error code.
100
101.I databytes
102counts bytes as stored on disk, not as transmitted through the network.
103It does not count the
104.B qmail-smtpd
105Received line, the
106.B qmail-queue
107Received line, or the envelope.
108
109If the environment variable
110.B DATABYTES
111is set, it overrides
112.IR databytes .
113.TP 5
2117e02e
MW
114.I localiphost
115Replacement host name for local IP addresses.
116Default:
117.IR me ,
118if that is supplied.
119.B qmail-smtpd
120is responsible for recognizing dotted-decimal addresses for the
121current host.
122When it sees a recipient address of the form
123.IR box@[d.d.d.d] ,
124where
125.I d.d.d.d
126is a local IP address,
127it replaces
128.IR [d.d.d.d]
129with
130.IR localiphost .
131This is done before
132.IR rcpthosts .
133.TP 5
212b6f5d
MW
134.I morercpthosts
135Extra allowed RCPT domains.
136If
137.I rcpthosts
138and
139.I morercpthosts
140both exist,
141.I morercpthosts
142is effectively appended to
143.IR rcpthosts .
144
145You must run
146.B qmail-newmrh
147whenever
148.I morercpthosts
149changes.
150
151Rule of thumb for large sites:
152Put your 50 most commonly used domains into
153.IR rcpthosts ,
154and the rest into
155.IR morercpthosts .
156.TP 5
2117e02e
MW
157.I rcpthosts
158Allowed RCPT domains.
159If
160.I rcpthosts
161is supplied,
162.B qmail-smtpd
163will reject
164any envelope recipient address with a domain not listed in
10649f16
MW
165.I rcpthosts
166unless the sending host is a designated relay client (see the
167description of the
168.I relayhosts
169file beow).
2117e02e
MW
170
171.I rcpthosts
172may include wildcards:
173
174.EX
175 heaven.af.mil
176 .heaven.af.mil
177.EE
178
179Envelope recipient addresses without @ signs are
180always allowed through.
181.TP 5
10649f16
MW
182.I relayhosts
183Allowed relay clients. Each line is a host-suffix pair, separated by a
184colon. If the client's hostname matches one of the hostnames in the
185file, that client is permitted to send mail to any host (i.e., to use us
186as a relay), and the corresponding suffix is appended to all recipient
187addresses generated by the client.
188
189.I relayhosts
190may include wildcards:
191
192.EX
193 heaven.af.mil:
194 .heaven.af.mil:
195 hell.irs.gov:.irs.virtdomain
196.EE
197
198For historical reasons, the
199.B RELAYCLIENT
200environment variable overrides this table. If
201.B RELAYCLIENT
202is set, it has the same effect as there being a matching entry in the
203.I relayhosts
204file, using the value of
205.B RELAYCLIENT
206as the suffix.
207.TP 5
2117e02e
MW
208.I smtpgreeting
209SMTP greeting message.
210Default:
211.IR me ,
212if that is supplied;
213otherwise
214.B qmail-smtpd
215will refuse to run.
216The first word of
217.I smtpgreeting
218should be the current host's name.
219.TP 5
220.I timeoutsmtpd
221Number of seconds
222.B qmail-smtpd
223will wait for each new buffer of data from the remote SMTP client.
224Default: 1200.
225.SH "SEE ALSO"
226tcp-env(1),
227tcp-environ(5),
228qmail-control(5),
229qmail-inject(8),
212b6f5d 230qmail-newmrh(8),
2117e02e
MW
231qmail-queue(8),
232qmail-remote(8)