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