SMTP Service Extension for Message Size Declaration
obsoleted by
- rfc-1653 — SMTP Service Extension for Message Size Declaration
Extracted elements (19)
The declared message size may be a heuristic estimate rather than an exact count because exact computation may be infeasible. Such heuristics should be chosen so that the declared size is usually larger than the actual size, making whether SMTP DATA dots are counted largely academic.
The MIME extensions to Internet mail enable transmission of many new data types, causing SMTP to carry a much wider range of message sizes than previously. This creates resource pressure (e.g., disk space) on SMTP servers, motivating the need for a pre-transfer size negotiation mechanism.
A minimal client may use the extension solely to compare its estimated message size against the server's advertised fixed maximum (from the EHLO SIZE parameter), without issuing the extended MAIL command, thereby avoiding temporary-limit and per-recipient-limit detection.
A server is permitted but not required to accept a message actually larger than the size declared in the extended MAIL command, such as when a client's size-estimation heuristic underestimates. A client declaring a smaller-than-actual size receives no assurance of acceptance.
A minimal server advertising the SIZE extension must accept the extended MAIL command and return a 552 reply code if the client's declared size exceeds the server's fixed size limit.
A server that advertises SIZE with no numeric parameter may not issue a 250 response to an extended MAIL command with a SIZE specification without first checking whether sufficient resources are available to transfer and retain the message; if possible, it should actually reserve the storage space.
A successful 250 reply to the extended MAIL command does not guarantee successful transfer. SMTP clients using the extended MAIL command must still be prepared to handle temporary and permanent error replies (including 452 and 552) after issuing DATA or after message transfer.
If the indicated size exceeds the server's fixed maximum message size, the server should respond with code 552 ('message size exceeds fixed maximum message size'); a server is also permitted to accept a message actually larger than declared.
If the server currently lacks sufficient resources to accept a message of the indicated size but may be able to do so later, it should respond to the extended MAIL command with code 452 ('insufficient system storage').
Once a server has agreed to accept a message of a declared size, it should not return a 552 reply after the DATA transfer phase unless the actual size transferred is greater than the declared message size.
Servers MUST NOT use the SIZE parameter to determine end of content in the DATA command; size declaration is advisory only and does not alter DATA stream framing.
Upon receiving a 452 response, the client should send RSET or QUIT and retry the message to the same server at a later time. Upon receiving 552, the client should send RSET or QUIT, declare the message undeliverable, and notify the sender.
A server may return 452 or 552 in response to a RCPT command based on unwillingness to accept the declared message size for a particular recipient. A 452 permits the client to requeue for later delivery; a 552 prohibits requeuing to the same recipient.
Message size is defined as the number of octets, including CR-LF pairs, but not the SMTP DATA command's terminating dot or doubled quoting dots, to be transmitted after receiving reply code 354 to the DATA command.
The declared message size is the client's estimate of the message size for a particular message, supplied in the SIZE parameter of the extended MAIL FROM command.
The EHLO keyword for this extension is 'SIZE'. An optional decimal parameter indicates the server's fixed maximum message size in bytes; a value of 0 means no fixed maximum is in force; omission conveys no information about the server's limit.
The extended MAIL FROM command accepts an optional 'SIZE' parameter whose value is a decimal number representing the client's estimate of the message size in octets, including headers, body, and CR-LF pairs between lines, but excluding the DATA command's terminating dot or doubled quoting dots.
The fixed maximum message size is the size of the largest message a server will ever accept; any attempt to transfer a larger message will always fail. It may be an implementation artifact or administrator-configured limit.
The SIZE extension can facilitate crude service denial attacks: the SIZE parameter and extended MAIL command make it somewhat quicker and easier to craft an effective denial-of-service attempt. However, unless implementations are very weak, no new vulnerability is introduced that did not already exist in SMTP.