rfc-9422

The LIMITS SMTP Service Extension

N. Freed, J. Klensin
date2024-02 streamIETF wgnon working group statusPROPOSED STANDARD pages11 canonicalhttps://www.rfc-editor.org/rfc/rfc9422 doi10.17487/RFC9422
This document defines a LIMITS extension for the Simple Mail Transfer Protocol (SMTP), including submission, as well as the Local Mail Transfer Protocol (LMTP). It also defines an associated limit registry. The extension provides the means for an SMTP, submission, or LMTP server to inform the client of limits the server intends to apply to the protocol during the current session. The client is then able to adapt its behavior in order to conform to those limits.

Extracted elements (22)

design-rationale §3.3

RCPTMAX is defined as a limit on total RCPT TO commands rather than successful ones because counting total commands is simple, whereas counting only successful ones requires stalling the pipeline to check intermediate responses.

email

design-rationale §1

The LIMITS extension announces server limits in the EHLO response rather than waiting for a command to fail, avoiding the overhead and delays caused by servers issuing error responses after clients have already exceeded a limit.

email

design-rationale §3.4

The LIMITS extension does not attempt to handle in-session limit changes. Limits are announced once at EHLO and servers may vary limits only between sessions, not as a session progresses.

email

interoperability-note §3.5

There is no requirement that limits advertised by the LIMITS extension comply with SMTP-mandated minimums (e.g., RFC 5321's minimum of 100 RCPT TO commands), because servers routinely impose smaller limits and it is especially important for clients to be aware of this.

email

interoperability-note §3.3

When pipelining is in use, a client cannot check intermediate command responses without stalling the pipeline, so it cannot count successful versus failed responses to adjust behavior. Limit designers must account for this; for example, RCPTMAX counts total RCPT TO commands rather than only successful ones.

email

normative-requirement §3.7 MUST

A future specification that defines interrelated limits MUST specify how a syntax error in one limit's value affects the other related limits.

email

normative-requirement §3.1 MUST

All limits MUST be registered with the IANA in order to achieve consistent behavior.

email, registry

normative-requirement §3.8 MAY

Clients MAY cache limit settings from a prior session for use in subsequent sessions to the same server. However, clients MUST be able to accommodate any limit changes that occur between sessions, since servers may adjust limits at any time.

email

normative-requirement §3.2 MUST

Limit names MUST be comprehensible. When a limit is associated with a particular command, its name SHOULD begin with the name of that command, and SHOULD end with one or more terms describing the type of limit.

email

normative-requirement §3.6 MUST

Servers MAY return updated limits any time the protocol requires clients to reissue the EHLO command (e.g., after AUTH or STARTTLS). Clients MUST discard any previous limits in favor of those from the most recent EHLO, including the case where the new EHLO provides no limits at all.

email

normative-requirement §3.7 SHOULD

Syntax errors in the overall LIMITS parameter value should cause the client to ignore the value entirely and SHOULD proceed as if the LIMITS extension had not been used. Syntax or other errors in an individual limit's value MUST cause the client to proceed as if that specific limit had not been specified.

email

protocol-element §4.1

MAILMAX specifies the maximum number of MAIL FROM transactions the server will accept in a single session. The count includes all MAIL FROM commands regardless of success or failure. Value syntax is a non-zero integer up to six digits.

email

protocol-element §4.3

RCPTDOMAINMAX specifies the maximum number of different domains that can appear in recipient addresses within a single session. This accommodates servers that bind to a specific internal delivery mechanism on receipt of the first RCPT TO. Value syntax is a non-zero integer up to six digits.

email

protocol-element §4.2

RCPTMAX specifies the maximum number of RCPT TO commands the server will accept in a single transaction (not the actual number of recipients delivered to). Value syntax is a non-zero integer up to six digits.

email

protocol-element §3

The LIMITS SMTP extension is announced in the EHLO (or LHLO for LMTP) response as a keyword with an associated parameter. The parameter communicates one or more named limits, each with an optional value, to the client at session start.

email

registry §7.2

A new "SMTP Server Limits" registry has been created under the MAIL Parameters group with policy "Specification Required". Each entry must include: limit name, value syntax, semantic description, usage restrictions, and security considerations. Initial registrations are MAILMAX, RCPTMAX, and RCPTDOMAINMAX.

email, registry

registry §7.1

The IANA SMTP Service Extensions registry has been updated to add the "LIMITS" keyword with description "Server limits" referencing RFC 9422, with a note pointing to the new SMTP Server Limits registry.

email, registry

security-consideration §6

A malicious client can use server-advertised limits to optimize delivery of unwanted messages (spam), precisely tuning message volume to avoid triggering rejections.

email, security

security-consideration §6

A malicious server can advertise overly restrictive limits to constrain client behavior and cause excessive consumption of client resources.

email, security

security-consideration §6

A man-in-the-middle attack on an unprotected SMTP connection can manipulate the LIMITS advertisement, causing clients to misbehave in ways that result in delivery delays, failures, or reputational damage.

email, security

security-consideration §6

When a server provides client-specific limit values rather than general server-wide limits, it unavoidably leaks reputation information to the sender. Malicious senders can exploit this to build reputation before switching to abusive behavior.

email, security, privacy

wire-format §3

The LIMITS EHLO parameter syntax 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). Limit values are ASCII VCHARs excluding semicolons.

email