The extension mechanism for SMTP is defined in Section 2.2 of the current SMTP specification [
RFC5321a]. [
LMTP] inherits SMTP's extension mechanism.
The name of the extension is LIMITS. Servers implementing this extension advertise a LIMITS as a keyword in the response to EHLO (LHLO for LMTP). The associated parameter is used by the server to communicate one or more limits, each with an optional value, to the client. The syntax of the parameter is:
limits-param = limit-name-value 0*[SP limit-name-value]
limit-name-value = limit-name ["=" limit-value]
limit-name = 1*(ALPHA / DIGIT / "-" / "_")
limit-value = 1*(%x21-3A / %x3C-7E) ; Any VCHAR except ";"
This extension introduces no new SMTP commands and does not alter any existing command. However, it is possible for a LIMITS parameter to be associated with another SMTP extension that does these things.
In order to achieve consistent behavior, all limits
MUST be registered with the IANA, as described below.
Limit names
MUST be comprehensible, but also should be kept as short as possible. The use of commonly understood abbreviations, e.g., "MAX" for "maximum", is encouraged.
When a limit is associated with a particular command, its name
SHOULD begin with the name of that command.
Limit names
SHOULD end with one or more terms that describe the type of limit.
The "Pipelining" extension [
PIPELINING] is commonly used to improve performance, especially over high latency connections. Pipelining allows an entire transaction to be sent without checking responses, and in some cases it may be possible to send multiple transactions.
The use of pipelining affects the LIMITS extension in an important way: Since a pipelining client cannot check intermediate command responses without stalling the pipeline, it cannot count the number of successful versus failed responses and adjust its behavior accordingly. Limit designers need to take this into account.
For example, it may seem like it would be better to impose a limit on the number of successful RCPT TO commands as opposed to the way the RCPTMAX limit is specified in
Section 4.2 below. But counting the total number of RCPT TOs is simple, whereas counting the number of successful RCPT TO stalls the pipeline.
This extension provides an announcement as part of the reply to an EHLO command.
Some servers vary their limits, as a session progresses, based on their obtaining more information. This extension does not attempt to handle in-session limit changes.
SMTP specifies minimum values for various server sizes, limits, and timeouts [
RFC5321b], e.g., servers must accept a minimum of 100 RCPT TO commands [
RFC5321c]). Unfortunately, the reality is that servers routinely impose smaller limits than what SMTP requires, and when this is done it is especially important for clients to be aware that this is happening.
For this reason there is no requirement that the limits advertised by this extension comply with the minimums imposed by SMTP.
These protocols require that the EHLO command (LHLO in LMTP) be reissued under certain circumstances, e.g., after successful authentication [
AUTH] or negotiation of a security layer [
STARTTLS].
Servers
MAY return updated limits any time the protocol requires clients to reissue the EHLO command.
Clients
MUST discard any previous limits in favor of those provided by the most recent EHLO. This includes the case where the original EHLO provided a set of limits but the subsequent EHLO did not; in this case, the client
MUST act as if no limits were communicated.
Syntax errors in the basic parameter syntax are best handled by ignoring the value in its entirety; in this case, clients
SHOULD proceed as if the LIMITS extension had not been used.
Syntax or other errors in the value syntax of a specific limit, including unrecognized value keywords, are best handled by ignoring that limit; in this case, the client
MUST proceed as if that limit had not been specified.
It is possible that a future specification may create multiple limits that are interrelated in some way; in this case, that specification
MUST specify how an error in the value syntax of one limit affects the other limits.
Clients
MAY cache limits determined during one session and use them to optimize their behavior for subsequent sessions. However, since servers are free to adjust their limits at any time, clients
MUST be able to accommodate any limit changes that occur between sessions.