Internet Engineering Task Force | S.R.A. Atkins |
Internet-Draft | Word to the Wise |
Intended status: Experimental Protocol | October 24, 2011 |
Expires: April 26, 2012 |
Next-Hop SMTP Traffic Control
draft-atkins-smtp-traffic-control-00
This document defines an extended SMTP response for mail servers to assist clients in adjusting the rate at which they send mail. Use of this mechanism can reduce wasteful SMTP connections and reduce mail delivery delays; at scale the aggregate benefit to clients and servers can be significant.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on April 26, 2012.
Copyright (c) 2011 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
Ideally a mail server would deliver all mails to recipients' mailboxes immediately, but that is not always possible due to limited system resources.
For active sites, mail volume can be very high. Clients sometimes attempt to deliver large quantities of mail in a very short time period, often mail which has low perceived value to the recipient. Those spikes in mail volume can exceed server capacity for short periods and delay processing of other mail with a higher perceived value. Such servers therefore attempt to throttle traffic from clients with a lower perceived value.
Servers will also throttle or defer mail from senders for other reasons, including reputation or behaviour based spam filters that prefer to wait for more data before they make a delivery decision.
There are two approaches currently used to throttle mail traffic. One is to limit the bandwidth of the transport the SMTP session is running over. By delaying the delivery of each message while keeping the SMTP session open it causes each connection to be held open for longer, significantly increasing resource usage at both ends of the connection.
The other approach is to defer accepting a message with an RFC 5321 [RFC5321] transient negative completion reply, typically "421", relying on the client to resend the message later. This can cause many repeated, failed delivery attempts when the client retries delivery of the same message rapidly, or attempted delivery of many (thousands) of messages, all of which are deferred. That pattern of high volumes of deferred connections can have an aggregate effect that is expensive and wasteful for both the client and server.
Many clients will retry delivery only after a fairly long period (RFC 5321 [RFC5321] suggests 30 minutes) which can cause mail delivery to be significantly delayed. Long delivery delays are an obvious problem for time-sensitive messages, bit they can also cause problems indirectly by causing messages to be delivered out of chronological order.
If the server is only temporarily overloaded, and so needs to reduce traffic for just a short period (seconds to minutes), then a shorter retry delay reduces those problems.
This specification defines a new extended response that SMTP server can include in the text section of any SMTP response - separated by white space from the rest of the text section. It's intended use is to refine the second mechanism described above, to guide future transfer attempts by the client.
response = "wait:" delay delay = 1*5DIGIT ; an integer in the range 0 to 99999 DIGIT = 0x30-0x39
The delay value is the length of time, in seconds, that the server is asking the client to wait before sending further mail. A value of "0" is valid, with the meaning that the client SHOULD gracefully terminate the current connection, but need not wait before attempting future connections. Disconnecting in this way, rather than keeping the connection open for further messages, moves the client to the back of the connection queue and gives competing clients an opportunity to connect.
If a client sees this additional response in any SMTP response from a server then it SHOULD gracefully close the SMTP connection by sending a QUIT command as soon as possible. It SHOULD NOT make any new connection to the same server for the duration of the delay. If possible it SHOULD gracefully close any other connections to the same server. If the implementation of the client makes it difficult to implement some of these behaviours, it can still usefully implement the other requirements.
Other than this, it makes no changes in the semantics of the SMTP transaction.
A server can add a wait: additional response to any permanent or transient negative completion reply ("5xx or 4xx error") to ask the client to disconnect and wait before reconnecting.
A server can also usefully add a wait: additional response to a 250 positive completion response at the end of the DATA section to ask the server to disconnect and wait before reconnecting. At that point in the transaction a "250 wait:" asks the client to disconnect rather than attempting to send further messages in the same transaction.
"421 4.3.2 wait:15 example.com Service not available" means the client should retry delivery of the mail, after at least 15 seconds and not attempt any other deliveries for at least 15 seconds.
"554 wait:60 Transaction failed" means the client should not retry delivery of this message, and should not attempt any other deliveries for at least 60 seconds.
"250 OK wait:90" in response to end of data means that the mail has been accepted for delivery and that the client should send a QUIT command, and not attempt delivery of any other messages for 90 seconds.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
This memo includes no request to IANA.
This document describes an additional response code. Use of this response code may disclose additional information about how a mail system is implemented beyond that currently available.
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. |
[RFC5321] | Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, October 2008. |