11.4 Remote Mail Failures

Remote delivery attempts can fail in a myriad of ways. Failures fall into two general categories: temporary, which means that the delivery might work later and should be retried, or permanent, which means that the message can't be delivered at all. On a temporary failure, qmail-send retries the delivery later, while on a permanent failure, it immediately sends back a bounce message with whatever error report qmail-remote produced. Errors include:


Connected to host but greeting failed

Temporary. The remote server accepted the connection but never sent the initial SMTP greeting.


Connected to host but my name was rejected

Temporary. The remote host rejected the HELO command.


Connected to host but sender was rejected

Temporary or permanent. The remote host rejected the MAIL FROM command. If the remote code was 4xx it's a temporary error, if 5xx a permanent error.


Host does not like recipient

Temporary or permanent. The remote host rejected the RCPT TO command. If the remote code was 4xx it's a temporary error, if 5xx a permanent error.


Failed on DATA command

Temporary or permanent. The remote host rejected the DATA command. If the remote code was 4xx it's a temporary error, if 5xx a permanent error.


Failed after I sent the message

Temporary or permanent. The remote host accepted the DATA command and the text of the mail message, but returned an error code after the message was accepted. If the remote code was 4xx it's a temporary error, if 5xx a permanent error.

Qmail only delivers mail to one recipient at a time, but qmail-remote accepts multiple recipient arguments, and tries to deliver to multiple recipients. It returns separate status codes for each RCPT TO and sends the message if any of the recipients were accepted.

QMQP and QMTP

Dan has invented two host-to-host protocols for people who aren't thrilled with SMTP. Despite their similar names, QMQP and QMTP are not compatible with each other and are intended for very different purposes. Qmail comes with servers for both, called qmail-qmqpd and qmail-qmtpd. Both run from tcpserver and are set up the same way as qmail-smtpd.

The simpler one is Quick Mail Queueing Protocol (QMQP) described at http://cr.yp.to/proto/qmqp.html. QMQP is currently used only by mini-qmail, a stripped-down version of qmail that passes all mail directly to a smarthost for delivery. It has no queueing, no secondary hosts, and no internal security. To avoid creating open spam relays, the TCP rules for tcpserver must permit connections only from known friendly hosts and deny connections from everywhere else.

Mini-qmail is primarily useful to pass incoming mail across a firewall, and to run on clusters of computers that share a single smart host (running regular qmail) for mail queueing and delivery. It's also occasionally useful for mailing list load sharing with ezmlm running on one host, passing messages for delivery to a smarthost. See Chapter 17 for details of setting up mini-qmail.

QMQP does not require or encourage single recipient deliveries; if a message has many recipients, the message and all of the recipient addresses can be transferred quickly via QMQP. This means that for mailing list load sharing, there's no need to split or cache the subscriber database on the smarthost. For each message distributed to a list, ezmlm can send the message and all of the recipient addresses quickly via QMQP, even if there are many recipients.

Quick Mail Transfer Protocol (QMTP) is intended as a replacement for SMTP. It's much simpler than SMTP, and just transfers a messages along with an envelope sender and a set of envelope recipients. To receive QMTP mail, set up qmail-qmtpd the same way you set up qmail-smtpd. To control mail relay, it uses the same rcpthosts and morercpthosts files and RELAYCLIENT tcpserver variable as qmail-smtpd.

The only QMTP client currently available is in the serialmail package, maildirqmtp, which is invoked exactly the same way as maildirsmtp. Although QMTP indisputably transfers mail faster than SMTP, almost nobody uses it. Partly this is because the QMTP client isn't integrated into qmail (and isn't available at all in other MTAs), but mostly this is because there's no standard way for a server to announce that it has a QMTP server available, analogous to a DNS MX record for SMTP. Dan proposed in 1997 to redefine the distance value in MX records to encode both the server distance and the service (smtp, qmtp, etc.), and Russ Nelson offers a patch to make qmail-remote use both qmtp and smtp, but QMTP remains an oddity not in general use.




qmail
qmail
ISBN: 1565926285
EAN: 2147483647
Year: 2006
Pages: 152

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net