rfc-1870

SMTP Service Extension for Message Size Declaration

J. Klensin, N. Freed, K. Moore
date1995-11 streamIETF areaapp wgsmtpext statusINTERNET STANDARD pages9 canonicalhttps://www.rfc-editor.org/rfc/rfc1870 doi10.17487/RFC1870
This memo defines an extension to the SMTP service whereby an SMTP client and server may interact to give the server an opportunity to decline to accept a message (perhaps temporarily) based on the client's estimate of the message size. [STANDARDS-TRACK]

obsoletes

also

Extracted elements (19)

design-rationale §6

Clients are advised to use heuristics that overestimate rather than underestimate message size, which makes the question of whether SMTP DATA dots are counted largely academic and reduces the chance of a mid-transfer rejection.

email

design-rationale §2

The extension is motivated by MIME's expansion of message sizes; the goal is to allow early rejection before any data transfer, saving resources on both client and server.

email

interoperability-note §6

Only one SIZE parameter may be specified in a single MAIL FROM command.

email

interoperability-note §4

The extension is negotiated via EHLO (RFC 1869 ESMTP framework). Servers that do not support SIZE will not advertise it, and clients must fall back to standard SMTP behavior without size pre-declaration.

email

normative-requirement §6.2 MUST

A 250 reply to the extended MAIL command is not an absolute guarantee of successful transfer; clients must still handle 452 and 552 error codes after DATA or after message transfer.

email

normative-requirement §7 MUST

A minimal server must accept the extended MAIL command and return 552 if the declared size exceeds its fixed maximum, but need not detect temporary resource limitations.

email

normative-requirement §6.4 MAY

A server may return 452 or 552 in response to a RCPT command based on per-recipient unwillingness to accept a message of the declared size. A 452 allows requeue; a 552 does not.

email

normative-requirement §7 MUST NOT

A server returning SIZE with no parameter in EHLO may not issue a 250 response to an extended MAIL command with a SIZE value without first verifying sufficient resources are available and, if possible, reserving storage space.

email

normative-requirement §6.1 MUST

If the declared message size exceeds the server's fixed maximum, the server responds with code 552 ('message size exceeds fixed maximum message size').

email

normative-requirement §6.1 SHOULD

If the server currently lacks sufficient resources to accept a message of the indicated size but may be able to do so later, it responds with code 452 ('insufficient system storage').

email

normative-requirement §6.3 SHOULD

Once a server has accepted a declared message size, it should not return a 552 after the DATA transfer phase unless the actual transferred message size exceeds the declared size.

email

normative-requirement §6 MUST NOT

Servers MUST NOT use the SIZE parameter to determine end of content in the DATA command; it is only an estimate for pre-transfer resource checking.

email

normative-requirement §6.2 SHOULD

Upon receiving a 452 response, the client should send RSET or QUIT and retry delivery to the same server at a later time.

email

normative-requirement §6.2 SHOULD

Upon receiving a 552 response, the client should send RSET or QUIT, declare the message undeliverable, and return appropriate notification to the sender.

email

protocol-element §5

Message size is defined as the number of octets including CR-LF pairs transmitted after the server's 354 reply to DATA, but excluding the terminating dot and doubled quoting dots.

email

protocol-element §3

The SMTP SIZE extension is identified by the EHLO keyword 'SIZE'. An optional decimal parameter indicates the server's fixed maximum message size in bytes; a value of 0 means no fixed maximum; omission means no information is conveyed.

email

security-consideration §9

The SIZE extension can facilitate crude service-denial attacks by making it quicker to determine effective attack parameters (server limits) and by streamlining the setup of large-message flood attempts. However, the extension does not introduce vulnerabilities beyond those already present in SMTP.

email, security

wire-format §3

The EHLO SIZE keyword parameter syntax is `size-param ::= [1*DIGIT]`, an optional decimal number representing the server's fixed maximum message size in bytes.

email

wire-format §3

The SIZE parameter on MAIL FROM carries a decimal integer (1–20 digits) representing the declared message size in octets. Syntax: `size-value ::= 1*20DIGIT`. The MAIL FROM line length limit is increased by 26 characters to accommodate this parameter.

email