| 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 badmailfrom |
| 41 | Unacceptable envelope sender addresses. |
| 42 | .B qmail-smtpd |
| 43 | will reject every recipient address for a message |
| 44 | if the envelope sender address is listed in |
| 45 | .IR badmailfrom . |
| 46 | A line in |
| 47 | .I badmailfrom |
| 48 | may be of the form |
| 49 | .BR @\fIhost , |
| 50 | meaning every address at |
| 51 | .IR host . |
| 52 | .TP 5 |
| 53 | .I databytes |
| 54 | Maximum number of bytes allowed in a message, |
| 55 | or 0 for no limit. |
| 56 | Default: 0. |
| 57 | If a message exceeds this limit, |
| 58 | .B qmail-smtpd |
| 59 | returns a permanent error code to the client; |
| 60 | in contrast, if |
| 61 | the disk is full or |
| 62 | .B qmail-smtpd |
| 63 | hits a resource limit, |
| 64 | .B qmail-smtpd |
| 65 | returns a temporary error code. |
| 66 | |
| 67 | .I databytes |
| 68 | counts bytes as stored on disk, not as transmitted through the network. |
| 69 | It does not count the |
| 70 | .B qmail-smtpd |
| 71 | Received line, the |
| 72 | .B qmail-queue |
| 73 | Received line, or the envelope. |
| 74 | |
| 75 | If the environment variable |
| 76 | .B DATABYTES |
| 77 | is set, it overrides |
| 78 | .IR databytes . |
| 79 | .TP 5 |
| 80 | .I localiphost |
| 81 | Replacement host name for local IP addresses. |
| 82 | Default: |
| 83 | .IR me , |
| 84 | if that is supplied. |
| 85 | .B qmail-smtpd |
| 86 | is responsible for recognizing dotted-decimal addresses for the |
| 87 | current host. |
| 88 | When it sees a recipient address of the form |
| 89 | .IR box@[d.d.d.d] , |
| 90 | where |
| 91 | .I d.d.d.d |
| 92 | is a local IP address, |
| 93 | it replaces |
| 94 | .IR [d.d.d.d] |
| 95 | with |
| 96 | .IR localiphost . |
| 97 | This is done before |
| 98 | .IR rcpthosts . |
| 99 | .TP 5 |
| 100 | .I morercpthosts |
| 101 | Extra allowed RCPT domains. |
| 102 | If |
| 103 | .I rcpthosts |
| 104 | and |
| 105 | .I morercpthosts |
| 106 | both exist, |
| 107 | .I morercpthosts |
| 108 | is effectively appended to |
| 109 | .IR rcpthosts . |
| 110 | |
| 111 | You must run |
| 112 | .B qmail-newmrh |
| 113 | whenever |
| 114 | .I morercpthosts |
| 115 | changes. |
| 116 | |
| 117 | Rule of thumb for large sites: |
| 118 | Put your 50 most commonly used domains into |
| 119 | .IR rcpthosts , |
| 120 | and the rest into |
| 121 | .IR morercpthosts . |
| 122 | .TP 5 |
| 123 | .I rcpthosts |
| 124 | Allowed RCPT domains. |
| 125 | If |
| 126 | .I rcpthosts |
| 127 | is supplied, |
| 128 | .B qmail-smtpd |
| 129 | will reject |
| 130 | any envelope recipient address with a domain not listed in |
| 131 | .I rcpthosts |
| 132 | unless the sending host is a designated relay client (see the |
| 133 | description of the |
| 134 | .I relayhosts |
| 135 | file beow). |
| 136 | |
| 137 | .I rcpthosts |
| 138 | may include wildcards: |
| 139 | |
| 140 | .EX |
| 141 | heaven.af.mil |
| 142 | .heaven.af.mil |
| 143 | .EE |
| 144 | |
| 145 | Envelope recipient addresses without @ signs are |
| 146 | always allowed through. |
| 147 | .TP 5 |
| 148 | .I relayhosts |
| 149 | Allowed relay clients. Each line is a host-suffix pair, separated by a |
| 150 | colon. If the client's hostname matches one of the hostnames in the |
| 151 | file, that client is permitted to send mail to any host (i.e., to use us |
| 152 | as a relay), and the corresponding suffix is appended to all recipient |
| 153 | addresses generated by the client. |
| 154 | |
| 155 | .I relayhosts |
| 156 | may include wildcards: |
| 157 | |
| 158 | .EX |
| 159 | heaven.af.mil: |
| 160 | .heaven.af.mil: |
| 161 | hell.irs.gov:.irs.virtdomain |
| 162 | .EE |
| 163 | |
| 164 | For historical reasons, the |
| 165 | .B RELAYCLIENT |
| 166 | environment variable overrides this table. If |
| 167 | .B RELAYCLIENT |
| 168 | is set, it has the same effect as there being a matching entry in the |
| 169 | .I relayhosts |
| 170 | file, using the value of |
| 171 | .B RELAYCLIENT |
| 172 | as the suffix. |
| 173 | .TP 5 |
| 174 | .I smtpgreeting |
| 175 | SMTP greeting message. |
| 176 | Default: |
| 177 | .IR me , |
| 178 | if that is supplied; |
| 179 | otherwise |
| 180 | .B qmail-smtpd |
| 181 | will refuse to run. |
| 182 | The first word of |
| 183 | .I smtpgreeting |
| 184 | should be the current host's name. |
| 185 | .TP 5 |
| 186 | .I timeoutsmtpd |
| 187 | Number of seconds |
| 188 | .B qmail-smtpd |
| 189 | will wait for each new buffer of data from the remote SMTP client. |
| 190 | Default: 1200. |
| 191 | .SH "SEE ALSO" |
| 192 | tcp-env(1), |
| 193 | tcp-environ(5), |
| 194 | qmail-control(5), |
| 195 | qmail-inject(8), |
| 196 | qmail-newmrh(8), |
| 197 | qmail-queue(8), |
| 198 | qmail-remote(8) |