rfc2821.txt   draft-klensin-rfc2821bis-10.txt 
Network Working Group J. Klensin, Editor Network Working Group J. Klensin
Request for Comments: 2821 AT&T Laboratories
Updates: 1123 Obsoletes: 2821 (if approved)
Category: Standards Track Intended status: Standards Track
Expires: October 17, 2008
Simple Mail Transfer Protocol Simple Mail Transfer Protocol
draft-klensin-rfc2821bis-10.txt
Status of this Memo Status of this Memo
This document specifies an Internet standards track protocol for the By submitting this Internet-Draft, each author represents that any
Internet community, and requests discussion and suggestions for applicable patent or other IPR claims of which he or she is aware
improvements. Please refer to the current edition of the "Internet have been or will be disclosed, and any of which he or she becomes
Official Protocol Standards" (STD 1) for the standardization state aware will be disclosed, in accordance with Section 6 of BCP 79.
and status of this protocol. Distribution of this memo is unlimited.
Copyright Notice Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF), its areas, and its working groups. Note that
other groups may also distribute working documents as Internet-
Drafts.
Copyright (C) The Internet Society (2001). All Rights Reserved. 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."
Abstract The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt.
This document is a self-contained specification of the basic protocol The list of Internet-Draft Shadow Directories can be accessed at
for the Internet electronic mail transport. It consolidates, updates http://www.ietf.org/shadow.html.
and clarifies, but doesn't add new or change existing functionality
of the following:
- the original SMTP (Simple Mail Transfer Protocol) specification of This Internet-Draft will expire on October 17, 2008.
RFC 821 [30],
- domain name system requirements and implications for mail Abstract
transport from RFC 1035 [22] and RFC 974 [27],
- the clarifications and applicability statements in RFC 1123 [2], This document is a specification of the basic protocol for Internet
and electronic mail transport. It consolidates, updates, and clarifies
several previous documents, making all or parts of most of them
obsolete. It covers the SMTP extension mechanisms and best practices
for the contemporary Internet, but does not provide details about
particular extensions. Although SMTP was designed as a mail
transport and delivery protocol, this specification also contains
information that is important to its use as a "mail submission"
protocol for "split-UA" mail reading systems and mobile environments.
- material drawn from the SMTP Extension mechanisms [19]. Table of Contents
It obsoletes RFC 821, RFC 974, and updates RFC 1123 (replaces the 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 6
mail transport materials of RFC 1123). However, RFC 821 specifies 1.1. Context and Notes for this Draft . . . . . . . . . . . . . 6
some features that were not in significant use in the Internet by the 1.2. Mailing List . . . . . . . . . . . . . . . . . . . . . . . 6
mid-1990s and (in appendices) some additional transport models. 1.3. Transport of electronic mail . . . . . . . . . . . . . . . 6
Those sections are omitted here in the interest of clarity and 1.4. History and context for this document . . . . . . . . . . 6
brevity; readers needing them should refer to RFC 821. 2. The SMTP Model . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1. Basic Structure . . . . . . . . . . . . . . . . . . . . . 8
2.2. The Extension Model . . . . . . . . . . . . . . . . . . . 10
2.2.1. Background . . . . . . . . . . . . . . . . . . . . . . 10
2.2.2. Definition and Registration of Extensions . . . . . . 11
2.2.3. Special Issues with Extensions . . . . . . . . . . . . 12
2.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 12
2.3.1. Mail Objects . . . . . . . . . . . . . . . . . . . . . 12
2.3.2. Senders and Receivers . . . . . . . . . . . . . . . . 13
2.3.3. Mail Agents and Message Stores . . . . . . . . . . . . 13
2.3.4. Host . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.3.5. Domain Names . . . . . . . . . . . . . . . . . . . . . 14
2.3.6. Buffer and State Table . . . . . . . . . . . . . . . . 15
2.3.7. Commands and Replies . . . . . . . . . . . . . . . . . 15
2.3.8. Lines . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3.9. Message Content and Mail Data . . . . . . . . . . . . 16
2.3.10. Originator, Delivery, Relay, and Gateway Systems . . . 16
2.3.11. Mailbox and Address . . . . . . . . . . . . . . . . . 16
2.4. General Syntax Principles and Transaction Model . . . . . 17
3. The SMTP Procedures: An Overview . . . . . . . . . . . . . . . 18
3.1. Session Initiation . . . . . . . . . . . . . . . . . . . . 19
3.2. Client Initiation . . . . . . . . . . . . . . . . . . . . 19
3.3. Mail Transactions . . . . . . . . . . . . . . . . . . . . 20
3.4. Forwarding for Address Correction or Updating . . . . . . 22
3.5. Commands for Debugging Addresses . . . . . . . . . . . . . 23
3.5.1. Overview . . . . . . . . . . . . . . . . . . . . . . . 23
3.5.2. VRFY Normal Response . . . . . . . . . . . . . . . . . 25
3.5.3. Meaning of VRFY or EXPN Success Response . . . . . . . 26
3.5.4. Semantics and Applications of EXPN . . . . . . . . . . 27
3.6. Relaying and Mail Routing . . . . . . . . . . . . . . . . 27
3.6.1. Source Routes and Relaying . . . . . . . . . . . . . . 27
3.6.2. Mail eXchange Records and Relaying . . . . . . . . . . 27
3.6.3. Message Submission Servers as Relays . . . . . . . . . 28
3.7. Mail Gatewaying . . . . . . . . . . . . . . . . . . . . . 29
3.7.1. Header Fields in Gatewaying . . . . . . . . . . . . . 29
3.7.2. Received Lines in Gatewaying . . . . . . . . . . . . . 30
3.7.3. Addresses in Gatewaying . . . . . . . . . . . . . . . 30
3.7.4. Other Header Fields in Gatewaying . . . . . . . . . . 30
3.7.5. Envelopes in Gatewaying . . . . . . . . . . . . . . . 30
3.8. Terminating Sessions and Connections . . . . . . . . . . . 31
3.9. Mailing Lists and Aliases . . . . . . . . . . . . . . . . 31
3.9.1. Alias . . . . . . . . . . . . . . . . . . . . . . . . 32
3.9.2. List . . . . . . . . . . . . . . . . . . . . . . . . . 32
4. The SMTP Specifications . . . . . . . . . . . . . . . . . . . 33
4.1. SMTP Commands . . . . . . . . . . . . . . . . . . . . . . 33
4.1.1. Command Semantics and Syntax . . . . . . . . . . . . . 33
4.1.2. Command Argument Syntax . . . . . . . . . . . . . . . 41
4.1.3. Address Literals . . . . . . . . . . . . . . . . . . . 43
4.1.4. Order of Commands . . . . . . . . . . . . . . . . . . 44
4.1.5. Private-use Commands . . . . . . . . . . . . . . . . . 46
4.2. SMTP Replies . . . . . . . . . . . . . . . . . . . . . . . 46
4.2.1. Reply Code Severities and Theory . . . . . . . . . . . 48
4.2.2. Reply Codes by Function Groups . . . . . . . . . . . . 50
4.2.3. Reply Codes in Numeric Order . . . . . . . . . . . . . 52
4.2.4. Reply Code 502 . . . . . . . . . . . . . . . . . . . . 53
4.2.5. Reply Codes After DATA and the Subsequent
<CRLF>.<CRLF> . . . . . . . . . . . . . . . . . . . . 53
4.3. Sequencing of Commands and Replies . . . . . . . . . . . . 54
4.3.1. Sequencing Overview . . . . . . . . . . . . . . . . . 54
4.3.2. Command-Reply Sequences . . . . . . . . . . . . . . . 55
4.4. Trace Information . . . . . . . . . . . . . . . . . . . . 57
4.5. Additional Implementation Issues . . . . . . . . . . . . . 61
4.5.1. Minimum Implementation . . . . . . . . . . . . . . . . 61
4.5.2. Transparency . . . . . . . . . . . . . . . . . . . . . 62
4.5.3. Sizes and Timeouts . . . . . . . . . . . . . . . . . . 62
4.5.3.1. Size limits and minimums . . . . . . . . . . . . . 62
4.5.3.1.1. local-part . . . . . . . . . . . . . . . . . . 63
4.5.3.1.2. domain . . . . . . . . . . . . . . . . . . . . 63
4.5.3.1.3. path . . . . . . . . . . . . . . . . . . . . . 63
4.5.3.1.4. command line . . . . . . . . . . . . . . . . . 63
4.5.3.1.5. reply line . . . . . . . . . . . . . . . . . . 63
4.5.3.1.6. text line . . . . . . . . . . . . . . . . . . 63
4.5.3.1.7. message content . . . . . . . . . . . . . . . 63
4.5.3.1.8. recipients buffer . . . . . . . . . . . . . . 64
4.5.3.1.9. Treatment When Limits Exceeded . . . . . . . . 64
4.5.3.1.10. Too Many Recipients code . . . . . . . . . . . 64
4.5.3.2. Timeouts . . . . . . . . . . . . . . . . . . . . . 65
4.5.3.2.1. Initial 220 Message: 5 minutes . . . . . . . . 65
4.5.3.2.2. MAIL Command: 5 minutes . . . . . . . . . . . 66
4.5.3.2.3. RCPT Command: 5 minutes . . . . . . . . . . . 66
4.5.3.2.4. DATA Initiation: 2 minutes . . . . . . . . . . 66
4.5.3.2.5. Data Block: 3 minutes . . . . . . . . . . . . 66
4.5.3.2.6. DATA Termination: 10 minutes. . . . . . . . . 66
4.5.3.2.7. Server Timeout: 5 minutes. . . . . . . . . . . 66
4.5.4. Retry Strategies . . . . . . . . . . . . . . . . . . . 66
4.5.5. Messages with a null reverse-path . . . . . . . . . . 68
5. Address Resolution and Mail Handling . . . . . . . . . . . . . 69
5.1. Locating the Target Host . . . . . . . . . . . . . . . . . 69
5.2. IPv6 and MX Records . . . . . . . . . . . . . . . . . . . 71
6. Problem Detection and Handling . . . . . . . . . . . . . . . . 71
6.1. Reliable Delivery and Replies by Email . . . . . . . . . . 72
6.2. Unwanted, unsolicited, and "attack" messages . . . . . . . 73
6.3. Loop Detection . . . . . . . . . . . . . . . . . . . . . . 73
6.4. Compensating for Irregularities . . . . . . . . . . . . . 74
7. Security Considerations . . . . . . . . . . . . . . . . . . . 75
7.1. Mail Security and Spoofing . . . . . . . . . . . . . . . . 75
7.2. "Blind" Copies . . . . . . . . . . . . . . . . . . . . . . 76
7.3. VRFY, EXPN, and Security . . . . . . . . . . . . . . . . . 77
7.4. Mail Rerouting Based on the 251 and 551 Response Codes . . 77
7.5. Information Disclosure in Announcements . . . . . . . . . 78
7.6. Information Disclosure in Trace Fields . . . . . . . . . . 78
7.7. Information Disclosure in Message Forwarding . . . . . . . 78
7.8. Resistance to Attacks . . . . . . . . . . . . . . . . . . 78
7.9. Scope of Operation of SMTP Servers . . . . . . . . . . . . 79
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 79
9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 80
10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 81
10.1. Normative References . . . . . . . . . . . . . . . . . . . 81
10.2. Informative References . . . . . . . . . . . . . . . . . . 82
Appendix A. TCP Transport Service . . . . . . . . . . . . . . . . 84
Appendix B. Generating SMTP Commands from RFC 822 Header
Fields . . . . . . . . . . . . . . . . . . . . . . . 85
Appendix C. Source Routes . . . . . . . . . . . . . . . . . . . . 86
Appendix D. Scenarios . . . . . . . . . . . . . . . . . . . . . . 87
D.1. A Typical SMTP Transaction Scenario . . . . . . . . . . . 87
D.2. Aborted SMTP Transaction Scenario . . . . . . . . . . . . 88
D.3. Relayed Mail Scenario . . . . . . . . . . . . . . . . . . 88
D.4. Verifying and Sending Scenario . . . . . . . . . . . . . . 90
Appendix E. Other Gateway Issues . . . . . . . . . . . . . . . . 91
Appendix F. Deprecated Features of RFC 821 . . . . . . . . . . . 91
F.1. TURN . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
F.2. Source Routing . . . . . . . . . . . . . . . . . . . . . . 91
F.3. HELO . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
F.4. #-literals . . . . . . . . . . . . . . . . . . . . . . . . 92
F.5. Dates and Years . . . . . . . . . . . . . . . . . . . . . 92
F.6. Sending versus Mailing . . . . . . . . . . . . . . . . . . 92
Appendix G. Change log . . . . . . . . . . . . . . . . . . . . . 92
G.1. Changes from RFC 2821 to the initial (-00) version of
this draft . . . . . . . . . . . . . . . . . . . . . . . . 93
G.2. Changes from version -00 to -01 . . . . . . . . . . . . . 93
G.3. Changes from version -01 to -02 . . . . . . . . . . . . . 94
G.4. Changes from version -02 to -03 . . . . . . . . . . . . . 95
G.5. Changes from version -02 to -03 . . . . . . . . . . . . . 95
G.6. Changes from version -03 to -04 . . . . . . . . . . . . . 95
G.7. Changes from version -04 to -05 . . . . . . . . . . . . . 96
G.8. Changes from version -05 to -06 . . . . . . . . . . . . . 96
G.9. Changes from version -06 to -07 . . . . . . . . . . . . . 96
G.10. Changes from version -07 to -08 . . . . . . . . . . . . . 97
G.11. Changes from version -08 to -09 . . . . . . . . . . . . . 97
G.12. Changes from version -09 to -10 . . . . . . . . . . . . . 97
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 97
Intellectual Property and Copyright Statements . . . . . . . . . . 98
It also includes some additional material from RFC 1123 that required 1. Introduction
amplification. This material has been identified in multiple ways,
mostly by tracking flaming on various lists and newsgroups and
problems of unusual readings or interpretations that have appeared as
the SMTP extensions have been deployed. Where this specification
moves beyond consolidation and actually differs from earlier
documents, it supersedes them technically as well as textually.
Although SMTP was designed as a mail transport and delivery protocol, [[RFC Editor: Please remove the next two subsections, i.e.,
this specification also contains information that is important to its Section 1.1 and Section 1.2]]
use as a 'mail submission' protocol, as recommended for POP [3, 26]
and IMAP [6]. Additional submission issues are discussed in RFC 2476
[15].
Section 2.3 provides definitions of terms specific to this document. 1.1. Context and Notes for this Draft
Except when the historical terminology is necessary for clarity, this
document uses the current 'client' and 'server' terminology to
identify the sending and receiving SMTP processes, respectively.
A companion document [32] discusses message headers, message bodies This version of the I-D is generated after the second IETF Last Call
and formats and structures for them, and their relationship. (on the changes in draft-klensin-rfc2821bis-08) and additional small
changes to provide the IESG and RFC Editor a clean copy for final
approval, editing and publication.
Table of Contents 1.2. Mailing List
1. Introduction .................................................. 4 This document is being discussed on the historical SMTP mailing list,
2. The SMTP Model ................................................ 5 ietf-smtp, maintained at imc.org.
2.1 Basic Structure .............................................. 5
2.2 The Extension Model .......................................... 7
2.2.1 Background ................................................. 7
2.2.2 Definition and Registration of Extensions .................. 8
2.3 Terminology .................................................. 9
2.3.1 Mail Objects ............................................... 10
2.3.2 Senders and Receivers ...................................... 10
2.3.3 Mail Agents and Message Stores ............................. 10
2.3.4 Host ....................................................... 11
2.3.5 Domain ..................................................... 11
2.3.6 Buffer and State Table ..................................... 11
2.3.7 Lines ...................................................... 12
2.3.8 Originator, Delivery, Relay, and Gateway Systems ........... 12
2.3.9 Message Content and Mail Data .............................. 13
2.3.10 Mailbox and Address ....................................... 13
2.3.11 Reply ..................................................... 13
2.4 General Syntax Principles and Transaction Model .............. 13
3. The SMTP Procedures: An Overview .............................. 15
3.1 Session Initiation ........................................... 15
3.2 Client Initiation ............................................ 16
3.3 Mail Transactions ............................................ 16
3.4 Forwarding for Address Correction or Updating ................ 19
3.5 Commands for Debugging Addresses ............................. 20
3.5.1 Overview ................................................... 20
3.5.2 VRFY Normal Response ....................................... 22
3.5.3 Meaning of VRFY or EXPN Success Response ................... 22
3.5.4 Semantics and Applications of EXPN ......................... 23
3.6 Domains ...................................................... 23
3.7 Relaying ..................................................... 24
3.8 Mail Gatewaying .............................................. 25
3.8.1 Header Fields in Gatewaying ................................ 26
3.8.2 Received Lines in Gatewaying ............................... 26
3.8.3 Addresses in Gatewaying .................................... 26
3.8.4 Other Header Fields in Gatewaying .......................... 27
3.8.5 Envelopes in Gatewaying .................................... 27
3.9 Terminating Sessions and Connections ......................... 27
3.10 Mailing Lists and Aliases ................................... 28
3.10.1 Alias ..................................................... 28
3.10.2 List ...................................................... 28
4. The SMTP Specifications ....................................... 29
4.1 SMTP Commands ................................................ 29
4.1.1 Command Semantics and Syntax ............................... 29
4.1.1.1 Extended HELLO (EHLO) or HELLO (HELO) ................... 29
4.1.1.2 MAIL (MAIL) .............................................. 31
4.1.1.3 RECIPIENT (RCPT) ......................................... 31
4.1.1.4 DATA (DATA) .............................................. 33
4.1.1.5 RESET (RSET) ............................................. 34
4.1.1.6 VERIFY (VRFY) ............................................ 35
4.1.1.7 EXPAND (EXPN) ............................................ 35
4.1.1.8 HELP (HELP) .............................................. 35
4.1.1.9 NOOP (NOOP) .............................................. 35
4.1.1.10 QUIT (QUIT) ............................................. 36
4.1.2 Command Argument Syntax .................................... 36
4.1.3 Address Literals ........................................... 38
4.1.4 Order of Commands .......................................... 39
4.1.5 Private-use Commands ....................................... 40
4.2 SMTP Replies ................................................ 40
4.2.1 Reply Code Severities and Theory ........................... 42
4.2.2 Reply Codes by Function Groups ............................. 44
4.2.3 Reply Codes in Numeric Order .............................. 45
4.2.4 Reply Code 502 ............................................. 46
4.2.5 Reply Codes After DATA and the Subsequent <CRLF>.<CRLF> .... 46
4.3 Sequencing of Commands and Replies ........................... 47
4.3.1 Sequencing Overview ........................................ 47
4.3.2 Command-Reply Sequences .................................... 48
4.4 Trace Information ............................................ 49
4.5 Additional Implementation Issues ............................. 53
4.5.1 Minimum Implementation ..................................... 53
4.5.2 Transparency ............................................... 53
4.5.3 Sizes and Timeouts ......................................... 54
4.5.3.1 Size limits and minimums ................................. 54
4.5.3.2 Timeouts ................................................. 56
4.5.4 Retry Strategies ........................................... 57
4.5.4.1 Sending Strategy ......................................... 58
4.5.4.2 Receiving Strategy ....................................... 59
4.5.5 Messages with a null reverse-path .......................... 59
5. Address Resolution and Mail Handling .......................... 60
6. Problem Detection and Handling ................................ 62
6.1 Reliable Delivery and Replies by Email ....................... 62
6.2 Loop Detection ............................................... 63
6.3 Compensating for Irregularities .............................. 63
7. Security Considerations ....................................... 64
7.1 Mail Security and Spoofing ................................... 64
7.2 "Blind" Copies ............................................... 65
7.3 VRFY, EXPN, and Security ..................................... 65
7.4 Information Disclosure in Announcements ...................... 66
7.5 Information Disclosure in Trace Fields ....................... 66
7.6 Information Disclosure in Message Forwarding ................. 67
7.7 Scope of Operation of SMTP Servers ........................... 67
8. IANA Considerations ........................................... 67
9. References .................................................... 68
10. Editor's Address ............................................. 70
11. Acknowledgments .............................................. 70
Appendices ....................................................... 71
A. TCP Transport Service ......................................... 71
B. Generating SMTP Commands from RFC 822 Headers ................. 71
C. Source Routes ................................................. 72
D. Scenarios ..................................................... 73
E. Other Gateway Issues .......................................... 76
F. Deprecated Features of RFC 821 ................................ 76
Full Copyright Statement ......................................... 79
1. Introduction 1.3. Transport of electronic mail
The objective of the Simple Mail Transfer Protocol (SMTP) is to The objective of the Simple Mail Transfer Protocol (SMTP) is to
transfer mail reliably and efficiently. transfer mail reliably and efficiently.
SMTP is independent of the particular transmission subsystem and SMTP is independent of the particular transmission subsystem and
requires only a reliable ordered data stream channel. While this requires only a reliable ordered data stream channel. While this
document specifically discusses transport over TCP, other transports document specifically discusses transport over TCP, other transports
are possible. Appendices to RFC 821 describe some of them. are possible. Appendices to RFC 821 describe some of them.
An important feature of SMTP is its capability to transport mail An important feature of SMTP is its capability to transport mail
across networks, usually referred to as "SMTP mail relaying" (see across multiple networks, usually referred to as "SMTP mail relaying"
section 3.8). A network consists of the mutually-TCP-accessible (see Section 3.6). A network consists of the mutually-TCP-accessible
hosts on the public Internet, the mutually-TCP-accessible hosts on a hosts on the public Internet, the mutually-TCP-accessible hosts on a
firewall-isolated TCP/IP Intranet, or hosts in some other LAN or WAN firewall-isolated TCP/IP Intranet, or hosts in some other LAN or WAN
environment utilizing a non-TCP transport-level protocol. Using environment utilizing a non-TCP transport-level protocol. Using
SMTP, a process can transfer mail to another process on the same SMTP, a process can transfer mail to another process on the same
network or to some other network via a relay or gateway process network or to some other network via a relay or gateway process
accessible to both networks. accessible to both networks.
In this way, a mail message may pass through a number of intermediate In this way, a mail message may pass through a number of intermediate
relay or gateway hosts on its path from sender to ultimate recipient. relay or gateway hosts on its path from sender to ultimate recipient.
The Mail eXchanger mechanisms of the domain name system [22, 27] (and The Mail eXchanger mechanisms of the domain name system (RFC1035 [7],
section 5 of this document) are used to identify the appropriate RFC974 [19], and Section 5 of this document) are used to identify the
next-hop destination for a message being transported. appropriate next-hop destination for a message being transported.
1.4. History and context for this document
This document is a specification of the basic protocol for the
Internet electronic mail transport. It consolidates, updates and
clarifies, but doesn't add new or change existing functionality of
the following:
o the original SMTP (Simple Mail Transfer Protocol) specification of
RFC821 [8],
o domain name system requirements and implications for mail
transport from RFC1035 [7] and RFC974 [19],
o the clarifications and applicability statements in RFC1123 [3],
and
o material drawn from the SMTP Extension mechanisms in RFC1869 [25].
o Editorial and clarification changes to RFC 2821 [33] to bring that
specification to Draft Standard.
It obsoletes RFC 821, RFC 974, RFC 1869, and RFC 2821 and updates RFC
1123 (replacing the mail transport materials of RFC 1123). However,
RFC 821 specifies some features that were not in significant use in
the Internet by the mid-1990s and (in appendices) some additional
transport models. Those sections are omitted here in the interest of
clarity and brevity; readers needing them should refer to RFC 821.
It also includes some additional material from RFC 1123 that required
amplification. This material has been identified in multiple ways,
mostly by tracking flaming on various lists and newsgroups and
problems of unusual readings or interpretations that have appeared as
the SMTP extensions have been deployed. Where this specification
moves beyond consolidation and actually differs from earlier
documents, it supersedes them technically as well as textually.
Although SMTP was designed as a mail transport and delivery protocol,
this specification also contains information that is important to its
use as a "mail submission" protocol, as recommended for POP (RFC937
[17], RFC1939 [26]) and IMAP (RFC3501 [38]) . In general, the
separate mail submission protocol specified in RFC4409 [42] is now
preferred to direct use of SMTP; more discussion of that subject
appears in that document.
Section 2.3 provides definitions of terms specific to this document.
Except when the historical terminology is necessary for clarity, this
document uses the current 'client' and 'server' terminology to
identify the sending and receiving SMTP processes, respectively.
A companion document RFC2822 [11] discusses message header sections
and bodies and specifies formats and structures for them.
2. The SMTP Model 2. The SMTP Model
2.1 Basic Structure 2.1. Basic Structure
The SMTP design can be pictured as: The SMTP design can be pictured as:
+----------+ +----------+ +----------+ +----------+
+------+ | | | | +------+ | | | |
| User |<-->| | SMTP | | | User |<-->| | SMTP | |
+------+ | Client- |Commands/Replies| Server- | +------+ | Client- |Commands/Replies| Server- |
+------+ | SMTP |<-------------->| SMTP | +------+ +------+ | SMTP |<-------------->| SMTP | +------+
| File |<-->| | and Mail | |<-->| File | | File |<-->| | and Mail | |<-->| File |
|System| | | | | |System| |System| | | | | |System|
+------+ +----------+ +----------+ +------+ +------+ +----------+ +----------+ +------+
SMTP client SMTP server SMTP client SMTP server
When an SMTP client has a message to transmit, it establishes a two- When an SMTP client has a message to transmit, it establishes a two-
way transmission channel to an SMTP server. The responsibility of an way transmission channel to an SMTP server. The responsibility of an
SMTP client is to transfer mail messages to one or more SMTP servers, SMTP client is to transfer mail messages to one or more SMTP servers,
or report its failure to do so. or report its failure to do so.
The means by which a mail message is presented to an SMTP client, and The means by which a mail message is presented to an SMTP client, and
how that client determines the domain name(s) to which mail messages how that client determines the identifier(s) ("names") of the
are to be transferred is a local matter, and is not addressed by this domain(s) to which mail messages are to be transferred is a local
document. In some cases, the domain name(s) transferred to, or matter, and is not addressed by this document. In some cases, the
determined by, an SMTP client will identify the final destination(s) designated domain(s), or those determined by an SMTP client, will
of the mail message. In other cases, common with SMTP clients identify the final destination(s) of the mail message. In other
associated with implementations of the POP [3, 26] or IMAP [6] cases, common with SMTP clients associated with implementations of
protocols, or when the SMTP client is inside an isolated transport the POP (RFC937 [17], RFC1939 [26]) or IMAP (RFC3501 [38]) protocols,
service environment, the domain name determined will identify an or when the SMTP client is inside an isolated transport service
intermediate destination through which all mail messages are to be environment, the domain determined will identify an intermediate
relayed. SMTP clients that transfer all traffic, regardless of the destination through which all mail messages are to be relayed. SMTP
target domain names associated with the individual messages, or that clients that transfer all traffic regardless of the target domains
do not maintain queues for retrying message transmissions that associated with the individual messages, or that do not maintain
initially cannot be completed, may otherwise conform to this queues for retrying message transmissions that initially cannot be
specification but are not considered fully-capable. Fully-capable completed, may otherwise conform to this specification but are not
SMTP implementations, including the relays used by these less capable considered fully-capable. Fully-capable SMTP implementations,
ones, and their destinations, are expected to support all of the including the relays used by these less capable ones, and their
queuing, retrying, and alternate address functions discussed in this destinations, are expected to support all of the queuing, retrying,
specification. and alternate address functions discussed in this specification. In
many situations and configurations, the less-capable clients
discussed above SHOULD be using the message submission protocol (RFC
4409 [42]) rather than SMTP.
The means by which an SMTP client, once it has determined a target The means by which an SMTP client, once it has determined a target
domain name, determines the identity of an SMTP server to which a domain, determines the identity of an SMTP server to which a copy of
copy of a message is to be transferred, and then performs that a message is to be transferred, and then performs that transfer, is
transfer, is covered by this document. To effect a mail transfer to covered by this document. To effect a mail transfer to an SMTP
an SMTP server, an SMTP client establishes a two-way transmission server, an SMTP client establishes a two-way transmission channel to
channel to that SMTP server. An SMTP client determines the address that SMTP server. An SMTP client determines the address of an
of an appropriate host running an SMTP server by resolving a appropriate host running an SMTP server by resolving a destination
destination domain name to either an intermediate Mail eXchanger host domain name to either an intermediate Mail eXchanger host or a final
or a final target host. target host.
An SMTP server may be either the ultimate destination or an An SMTP server may be either the ultimate destination or an
intermediate "relay" (that is, it may assume the role of an SMTP intermediate "relay" (that is, it may assume the role of an SMTP
client after receiving the message) or "gateway" (that is, it may client after receiving the message) or "gateway" (that is, it may
transport the message further using some protocol other than SMTP). transport the message further using some protocol other than SMTP).
SMTP commands are generated by the SMTP client and sent to the SMTP SMTP commands are generated by the SMTP client and sent to the SMTP
server. SMTP replies are sent from the SMTP server to the SMTP server. SMTP replies are sent from the SMTP server to the SMTP
client in response to the commands. client in response to the commands.
In other words, message transfer can occur in a single connection In other words, message transfer can occur in a single connection
between the original SMTP-sender and the final SMTP-recipient, or can between the original SMTP-sender and the final SMTP-recipient, or can
occur in a series of hops through intermediary systems. In either occur in a series of hops through intermediary systems. In either
case, a formal handoff of responsibility for the message occurs: the case, once the server has issued a success response at the end of the
protocol requires that a server accept responsibility for either mail data, a formal handoff of responsibility for the message occurs:
delivering a message or properly reporting the failure to do so. the protocol requires that a server MUST accept responsibility for
either delivering the message or properly reporting the failure to do
so (see Section 6.1, Section 6.2, Section 7.8, below).
Once the transmission channel is established and initial handshaking Once the transmission channel is established and initial handshaking
completed, the SMTP client normally initiates a mail transaction. completed, the SMTP client normally initiates a mail transaction.
Such a transaction consists of a series of commands to specify the Such a transaction consists of a series of commands to specify the
originator and destination of the mail and transmission of the originator and destination of the mail and transmission of the
message content (including any headers or other structure) itself. message content (including any lines in the header section or other
When the same message is sent to multiple recipients, this protocol structure) itself. When the same message is sent to multiple
encourages the transmission of only one copy of the data for all recipients, this protocol encourages the transmission of only one
recipients at the same destination (or intermediate relay) host. copy of the data for all recipients at the same destination (or
intermediate relay) host.
The server responds to each command with a reply; replies may The server responds to each command with a reply; replies may
indicate that the command was accepted, that additional commands are indicate that the command was accepted, that additional commands are
expected, or that a temporary or permanent error condition exists. expected, or that a temporary or permanent error condition exists.
Commands specifying the sender or recipients may include server- Commands specifying the sender or recipients may include server-
permitted SMTP service extension requests as discussed in section permitted SMTP service extension requests as discussed in
2.2. The dialog is purposely lock-step, one-at-a-time, although this Section 2.2. The dialog is purposely lock-step, one-at-a-time,
can be modified by mutually-agreed extension requests such as command although this can be modified by mutually-agreed extension requests
pipelining [13]. such as command pipelining (RFC2920 [34]).
Once a given mail message has been transmitted, the client may either Once a given mail message has been transmitted, the client may either
request that the connection be shut down or may initiate other mail request that the connection be shut down or may initiate other mail
transactions. In addition, an SMTP client may use a connection to an transactions. In addition, an SMTP client may use a connection to an
SMTP server for ancillary services such as verification of email SMTP server for ancillary services such as verification of email
addresses or retrieval of mailing list subscriber addresses. addresses or retrieval of mailing list subscriber addresses.
As suggested above, this protocol provides mechanisms for the As suggested above, this protocol provides mechanisms for the
transmission of mail. This transmission normally occurs directly transmission of mail. Historically, this transmission normally
from the sending user's host to the receiving user's host when the occurred directly from the sending user's host to the receiving
two hosts are connected to the same transport service. When they are user's host when the two hosts are connected to the same transport
not connected to the same transport service, transmission occurs via service. When they are not connected to the same transport service,
one or more relay SMTP servers. An intermediate host that acts as transmission occurs via one or more relay SMTP servers. A very
either an SMTP relay or as a gateway into some other transmission common case in the Internet today involves submission of the original
environment is usually selected through the use of the domain name message to an intermediate, "message submission" server, which is
service (DNS) Mail eXchanger mechanism. similar to a relay but has some additional properties; such servers
are discussed in Section 2.3.10 and at some length in RFC4409 [42] .
An intermediate host that acts as either an SMTP relay or as a
gateway into some other transmission environment is usually selected
through the use of the domain name service (DNS) Mail eXchanger
mechanism.
Usually, intermediate hosts are determined via the DNS MX record, not Usually, intermediate hosts are determined via the DNS MX record, not
by explicit "source" routing (see section 5 and appendices C and by explicit "source" routing (see Section 5 and Appendix C and
F.2). Appendix F.2).
2.2 The Extension Model 2.2. The Extension Model
2.2.1 Background 2.2.1. Background
In an effort that started in 1990, approximately a decade after RFC In an effort that started in 1990, approximately a decade after RFC
821 was completed, the protocol was modified with a "service 821 was completed, the protocol was modified with a "service
extensions" model that permits the client and server to agree to extensions" model that permits the client and server to agree to
utilize shared functionality beyond the original SMTP requirements. utilize shared functionality beyond the original SMTP requirements.
The SMTP extension mechanism defines a means whereby an extended SMTP The SMTP extension mechanism defines a means whereby an extended SMTP
client and server may recognize each other, and the server can inform client and server may recognize each other, and the server can inform
the client as to the service extensions that it supports. the client as to the service extensions that it supports.
Contemporary SMTP implementations MUST support the basic extension Contemporary SMTP implementations MUST support the basic extension
skipping to change at page 8, line 5 skipping to change at page 11, line 5
Unless the different characteristics of HELO must be identified for Unless the different characteristics of HELO must be identified for
interoperability purposes, this document discusses only EHLO. interoperability purposes, this document discusses only EHLO.
SMTP is widely deployed and high-quality implementations have proven SMTP is widely deployed and high-quality implementations have proven
to be very robust. However, the Internet community now considers to be very robust. However, the Internet community now considers
some services to be important that were not anticipated when the some services to be important that were not anticipated when the
protocol was first designed. If support for those services is to be protocol was first designed. If support for those services is to be
added, it must be done in a way that permits older implementations to added, it must be done in a way that permits older implementations to
continue working acceptably. The extension framework consists of: continue working acceptably. The extension framework consists of:
- The SMTP command EHLO, superseding the earlier HELO, o The SMTP command EHLO, superseding the earlier HELO,
- a registry of SMTP service extensions, o a registry of SMTP service extensions,
- additional parameters to the SMTP MAIL and RCPT commands, and o additional parameters to the SMTP MAIL and RCPT commands, and
- optional replacements for commands defined in this protocol, such o optional replacements for commands defined in this protocol, such
as for DATA in non-ASCII transmissions [33]. as for DATA in non-ASCII transmissions (RFC3030 [36]).
SMTP's strength comes primarily from its simplicity. Experience with SMTP's strength comes primarily from its simplicity. Experience with
many protocols has shown that protocols with few options tend towards many protocols has shown that protocols with few options tend towards
ubiquity, whereas protocols with many options tend towards obscurity. ubiquity, whereas protocols with many options tend towards obscurity.
Each and every extension, regardless of its benefits, must be Each and every extension, regardless of its benefits, must be
carefully scrutinized with respect to its implementation, deployment, carefully scrutinized with respect to its implementation, deployment,
and interoperability costs. In many cases, the cost of extending the and interoperability costs. In many cases, the cost of extending the
SMTP service will likely outweigh the benefit. SMTP service will likely outweigh the benefit.
2.2.2 Definition and Registration of Extensions 2.2.2. Definition and Registration of Extensions
The IANA maintains a registry of SMTP service extensions. A The IANA maintains a registry of SMTP service extensions. A
corresponding EHLO keyword value is associated with each extension. corresponding EHLO keyword value is associated with each extension.
Each service extension registered with the IANA must be defined in a Each service extension registered with the IANA must be defined in a
formal standards-track or IESG-approved experimental protocol formal standards-track or IESG-approved experimental protocol
document. The definition must include: document. The definition must include:
- the textual name of the SMTP service extension; o the textual name of the SMTP service extension;
- the EHLO keyword value associated with the extension; o the EHLO keyword value associated with the extension;
- the syntax and possible values of parameters associated with the o the syntax and possible values of parameters associated with the
EHLO keyword value; EHLO keyword value;
- any additional SMTP verbs associated with the extension o any additional SMTP verbs associated with the extension
(additional verbs will usually be, but are not required to be, the (additional verbs will usually be, but are not required to be, the
same as the EHLO keyword value); same as the EHLO keyword value);
- any new parameters the extension associates with the MAIL or RCPT o any new parameters the extension associates with the MAIL or RCPT
verbs; verbs;
- a description of how support for the extension affects the o a description of how support for the extension affects the
behavior of a server and client SMTP; and, behavior of a server and client SMTP; and,
- the increment by which the extension is increasing the maximum o the increment by which the extension is increasing the maximum
length of the commands MAIL and/or RCPT, over that specified in length of the commands MAIL and/or RCPT, over that specified in
this standard. this standard.
In addition, any EHLO keyword value starting with an upper or lower In addition, any EHLO keyword value starting with an upper or lower
case "X" refers to a local SMTP service extension used exclusively case "X" refers to a local SMTP service extension used exclusively
through bilateral agreement. Keywords beginning with "X" MUST NOT be through bilateral agreement. Keywords beginning with "X" MUST NOT be
used in a registered service extension. Conversely, keyword values used in a registered service extension. Conversely, keyword values
presented in the EHLO response that do not begin with "X" MUST presented in the EHLO response that do not begin with "X" MUST
correspond to a standard, standards-track, or IESG-approved correspond to a standard, standards-track, or IESG-approved
experimental SMTP service extension registered with IANA. A experimental SMTP service extension registered with IANA. A
conforming server MUST NOT offer non-"X"-prefixed keyword values that conforming server MUST NOT offer non-"X"-prefixed keyword values that
are not described in a registered extension. are not described in a registered extension.
Additional verbs and parameter names are bound by the same rules as Additional verbs and parameter names are bound by the same rules as
EHLO keywords; specifically, verbs beginning with "X" are local EHLO keywords; specifically, verbs beginning with "X" are local
extensions that may not be registered or standardized. Conversely, extensions that may not be registered or standardized. Conversely,
verbs not beginning with "X" must always be registered. verbs not beginning with "X" must always be registered.
2.3 Terminology 2.2.3. Special Issues with Extensions
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 below.
1. MUST This word, or the terms "REQUIRED" or "SHALL", mean that
the definition is an absolute requirement of the specification.
2. MUST NOT This phrase, or the phrase "SHALL NOT", mean that the Extensions that change fairly basic properties of SMTP operation are
definition is an absolute prohibition of the specification. permitted. The text in other sections of this document must be
understood in that context. In particular, extensions can change the
minimum limits specified in Section 4.5.3, can change the ASCII
character set requirement as mentioned above, or can introduce some
optional modes of message handling.
3. SHOULD This word, or the adjective "RECOMMENDED", mean that In particular, if an extension implies that the delivery path
there may exist valid reasons in particular circumstances to normally supports special features of that extension, and an
ignore a particular item, but the full implications must be intermediate SMTP system finds a next hop that does not support the
understood and carefully weighed before choosing a different required extension, it MAY choose, based on the specific extension
course. and circumstances, to requeue the message and try later and/or try an
alternate MX host. If this strategy is employed, the timeout to fall
back to an unextended format (if one is available) SHOULD be less
than the normal timeout for bouncing as undeliverable (e.g., if
normal timeout is three days, the requeue timeout before attempting
to transmit the mail without the extension might be one day).
4. SHOULD NOT This phrase, or the phrase "NOT RECOMMENDED" mean 2.3. Terminology
that there may exist valid reasons in particular circumstances
when the particular behavior is acceptable or even useful, but the
full implications should be understood and the case carefully
weighed before implementing any behavior described with this
label.
5. MAY This word, or the adjective "OPTIONAL", mean that an item is The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
truly optional. One vendor may choose to include the item because "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
a particular marketplace requires it or because the vendor feels document are to be interpreted as described in RFC 2119 [1]. As each
that it enhances the product while another vendor may omit the of these terms was intentionally and carefully chosen to improve the
same item. An implementation which does not include a particular interoperability of email, each use of these terms is to be treated
option MUST be prepared to interoperate with another as a conformance requirement.
implementation which does include the option, though perhaps with
reduced functionality. In the same vein an implementation which
does include a particular option MUST be prepared to interoperate
with another implementation which does not include the option
(except, of course, for the feature the option provides.)
2.3.1 Mail Objects 2.3.1. Mail Objects
SMTP transports a mail object. A mail object contains an envelope SMTP transports a mail object. A mail object contains an envelope
and content. and content.
The SMTP envelope is sent as a series of SMTP protocol units The SMTP envelope is sent as a series of SMTP protocol units
(described in section 3). It consists of an originator address (to (described in Section 3). It consists of an originator address (to
which error reports should be directed); one or more recipient which error reports should be directed); one or more recipient
addresses; and optional protocol extension material. Historically, addresses; and optional protocol extension material. Historically,
variations on the recipient address specification command (RCPT TO) variations on the reverse path (originator) address specification
could be used to specify alternate delivery modes, such as immediate command (MAIL) could be used to specify alternate delivery modes,
display; those variations have now been deprecated (see appendix F, such as immediate display; those variations have now been deprecated
section F.6). (see Appendix F and Appendix F.6).
The SMTP content is sent in the SMTP DATA protocol unit and has two The SMTP content is sent in the SMTP DATA protocol unit and has two
parts: the headers and the body. If the content conforms to other parts: the header section and the body. If the content conforms to
contemporary standards, the headers form a collection of field/value other contemporary standards, the header section consists of a
pairs structured as in the message format specification [32]; the collection of header fields, each consisting of a header name, a
body, if structured, is defined according to MIME [12]. The content colon, and data, structured as in the message format specification
is textual in nature, expressed using the US-ASCII repertoire [1]. (RFC2822 [11]); the body, if structured, is defined according to MIME
Although SMTP extensions (such as "8BITMIME" [20]) may relax this (RFC2045 [28]). The content is textual in nature, expressed using
restriction for the content body, the content headers are always the US-ASCII repertoire [2]. Although SMTP extensions (such as
encoded using the US-ASCII repertoire. A MIME extension [23] defines "8BITMIME", RFC1652 [23]) may relax this restriction for the content
an algorithm for representing header values outside the US-ASCII body, the content header fields are always encoded using the US-ASCII
repertoire, while still encoding them using the US-ASCII repertoire. repertoire. Two MIME extensions (RFC2047 [29] and RFC2231 [32])
define an algorithm for representing header values outside the US-
ASCII repertoire, while still encoding them using the US-ASCII
repertoire.
2.3.2 Senders and Receivers 2.3.2. Senders and Receivers
In RFC 821, the two hosts participating in an SMTP transaction were In RFC 821, the two hosts participating in an SMTP transaction were
described as the "SMTP-sender" and "SMTP-receiver". This document described as the "SMTP-sender" and "SMTP-receiver". This document
has been changed to reflect current industry terminology and hence has been changed to reflect current industry terminology and hence
refers to them as the "SMTP client" (or sometimes just "the client") refers to them as the "SMTP client" (or sometimes just "the client")
and "SMTP server" (or just "the server"), respectively. Since a and "SMTP server" (or just "the server"), respectively. Since a
given host may act both as server and client in a relay situation, given host may act both as server and client in a relay situation,
"receiver" and "sender" terminology is still used where needed for "receiver" and "sender" terminology is still used where needed for
clarity. clarity.
2.3.3 Mail Agents and Message Stores 2.3.3. Mail Agents and Message Stores
Additional mail system terminology became common after RFC 821 was Additional mail system terminology became common after RFC 821 was
published and, where convenient, is used in this specification. In published and, where convenient, is used in this specification. In
particular, SMTP servers and clients provide a mail transport service particular, SMTP servers and clients provide a mail transport service
and therefore act as "Mail Transfer Agents" (MTAs). "Mail User and therefore act as "Mail Transfer Agents" (MTAs). "Mail User
Agents" (MUAs or UAs) are normally thought of as the sources and Agents" (MUAs or UAs) are normally thought of as the sources and
targets of mail. At the source, an MUA might collect mail to be targets of mail. At the source, an MUA might collect mail to be
transmitted from a user and hand it off to an MTA; the final transmitted from a user and hand it off to an MTA; the final
("delivery") MTA would be thought of as handing the mail off to an ("delivery") MTA would be thought of as handing the mail off to an
MUA (or at least transferring responsibility to it, e.g., by MUA (or at least transferring responsibility to it, e.g., by
depositing the message in a "message store"). However, while these depositing the message in a "message store"). However, while these
terms are used with at least the appearance of great precision in terms are used with at least the appearance of great precision in
other environments, the implied boundaries between MUAs and MTAs other environments, the implied boundaries between MUAs and MTAs
often do not accurately match common, and conforming, practices with often do not accurately match common, and conforming, practices with
Internet mail. Hence, the reader should be cautious about inferring Internet mail. Hence, the reader should be cautious about inferring
the strong relationships and responsibilities that might be implied the strong relationships and responsibilities that might be implied
if these terms were used elsewhere. if these terms were used elsewhere.
2.3.4 Host 2.3.4. Host
For the purposes of this specification, a host is a computer system For the purposes of this specification, a host is a computer system
attached to the Internet (or, in some cases, to a private TCP/IP attached to the Internet (or, in some cases, to a private TCP/IP
network) and supporting the SMTP protocol. Hosts are known by names network) and supporting the SMTP protocol. Hosts are known by names
(see "domain"); identifying them by numerical address is discouraged. (see the next section); they SHOULD NOT be identified by numerical
addresses, i.e., by address literals as described in Section 4.1.2.
2.3.5 Domain 2.3.5. Domain Names
A domain (or domain name) consists of one or more dot-separated A domain name (or often just a "domain") consists of one or more
components. These components ("labels" in DNS terminology [22]) are components, separated by dots if more than one appears. In the case
restricted for SMTP purposes to consist of a sequence of letters, of a top-level domain used by itself in an email address, a single
digits, and hyphens drawn from the ASCII character set [1]. Domain string is used without any dots. This makes the requirement,
names are used as names of hosts and of other entities in the domain described in more detail below, that only fully-qualified domain
name hierarchy. For example, a domain may refer to an alias (label names appear in SMTP transactions on the public Internet,
of a CNAME RR) or the label of Mail eXchanger records to be used to particularly important where top-level domains are involved. These
deliver mail instead of representing a host name. See [22] and components ("labels" in DNS terminology, RFC1035 [7]) are restricted
section 5 of this specification. for SMTP purposes to consist of a sequence of letters, digits, and
hyphens drawn from the ASCII character set [2]. Domain names are
used as names of hosts and of other entities in the domain name
hierarchy. For example, a domain may refer to an alias (label of a
CNAME RR) or the label of Mail eXchanger records to be used to
deliver mail instead of representing a host name. See RFC1035 [7]
and Section 5 of this specification.
The domain name, as described in this document and in [22], is the The domain name, as described in this document and in RFC1035 [7], is
entire, fully-qualified name (often referred to as an "FQDN"). A the entire, fully-qualified name (often referred to as an "FQDN"). A
domain name that is not in FQDN form is no more than a local alias. domain name that is not in FQDN form is no more than a local alias.
Local aliases MUST NOT appear in any SMTP transaction. Local aliases MUST NOT appear in any SMTP transaction.
2.3.6 Buffer and State Table Only resolvable, fully-qualified, domain names (FQDNs) are permitted
when domain names are used in SMTP. In other words, names that can
be resolved to MX RRs or address (i.e. A or AAAA) RRs (as discussed
in Section 5) are permitted, as are CNAME RRs whose targets can be
resolved, in turn, to MX or address RRs. Local nicknames or
unqualified names MUST NOT be used. There are two exceptions to the
rule requiring FQDNs:
o The domain name given in the EHLO command MUST be either a primary
host name (a domain name that resolves to an address RR) or, if
the host has no name, an address literal as described in
Section 4.1.3 and discussed further in the EHLO discussion of
Section 4.1.4.
o The reserved mailbox name "postmaster" may be used in a RCPT
command without domain qualification (see Section 4.1.1.3) and
MUST be accepted if so used.
2.3.6. Buffer and State Table
SMTP sessions are stateful, with both parties carefully maintaining a SMTP sessions are stateful, with both parties carefully maintaining a
common view of the current state. In this document we model this common view of the current state. In this document we model this
state by a virtual "buffer" and a "state table" on the server which state by a virtual "buffer" and a "state table" on the server which
may be used by the client to, for example, "clear the buffer" or may be used by the client to, for example, "clear the buffer" or
"reset the state table," causing the information in the buffer to be "reset the state table," causing the information in the buffer to be
discarded and the state to be returned to some previous state. discarded and the state to be returned to some previous state.
2.3.7 Lines 2.3.7. Commands and Replies
SMTP commands and, unless altered by a service extension, message SMTP commands and, unless altered by a service extension, message
data, are transmitted in "lines". Lines consist of zero or more data data, are transmitted from the sender to the receiver via the
characters terminated by the sequence ASCII character "CR" (hex value transmission channel in "lines".
0D) followed immediately by ASCII character "LF" (hex value 0A).
This termination sequence is denoted as <CRLF> in this document. An SMTP reply is an acknowledgment (positive or negative) sent in
Conforming implementations MUST NOT recognize or generate any other "lines" from receiver to sender via the transmission channel in
character or character sequence as a line terminator. Limits MAY be response to a command. The general form of a reply is a numeric
imposed on line lengths by servers (see section 4.5.3). completion code (indicating failure or success) usually followed by a
text string. The codes are for use by programs and the text is
usually intended for human users. RFC 3463 [37], specifies further
structuring of the reply strings, including the use of supplemental
and more specific completion codes.
2.3.8. Lines
Lines consist of zero or more data characters terminated by the
sequence ASCII character "CR" (hex value 0D) followed immediately by
ASCII character "LF" (hex value 0A). This termination sequence is
denoted as <CRLF> in this document. Conforming implementations MUST
NOT recognize or generate any other character or character sequence
as a line terminator. Limits MAY be imposed on line lengths by
servers (see Section 4).
In addition, the appearance of "bare" "CR" or "LF" characters in text In addition, the appearance of "bare" "CR" or "LF" characters in text
(i.e., either without the other) has a long history of causing (i.e., either without the other) has a long history of causing
problems in mail implementations and applications that use the mail problems in mail implementations and applications that use the mail
system as a tool. SMTP client implementations MUST NOT transmit system as a tool. SMTP client implementations MUST NOT transmit
these characters except when they are intended as line terminators these characters except when they are intended as line terminators
and then MUST, as indicated above, transmit them only as a <CRLF> and then MUST, as indicated above, transmit them only as a <CRLF>
sequence. sequence.
2.3.8 Originator, Delivery, Relay, and Gateway Systems 2.3.9. Message Content and Mail Data
The terms "message content" and "mail data" are used interchangeably
in this document to describe the material transmitted after the DATA
command is accepted and before the end of data indication is
transmitted. Message content includes the message header section and
the possibly-structured message body. The MIME specification
(RFC2045 [28]) provides the standard mechanisms for structured
message bodies.
2.3.10. Originator, Delivery, Relay, and Gateway Systems
This specification makes a distinction among four types of SMTP This specification makes a distinction among four types of SMTP
systems, based on the role those systems play in transmitting systems, based on the role those systems play in transmitting
electronic mail. An "originating" system (sometimes called an SMTP electronic mail. An "originating" system (sometimes called an SMTP
originator) introduces mail into the Internet or, more generally, originator) introduces mail into the Internet or, more generally,
into a transport service environment. A "delivery" SMTP system is into a transport service environment. A "delivery" SMTP system is
one that receives mail from a transport service environment and one that receives mail from a transport service environment and
passes it to a mail user agent or deposits it in a message store passes it to a mail user agent or deposits it in a message store
which a mail user agent is expected to subsequently access. A which a mail user agent is expected to subsequently access. A
"relay" SMTP system (usually referred to just as a "relay") receives "relay" SMTP system (usually referred to just as a "relay") receives
skipping to change at page 12, line 47 skipping to change at page 16, line 38
server for further relaying or for delivery. server for further relaying or for delivery.
A "gateway" SMTP system (usually referred to just as a "gateway") A "gateway" SMTP system (usually referred to just as a "gateway")
receives mail from a client system in one transport environment and receives mail from a client system in one transport environment and
transmits it to a server system in another transport environment. transmits it to a server system in another transport environment.
Differences in protocols or message semantics between the transport Differences in protocols or message semantics between the transport
environments on either side of a gateway may require that the gateway environments on either side of a gateway may require that the gateway
system perform transformations to the message that are not permitted system perform transformations to the message that are not permitted
to SMTP relay systems. For the purposes of this specification, to SMTP relay systems. For the purposes of this specification,
firewalls that rewrite addresses should be considered as gateways, firewalls that rewrite addresses should be considered as gateways,
even if SMTP is used on both sides of them (see [11]). even if SMTP is used on both sides of them (see RFC2979 [35]).
2.3.9 Message Content and Mail Data
The terms "message content" and "mail data" are used interchangeably
in this document to describe the material transmitted after the DATA
command is accepted and before the end of data indication is
transmitted. Message content includes message headers and the
possibly-structured message body. The MIME specification [12]
provides the standard mechanisms for structured message bodies.
2.3.10 Mailbox and Address 2.3.11. Mailbox and Address
As used in this specification, an "address" is a character string As used in this specification, an "address" is a character string
that identifies a user to whom mail will be sent or a location into that identifies a user to whom mail will be sent or a location into
which mail will be deposited. The term "mailbox" refers to that which mail will be deposited. The term "mailbox" refers to that
depository. The two terms are typically used interchangeably unless depository. The two terms are typically used interchangeably unless
the distinction between the location in which mail is placed (the the distinction between the location in which mail is placed (the
mailbox) and a reference to it (the address) is important. An mailbox) and a reference to it (the address) is important. An
address normally consists of user and domain specifications. The address normally consists of user and domain specifications. The
standard mailbox naming convention is defined to be "local- standard mailbox naming convention is defined to be
part@domain": contemporary usage permits a much broader set of "local-part@domain"; contemporary usage permits a much broader set of
applications than simple "user names". Consequently, and due to a applications than simple "user names". Consequently, and due to a
long history of problems when intermediate hosts have attempted to long history of problems when intermediate hosts have attempted to
optimize transport by modifying them, the local-part MUST be optimize transport by modifying them, the local-part MUST be
interpreted and assigned semantics only by the host specified in the interpreted and assigned semantics only by the host specified in the
domain part of the address. domain part of the address.
2.3.11 Reply 2.4. General Syntax Principles and Transaction Model
An SMTP reply is an acknowledgment (positive or negative) sent from
receiver to sender via the transmission channel in response to a
command. The general form of a reply is a numeric completion code
(indicating failure or success) usually followed by a text string.
The codes are for use by programs and the text is usually intended
for human users. Recent work [34] has specified further structuring
of the reply strings, including the use of supplemental and more
specific completion codes.
2.4 General Syntax Principles and Transaction Model
SMTP commands and replies have a rigid syntax. All commands begin SMTP commands and replies have a rigid syntax. All commands begin
with a command verb. All Replies begin with a three digit numeric with a command verb. All replies begin with a three digit numeric
code. In some commands and replies, arguments MUST follow the verb code. In some commands and replies, arguments are required following
or reply code. Some commands do not accept arguments (after the the verb or reply code. Some commands do not accept arguments (after
verb), and some reply codes are followed, sometimes optionally, by the verb), and some reply codes are followed, sometimes optionally,
free form text. In both cases, where text appears, it is separated by free form text. In both cases, where text appears, it is
from the verb or reply code by a space character. Complete separated from the verb or reply code by a space character. Complete
definitions of commands and replies appear in section 4. definitions of commands and replies appear in Section 4.
Verbs and argument values (e.g., "TO:" or "to:" in the RCPT command Verbs and argument values (e.g., "TO:" or "to:" in the RCPT command
and extension name keywords) are not case sensitive, with the sole and extension name keywords) are not case sensitive, with the sole
exception in this specification of a mailbox local-part (SMTP exception in this specification of a mailbox local-part (SMTP
Extensions may explicitly specify case-sensitive elements). That is, Extensions may explicitly specify case-sensitive elements). That is,
a command verb, an argument value other than a mailbox local-part, a command verb, an argument value other than a mailbox local-part,
and free form text MAY be encoded in upper case, lower case, or any and free form text MAY be encoded in upper case, lower case, or any
mixture of upper and lower case with no impact on its meaning. This mixture of upper and lower case with no impact on its meaning. The
is NOT true of a mailbox local-part. The local-part of a mailbox local-part of a mailbox MUST BE treated as case sensitive.
MUST BE treated as case sensitive. Therefore, SMTP implementations Therefore, SMTP implementations MUST take care to preserve the case
MUST take care to preserve the case of mailbox local-parts. Mailbox of mailbox local-parts. In particular, for some hosts the user
domains are not case sensitive. In particular, for some hosts the "smith" is different from the user "Smith". However, exploiting the
user "smith" is different from the user "Smith". However, exploiting case sensitivity of mailbox local-parts impedes interoperability and
the case sensitivity of mailbox local-parts impedes interoperability is discouraged. Mailbox domains follow normal DNS rules and are
and is discouraged. hence not case sensitive.
A few SMTP servers, in violation of this specification (and RFC 821) A few SMTP servers, in violation of this specification (and RFC 821)
require that command verbs be encoded by clients in upper case. require that command verbs be encoded by clients in upper case.
Implementations MAY wish to employ this encoding to accommodate those Implementations MAY wish to employ this encoding to accommodate those
servers. servers.
The argument field consists of a variable length character string The argument clause consists of a variable length character string
ending with the end of the line, i.e., with the character sequence ending with the end of the line, i.e., with the character sequence
<CRLF>. The receiver will take no action until this sequence is <CRLF>. The receiver will take no action until this sequence is
received. received.
The syntax for each command is shown with the discussion of that The syntax for each command is shown with the discussion of that
command. Common elements and parameters are shown in section 4.1.2. command. Common elements and parameters are shown in Section 4.1.2.
Commands and replies are composed of characters from the ASCII Commands and replies are composed of characters from the ASCII
character set [1]. When the transport service provides an 8-bit byte character set [2]. When the transport service provides an 8-bit byte
(octet) transmission channel, each 7-bit character is transmitted (octet) transmission channel, each 7-bit character is transmitted
right justified in an octet with the high order bit cleared to zero. right justified in an octet with the high order bit cleared to zero.
More specifically, the unextended SMTP service provides seven bit More specifically, the unextended SMTP service provides seven bit
transport only. An originating SMTP client which has not transport only. An originating SMTP client that has not successfully
successfully negotiated an appropriate extension with a particular negotiated an appropriate extension with a particular server (see the
server MUST NOT transmit messages with information in the high-order next paragraph) MUST NOT transmit messages with information in the
bit of octets. If such messages are transmitted in violation of this high-order bit of octets. If such messages are transmitted in
rule, receiving SMTP servers MAY clear the high-order bit or reject violation of this rule, receiving SMTP servers MAY clear the high-
the message as invalid. In general, a relay SMTP SHOULD assume that order bit or reject the message as invalid. In general, a relay SMTP
the message content it has received is valid and, assuming that the SHOULD assume that the message content it has received is valid and,
envelope permits doing so, relay it without inspecting that content. assuming that the envelope permits doing so, relay it without
Of course, if the content is mislabeled and the data path cannot inspecting that content. Of course, if the content is mislabeled and
accept the actual content, this may result in ultimate delivery of a the data path cannot accept the actual content, this may result in
severely garbled message to the recipient. Delivery SMTP systems MAY ultimate delivery of a severely garbled message to the recipient.
reject ("bounce") such messages rather than deliver them. No sending Delivery SMTP systems MAY reject such messages, or return them as
SMTP system is permitted to send envelope commands in any character undeliverable, rather than deliver them. In the absence of a server-
set other than US-ASCII; receiving systems SHOULD reject such offered extension explicitly permitting it, a sending SMTP system is
commands, normally using "500 syntax error - invalid character" not permitted to send envelope commands in any character set other
replies. than US-ASCII. Receiving systems SHOULD reject such commands,
normally using "500 syntax error - invalid character" replies.
Eight-bit message content transmission MAY be requested of the server Eight-bit message content transmission MAY be requested of the server
by a client using extended SMTP facilities, notably the "8BITMIME" by a client using extended SMTP facilities, notably the "8BITMIME"
extension [20]. 8BITMIME SHOULD be supported by SMTP servers. extension, RFC1652 [23]. 8BITMIME SHOULD be supported by SMTP
However, it MUST not be construed as authorization to transmit servers. However, it MUST NOT be construed as authorization to
unrestricted eight bit material. 8BITMIME MUST NOT be requested by transmit unrestricted eight bit material, nor does 8BITMIME authorize
senders for material with the high bit on that is not in MIME format transmission of any envelope material in other than ASCII. 8BITMIME
with an appropriate content-transfer encoding; servers MAY reject MUST NOT be requested by senders for material with the high bit on
such messages. that is not in MIME format with an appropriate content-transfer
encoding; servers MAY reject such messages.
The metalinguistic notation used in this document corresponds to the The metalinguistic notation used in this document corresponds to the
"Augmented BNF" used in other Internet mail system documents. The "Augmented BNF" used in other Internet mail system documents. The
reader who is not familiar with that syntax should consult the ABNF reader who is not familiar with that syntax should consult the ABNF
specification [8]. Metalanguage terms used in running text are specification in RFC 5234 [5]. Metalanguage terms used in running
surrounded by pointed brackets (e.g., <CRLF>) for clarity. text are surrounded by pointed brackets (e.g., <CRLF>) for clarity.
The reader is cautioned that the grammar expressed in the
metalanguage is not comprehensive. There are many instances in which
provisions in the text constrain or otherwise modify the syntax or
semantics implied by the grammar.
3. The SMTP Procedures: An Overview 3. The SMTP Procedures: An Overview
This section contains descriptions of the procedures used in SMTP: This section contains descriptions of the procedures used in SMTP:
session initiation, the mail transaction, forwarding mail, verifying session initiation, the mail transaction, forwarding mail, verifying
mailbox names and expanding mailing lists, and the opening and mailbox names and expanding mailing lists, and the opening and
closing exchanges. Comments on relaying, a note on mail domains, and closing exchanges. Comments on relaying, a note on mail domains, and
a discussion of changing roles are included at the end of this a discussion of changing roles are included at the end of this
section. Several complete scenarios are presented in appendix D. section. Several complete scenarios are presented in Appendix D.
3.1 Session Initiation 3.1. Session Initiation
An SMTP session is initiated when a client opens a connection to a An SMTP session is initiated when a client opens a connection to a
server and the server responds with an opening message. server and the server responds with an opening message.
SMTP server implementations MAY include identification of their SMTP server implementations MAY include identification of their
software and version information in the connection greeting reply software and version information in the connection greeting reply
after the 220 code, a practice that permits more efficient isolation after the 220 code, a practice that permits more efficient isolation
and repair of any problems. Implementations MAY make provision for and repair of any problems. Implementations MAY make provision for
SMTP servers to disable the software and version announcement where SMTP servers to disable the software and version announcement where
it causes security concerns. While some systems also identify their it causes security concerns. While some systems also identify their
contact point for mail problems, this is not a substitute for contact point for mail problems, this is not a substitute for
maintaining the required "postmaster" address (see section 4.5.1). maintaining the required "postmaster" address (see Section 4).
The SMTP protocol allows a server to formally reject a transaction The SMTP protocol allows a server to formally reject a mail session
while still allowing the initial connection as follows: a 554 while still allowing the initial connection as follows: a 554
response MAY be given in the initial connection opening message response MAY be given in the initial connection opening message
instead of the 220. A server taking this approach MUST still wait instead of the 220. A server taking this approach MUST still wait
for the client to send a QUIT (see section 4.1.1.10) before closing for the client to send a QUIT (see Section 4.1.1.10) before closing
the connection and SHOULD respond to any intervening commands with the connection and SHOULD respond to any intervening commands with
"503 bad sequence of commands". Since an attempt to make an SMTP "503 bad sequence of commands". Since an attempt to make an SMTP
connection to such a system is probably in error, a server returning connection to such a system is probably in error, a server returning
a 554 response on connection opening SHOULD provide enough a 554 response on connection opening SHOULD provide enough
information in the reply text to facilitate debugging of the sending information in the reply text to facilitate debugging of the sending
system. system.
3.2 Client Initiation 3.2. Client Initiation
Once the server has sent the welcoming message and the client has Once the server has sent the greeting (welcoming) message and the
received it, the client normally sends the EHLO command to the client has received it, the client normally sends the EHLO command to
server, indicating the client's identity. In addition to opening the the server, indicating the client's identity. In addition to opening
session, use of EHLO indicates that the client is able to process the session, use of EHLO indicates that the client is able to process
service extensions and requests that the server provide a list of the service extensions and requests that the server provide a list of the
extensions it supports. Older SMTP systems which are unable to extensions it supports. Older SMTP systems that are unable to
support service extensions and contemporary clients which do not support service extensions, and contemporary clients that do not
require service extensions in the mail session being initiated, MAY require service extensions in the mail session being initiated, MAY
use HELO instead of EHLO. Servers MUST NOT return the extended use HELO instead of EHLO. Servers MUST NOT return the extended EHLO-
EHLO-style response to a HELO command. For a particular connection style response to a HELO command. For a particular connection
attempt, if the server returns a "command not recognized" response to attempt, if the server returns a "command not recognized" response to
EHLO, the client SHOULD be able to fall back and send HELO. EHLO, the client SHOULD be able to fall back and send HELO.
In the EHLO command the host sending the command identifies itself; In the EHLO command the host sending the command identifies itself;
the command may be interpreted as saying "Hello, I am <domain>" (and, the command may be interpreted as saying "Hello, I am <domain>" (and,
in the case of EHLO, "and I support service extension requests"). in the case of EHLO, "and I support service extension requests").
3.3 Mail Transactions 3.3. Mail Transactions
There are three steps to SMTP mail transactions. The transaction There are three steps to SMTP mail transactions. The transaction
starts with a MAIL command which gives the sender identification. starts with a MAIL command which gives the sender identification.
(In general, the MAIL command may be sent only when no mail (In general, the MAIL command may be sent only when no mail
transaction is in progress; see section 4.1.4.) A series of one or transaction is in progress; see Section 4.1.4.) A series of one or
more RCPT commands follows giving the receiver information. Then a more RCPT commands follows giving the receiver information. Then a
DATA command initiates transfer of the mail data and is terminated by DATA command initiates transfer of the mail data and is terminated by
the "end of mail" data indicator, which also confirms the the "end of mail" data indicator, which also confirms the
transaction. transaction.
The first step in the procedure is the MAIL command. The first step in the procedure is the MAIL command.
MAIL FROM:<reverse-path> [SP <mail-parameters> ] <CRLF> MAIL FROM:<reverse-path> [SP <mail-parameters> ] <CRLF>
This command tells the SMTP-receiver that a new mail transaction is This command tells the SMTP-receiver that a new mail transaction is
starting and to reset all its state tables and buffers, including any starting and to reset all its state tables and buffers, including any
recipients or mail data. The <reverse-path> portion of the first or recipients or mail data. The <reverse-path> portion of the first or
only argument contains the source mailbox (between "<" and ">" only argument contains the source mailbox (between "<" and ">"
brackets), which can be used to report errors (see section 4.2 for a brackets), which can be used to report errors (see Section 4.2 for a
discussion of error reporting). If accepted, the SMTP server returns discussion of error reporting). If accepted, the SMTP server returns
a 250 OK reply. If the mailbox specification is not acceptable for a 250 OK reply. If the mailbox specification is not acceptable for
some reason, the server MUST return a reply indicating whether the some reason, the server MUST return a reply indicating whether the
failure is permanent (i.e., will occur again if the client tries to failure is permanent (i.e., will occur again if the client tries to
send the same address again) or temporary (i.e., the address might be send the same address again) or temporary (i.e., the address might be
accepted if the client tries again later). Despite the apparent accepted if the client tries again later). Despite the apparent
scope of this requirement, there are circumstances in which the scope of this requirement, there are circumstances in which the
acceptability of the reverse-path may not be determined until one or acceptability of the reverse-path may not be determined until one or
more forward-paths (in RCPT commands) can be examined. In those more forward-paths (in RCPT commands) can be examined. In those
cases, the server MAY reasonably accept the reverse-path (with a 250 cases, the server MAY reasonably accept the reverse-path (with a 250
reply) and then report problems after the forward-paths are received reply) and then report problems after the forward-paths are received
and examined. Normally, failures produce 550 or 553 replies. and examined. Normally, failures produce 550 or 553 replies.
Historically, the <reverse-path> can contain more than just a Historically, the <reverse-path> was permitted to contain more than
mailbox, however, contemporary systems SHOULD NOT use source routing just a mailbox, however, contemporary systems SHOULD NOT use source
(see appendix C). routing (see Appendix C).
The optional <mail-parameters> are associated with negotiated SMTP The optional <mail-parameters> are associated with negotiated SMTP
service extensions (see section 2.2). service extensions (see Section 2.2).
The second step in the procedure is the RCPT command. The second step in the procedure is the RCPT command. This step of
the procedure can be repeated any number of times.
RCPT TO:<forward-path> [ SP <rcpt-parameters> ] <CRLF> RCPT TO:<forward-path> [ SP <rcpt-parameters> ] <CRLF>
The first or only argument to this command includes a forward-path The first or only argument to this command includes a forward-path
(normally a mailbox and domain, always surrounded by "<" and ">" (normally a mailbox and domain, always surrounded by "<" and ">"
brackets) identifying one recipient. If accepted, the SMTP server brackets) identifying one recipient. If accepted, the SMTP server
returns a 250 OK reply and stores the forward-path. If the recipient returns a 250 OK reply and stores the forward-path. If the recipient
is known not to be a deliverable address, the SMTP server returns a is known not to be a deliverable address, the SMTP server returns a
550 reply, typically with a string such as "no such user - " and the 550 reply, typically with a string such as "no such user - " and the
mailbox name (other circumstances and reply codes are possible). mailbox name (other circumstances and reply codes are possible).
This step of the procedure can be repeated any number of times.
The <forward-path> can contain more than just a mailbox. The <forward-path> can contain more than just a mailbox.
Historically, the <forward-path> can be a source routing list of Historically, the <forward-path> was permitted to contain a source
hosts and the destination mailbox, however, contemporary SMTP clients routing list of hosts and the destination mailbox, however,
SHOULD NOT utilize source routes (see appendix C). Servers MUST be contemporary SMTP clients SHOULD NOT utilize source routes (see
prepared to encounter a list of source routes in the forward path, Appendix C). Servers MUST be prepared to encounter a list of source
but SHOULD ignore the routes or MAY decline to support the relaying routes in the forward-path, but SHOULD ignore the routes or MAY
they imply. Similarly, servers MAY decline to accept mail that is decline to support the relaying they imply. Similarly, servers MAY
destined for other hosts or systems. These restrictions make a decline to accept mail that is destined for other hosts or systems.
server useless as a relay for clients that do not support full SMTP These restrictions make a server useless as a relay for clients that
functionality. Consequently, restricted-capability clients MUST NOT do not support full SMTP functionality. Consequently, restricted-
assume that any SMTP server on the Internet can be used as their mail capability clients MUST NOT assume that any SMTP server on the
processing (relaying) site. If a RCPT command appears without a Internet can be used as their mail processing (relaying) site. If a
previous MAIL command, the server MUST return a 503 "Bad sequence of RCPT command appears without a previous MAIL command, the server MUST
commands" response. The optional <rcpt-parameters> are associated return a 503 "Bad sequence of commands" response. The optional
with negotiated SMTP service extensions (see section 2.2). <rcpt-parameters> are associated with negotiated SMTP service
extensions (see Section 2.2).
Since it has been a common source of errors, it is worth noting that
spaces are not permitted on either side of the colon following FROM
in the MAIL command or TO in the RCPT command. The syntax is exactly
as given above.
The third step in the procedure is the DATA command (or some The third step in the procedure is the DATA command (or some
alternative specified in a service extension). alternative specified in a service extension).
DATA <CRLF> DATA <CRLF>
If accepted, the SMTP server returns a 354 Intermediate reply and If accepted, the SMTP server returns a 354 Intermediate reply and
considers all succeeding lines up to but not including the end of considers all succeeding lines up to but not including the end of
mail data indicator to be the message text. When the end of text is mail data indicator to be the message text. When the end of text is
successfully received and stored the SMTP-receiver sends a 250 OK successfully received and stored, the SMTP-receiver sends a 250 OK
reply. reply.
Since the mail data is sent on the transmission channel, the end of Since the mail data is sent on the transmission channel, the end of
mail data must be indicated so that the command and reply dialog can mail data must be indicated so that the command and reply dialog can
be resumed. SMTP indicates the end of the mail data by sending a be resumed. SMTP indicates the end of the mail data by sending a
line containing only a "." (period or full stop). A transparency line containing only a "." (period or full stop). A transparency
procedure is used to prevent this from interfering with the user's procedure is used to prevent this from interfering with the user's
text (see section 4.5.2). text (see Section 4.5.2).
The end of mail data indicator also confirms the mail transaction and The end of mail data indicator also confirms the mail transaction and
tells the SMTP server to now process the stored recipients and mail tells the SMTP server to now process the stored recipients and mail
data. If accepted, the SMTP server returns a 250 OK reply. The DATA data. If accepted, the SMTP server returns a 250 OK reply. The DATA
command can fail at only two points in the protocol exchange: command can fail at only two points in the protocol exchange:
- If there was no MAIL, or no RCPT, command, or all such commands If there was no MAIL, or no RCPT, command, or all such commands were
were rejected, the server MAY return a "command out of sequence" rejected, the server MAY return a "command out of sequence" (503) or
(503) or "no valid recipients" (554) reply in response to the DATA "no valid recipients" (554) reply in response to the DATA command.
command. If one of those replies (or any other 5yz reply) is If one of those replies (or any other 5yz reply) is received, the
received, the client MUST NOT send the message data; more client MUST NOT send the message data; more generally, message data
generally, message data MUST NOT be sent unless a 354 reply is MUST NOT be sent unless a 354 reply is received.
received.
- If the verb is initially accepted and the 354 reply issued, the If the verb is initially accepted and the 354 reply issued, the DATA
DATA command should fail only if the mail transaction was command should fail only if the mail transaction was incomplete (for
incomplete (for example, no recipients), or if resources were example, no recipients), or if resources were unavailable (including,
unavailable (including, of course, the server unexpectedly of course, the server unexpectedly becoming unavailable), or if the
becoming unavailable), or if the server determines that the server determines that the message should be rejected for policy or
message should be rejected for policy or other reasons. other reasons.
However, in practice, some servers do not perform recipient However, in practice, some servers do not perform recipient
verification until after the message text is received. These servers verification until after the message text is received. These servers
SHOULD treat a failure for one or more recipients as a "subsequent SHOULD treat a failure for one or more recipients as a "subsequent
failure" and return a mail message as discussed in section 6. Using failure" and return a mail message as discussed in Section 6 and, in
a "550 mailbox not found" (or equivalent) reply code after the data particular, in Section 6.1. Using a "550 mailbox not found" (or
are accepted makes it difficult or impossible for the client to equivalent) reply code after the data are accepted makes it difficult
determine which recipients failed. or impossible for the client to determine which recipients failed.
When RFC 822 format [7, 32] is being used, the mail data include the When RFC 822 format (RFC822 [16], RFC2822 [11]) is being used, the
memo header items such as Date, Subject, To, Cc, From. Server SMTP mail data include the header fields such as those named Date,
systems SHOULD NOT reject messages based on perceived defects in the Subject, To, Cc, From. Server SMTP systems SHOULD NOT reject
RFC 822 or MIME [12] message header or message body. In particular, messages based on perceived defects in the RFC 822 or MIME (RFC2045
they MUST NOT reject messages in which the numbers of Resent-fields [28]) message header section or message body. In particular, they
do not match or Resent-to appears without Resent-from and/or Resent- MUST NOT reject messages in which the numbers of Resent- header
date. fields do not match or Resent-to appears without Resent-from and/or
Resent-date.
Mail transaction commands MUST be used in the order discussed above. Mail transaction commands MUST be used in the order discussed above.
3.4 Forwarding for Address Correction or Updating 3.4. Forwarding for Address Correction or Updating
Forwarding support is most often required to consolidate and simplify Forwarding support is most often required to consolidate and simplify
addresses within, or relative to, some enterprise and less frequently addresses within, or relative to, some enterprise and less frequently
to establish addresses to link a person's prior address with current to establish addresses to link a person's prior address with a
one. Silent forwarding of messages (without server notification to current one. Silent forwarding of messages (without server
the sender), for security or non-disclosure purposes, is common in notification to the sender), for security or non-disclosure purposes,
the contemporary Internet. is common in the contemporary Internet.
In both the enterprise and the "new address" cases, information In both the enterprise and the "new address" cases, information
hiding (and sometimes security) considerations argue against exposure hiding (and sometimes security) considerations argue against exposure
of the "final" address through the SMTP protocol as a side-effect of of the "final" address through the SMTP protocol as a side-effect of
the forwarding activity. This may be especially important when the the forwarding activity. This may be especially important when the
final address may not even be reachable by the sender. Consequently, final address may not even be reachable by the sender. Consequently,
the "forwarding" mechanisms described in section 3.2 of RFC 821, and the "forwarding" mechanisms described in section 3.2 of RFC 821, and
especially the 251 (corrected destination) and 551 reply codes from especially the 251 (corrected destination) and 551 reply codes from
RCPT must be evaluated carefully by implementers and, when they are RCPT must be evaluated carefully by implementers and, when they are
available, by those configuring systems. available, by those configuring systems (see also Section 7.4).
In particular: In particular:
* Servers MAY forward messages when they are aware of an address o Servers MAY forward messages when they are aware of an address
change. When they do so, they MAY either provide address-updating change. When they do so, they MAY either provide address-updating
information with a 251 code, or may forward "silently" and return information with a 251 code, or may forward "silently" and return
a 250 code. But, if a 251 code is used, they MUST NOT assume that a 250 code. However, if a 251 code is used, they MUST NOT assume
the client will actually update address information or even return that the client will actually update address information or even
that information to the user. return that information to the user.
Alternately, Alternately,
* Servers MAY reject or bounce messages when they are not o Servers MAY reject messages or return them as nondeliverable when
deliverable when addressed. When they do so, they MAY either they cannot be delivered precisely as addressed. When they do so,
provide address-updating information with a 551 code, or may they MAY either provide address-updating information with a 551
reject the message as undeliverable with a 550 code and no code, or may reject the message as undeliverable with a 550 code
address-specific information. But, if a 551 code is used, they and no address-specific information. However, if a 551 code is
MUST NOT assume that the client will actually update address used, they MUST NOT assume that the client will actually update
information or even return that information to the user. address information or even return that information to the user.
SMTP server implementations that support the 251 and/or 551 reply SMTP server implementations that support the 251 and/or 551 reply
codes are strongly encouraged to provide configuration mechanisms so codes SHOULD provide configuration mechanisms so that sites which
that sites which conclude that they would undesirably disclose conclude that they would undesirably disclose information can disable
information can disable or restrict their use. or restrict their use.
3.5 Commands for Debugging Addresses 3.5. Commands for Debugging Addresses
3.5.1 Overview 3.5.1. Overview
SMTP provides commands to verify a user name or obtain the content of SMTP provides commands to verify a user name or obtain the content of
a mailing list. This is done with the VRFY and EXPN commands, which a mailing list. This is done with the VRFY and EXPN commands, which
have character string arguments. Implementations SHOULD support VRFY have character string arguments. Implementations SHOULD support VRFY
and EXPN (however, see section 3.5.2 and 7.3). and EXPN (however, see Section 3.5.2 and Section 7.3).
For the VRFY command, the string is a user name or a user name and For the VRFY command, the string is a user name or a user name and
domain (see below). If a normal (i.e., 250) response is returned, domain (see below). If a normal (i.e., 250) response is returned,
the response MAY include the full name of the user and MUST include the response MAY include the full name of the user and MUST include
the mailbox of the user. It MUST be in either of the following the mailbox of the user. It MUST be in either of the following
forms: forms:
User Name <local-part@domain> User Name <local-part@domain>
local-part@domain local-part@domain
When a name that is the argument to VRFY could identify more than one When a name that is the argument to VRFY could identify more than one
mailbox, the server MAY either note the ambiguity or identify the mailbox, the server MAY either note the ambiguity or identify the
alternatives. In other words, any of the following are legitimate alternatives. In other words, any of the following are legitimate
response to VRFY: responses to VRFY:
553 User ambiguous 553 User ambiguous
or or
553- Ambiguous; Possibilities are 553- Ambiguous; Possibilities are
553-Joe Smith <jsmith@foo.com> 553-Joe Smith <jsmith@foo.com>
553-Harry Smith <hsmith@foo.com> 553-Harry Smith <hsmith@foo.com>
553 Melvin Smith <dweep@foo.com> 553 Melvin Smith <dweep@foo.com>
or or
553-Ambiguous; Possibilities 553-Ambiguous; Possibilities
553- <jsmith@foo.com> 553- <jsmith@foo.com>
553- <hsmith@foo.com> 553- <hsmith@foo.com>
553 <dweep@foo.com> 553 <dweep@foo.com>
Under normal circumstances, a client receiving a 553 reply would be Under normal circumstances, a client receiving a 553 reply would be
expected to expose the result to the user. Use of exactly the forms expected to expose the result to the user. Use of exactly the forms
given, and the "user ambiguous" or "ambiguous" keywords, possibly given, and the "user ambiguous" or "ambiguous" keywords, possibly
supplemented by extended reply codes such as those described in [34], supplemented by extended reply codes such as those described in
will facilitate automated translation into other languages as needed. RFC3463 [37], will facilitate automated translation into other
Of course, a client that was highly automated or that was operating languages as needed. Of course, a client that was highly automated
in another language than English, might choose to try to translate or that was operating in another language than English, might choose
the response, to return some other indication to the user than the to try to translate the response, to return some other indication to
literal text of the reply, or to take some automated action such as the user than the literal text of the reply, or to take some
consulting a directory service for additional information before automated action such as consulting a directory service for
reporting to the user. additional information before reporting to the user.
For the EXPN command, the string identifies a mailing list, and the For the EXPN command, the string identifies a mailing list, and the
successful (i.e., 250) multiline response MAY include the full name successful (i.e., 250) multiline response MAY include the full name
of the users and MUST give the mailboxes on the mailing list. of the users and MUST give the mailboxes on the mailing list.
In some hosts the distinction between a mailing list and an alias for In some hosts the distinction between a mailing list and an alias for
a single mailbox is a bit fuzzy, since a common data structure may a single mailbox is a bit fuzzy, since a common data structure may
hold both types of entries, and it is possible to have mailing lists hold both types of entries, and it is possible to have mailing lists
containing only one mailbox. If a request is made to apply VRFY to a containing only one mailbox. If a request is made to apply VRFY to a
mailing list, a positive response MAY be given if a message so mailing list, a positive response MAY be given if a message so
skipping to change at page 22, line 15 skipping to change at page 25, line 42
The character string arguments of the VRFY and EXPN commands cannot The character string arguments of the VRFY and EXPN commands cannot
be further restricted due to the variety of implementations of the be further restricted due to the variety of implementations of the
user name and mailbox list concepts. On some systems it may be user name and mailbox list concepts. On some systems it may be
appropriate for the argument of the EXPN command to be a file name appropriate for the argument of the EXPN command to be a file name
for a file containing a mailing list, but again there are a variety for a file containing a mailing list, but again there are a variety
of file naming conventions in the Internet. Similarly, historical of file naming conventions in the Internet. Similarly, historical
variations in what is returned by these commands are such that the variations in what is returned by these commands are such that the
response SHOULD be interpreted very carefully, if at all, and SHOULD response SHOULD be interpreted very carefully, if at all, and SHOULD
generally only be used for diagnostic purposes. generally only be used for diagnostic purposes.
3.5.2 VRFY Normal Response 3.5.2. VRFY Normal Response
When normal (2yz or 551) responses are returned from a VRFY or EXPN When normal (2yz or 551) responses are returned from a VRFY or EXPN
request, the reply normally includes the mailbox name, i.e., request, the reply MUST include the <Mailbox> name using a
"<local-part@domain>", where "domain" is a fully qualified domain "<local-part@domain>" construction, where "domain" is a fully
name, MUST appear in the syntax. In circumstances exceptional enough qualified domain name. In circumstances exceptional enough to
to justify violating the intent of this specification, free-form text justify violating the intent of this specification, free-form text
MAY be returned. In order to facilitate parsing by both computers MAY be returned. In order to facilitate parsing by both computers
and people, addresses SHOULD appear in pointed brackets. When and people, addresses SHOULD appear in pointed brackets. When
addresses, rather than free-form debugging information, are returned, addresses, rather than free-form debugging information, are returned,
EXPN and VRFY MUST return only valid domain addresses that are usable EXPN and VRFY MUST return only valid domain addresses that are usable
in SMTP RCPT commands. Consequently, if an address implies delivery in SMTP RCPT commands. Consequently, if an address implies delivery
to a program or other system, the mailbox name used to reach that to a program or other system, the mailbox name used to reach that
target MUST be given. Paths (explicit source routes) MUST NOT be target MUST be given. Paths (explicit source routes) MUST NOT be
returned by VRFY or EXPN. returned by VRFY or EXPN.
Server implementations SHOULD support both VRFY and EXPN. For Server implementations SHOULD support both VRFY and EXPN. For
security reasons, implementations MAY provide local installations a security reasons, implementations MAY provide local installations a
way to disable either or both of these commands through configuration way to disable either or both of these commands through configuration
options or the equivalent. When these commands are supported, they options or the equivalent (see Section 7.3). When these commands are
are not required to work across relays when relaying is supported. supported, they are not required to work across relays when relaying
Since they were both optional in RFC 821, they MUST be listed as is supported. Since they were both optional in RFC 821, but VRFY was
service extensions in an EHLO response, if they are supported. made mandatory in RFC1123 [3], if EXPN is supported, it MUST be
listed as a service extension in an EHLO response. VRFY MAY be
listed as a convenience but, since support for it is required, SMTP
clients are not required to check for its presence on the extension
list before using it.
3.5.3 Meaning of VRFY or EXPN Success Response 3.5.3. Meaning of VRFY or EXPN Success Response
A server MUST NOT return a 250 code in response to a VRFY or EXPN A server MUST NOT return a 250 code in response to a VRFY or EXPN
command unless it has actually verified the address. In particular, command unless it has actually verified the address. In particular,
a server MUST NOT return 250 if all it has done is to verify that the a server MUST NOT return 250 if all it has done is to verify that the
syntax given is valid. In that case, 502 (Command not implemented) syntax given is valid. In that case, 502 (Command not implemented)
or 500 (Syntax error, command unrecognized) SHOULD be returned. As or 500 (Syntax error, command unrecognized) SHOULD be returned. As
stated elsewhere, implementation (in the sense of actually validating stated elsewhere, implementation (in the sense of actually validating
addresses and returning information) of VRFY and EXPN are strongly addresses and returning information) of VRFY and EXPN are strongly
recommended. Hence, implementations that return 500 or 502 for VRFY recommended. Hence, implementations that return 500 or 502 for VRFY
are not in full compliance with this specification. are not in full compliance with this specification.
There may be circumstances where an address appears to be valid but There may be circumstances where an address appears to be valid but
cannot reasonably be verified in real time, particularly when a cannot reasonably be verified in real time, particularly when a
server is acting as a mail exchanger for another server or domain. server is acting as a mail exchanger for another server or domain.
"Apparent validity" in this case would normally involve at least "Apparent validity" in this case would normally involve at least
syntax checking and might involve verification that any domains syntax checking and might involve verification that any domains
specified were ones to which the host expected to be able to relay specified were ones to which the host expected to be able to relay
mail. In these situations, reply code 252 SHOULD be returned. These mail. In these situations, reply code 252 SHOULD be returned. These
cases parallel the discussion of RCPT verification discussed in cases parallel the discussion of RCPT verification discussed in
section 2.1. Similarly, the discussion in section 3.4 applies to the Section 2.1. Similarly, the discussion in Section 3.4 applies to the
use of reply codes 251 and 551 with VRFY (and EXPN) to indicate use of reply codes 251 and 551 with VRFY (and EXPN) to indicate
addresses that are recognized but that would be forwarded or bounced addresses that are recognized but that would be forwarded or rejected
were mail received for them. Implementations generally SHOULD be were mail received for them. Implementations generally SHOULD be
more aggressive about address verification in the case of VRFY than more aggressive about address verification in the case of VRFY than
in the case of RCPT, even if it takes a little longer to do so. in the case of RCPT, even if it takes a little longer to do so.
3.5.4 Semantics and Applications of EXPN 3.5.4. Semantics and Applications of EXPN
EXPN is often very useful in debugging and understanding problems EXPN is often very useful in debugging and understanding problems
with mailing lists and multiple-target-address aliases. Some systems with mailing lists and multiple-target-address aliases. Some systems
have attempted to use source expansion of mailing lists as a means of have attempted to use source expansion of mailing lists as a means of
eliminating duplicates. The propagation of aliasing systems with eliminating duplicates. The propagation of aliasing systems with
mail on the Internet, for hosts (typically with MX and CNAME DNS mail on the Internet, for hosts (typically with MX and CNAME DNS
records), for mailboxes (various types of local host aliases), and in records), for mailboxes (various types of local host aliases), and in
various proxying arrangements, has made it nearly impossible for various proxying arrangements, has made it nearly impossible for
these strategies to work consistently, and mail systems SHOULD NOT these strategies to work consistently, and mail systems SHOULD NOT
attempt them. attempt them.
3.6 Domains 3.6. Relaying and Mail Routing
Only resolvable, fully-qualified, domain names (FQDNs) are permitted
when domain names are used in SMTP. In other words, names that can
be resolved to MX RRs or A RRs (as discussed in section 5) are
permitted, as are CNAME RRs whose targets can be resolved, in turn,
to MX or A RRs. Local nicknames or unqualified names MUST NOT be
used. There are two exceptions to the rule requiring FQDNs:
- The domain name given in the EHLO command MUST BE either a primary
host name (a domain name that resolves to an A RR) or, if the host
has no name, an address literal as described in section 4.1.1.1.
- The reserved mailbox name "postmaster" may be used in a RCPT
command without domain qualification (see section 4.1.1.3) and
MUST be accepted if so used.
3.7 Relaying 3.6.1. Source Routes and Relaying
In general, the availability of Mail eXchanger records in the domain In general, the availability of Mail eXchanger records in the domain
name system [22, 27] makes the use of explicit source routes in the name system (RFC1035 [7], RFC974 [19]) makes the use of explicit
Internet mail system unnecessary. Many historical problems with source routes in the Internet mail system unnecessary. Many
their interpretation have made their use undesirable. SMTP clients historical problems with the interpretation of explicit source routes
SHOULD NOT generate explicit source routes except under unusual have made their use undesirable. SMTP clients SHOULD NOT generate
circumstances. SMTP servers MAY decline to act as mail relays or to explicit source routes except under unusual circumstances. SMTP
accept addresses that specify source routes. When route information servers MAY decline to act as mail relays or to accept addresses that
is encountered, SMTP servers are also permitted to ignore the route specify source routes. When route information is encountered, SMTP
information and simply send to the final destination specified as the servers MAY ignore the route information and simply send to the final
last element in the route and SHOULD do so. There has been an destination specified as the last element in the route and SHOULD do
invalid practice of using names that do not appear in the DNS as so. There has been an invalid practice of using names that do not
destination names, with the senders counting on the intermediate appear in the DNS as destination names, with the senders counting on
hosts specified in source routing to resolve any problems. If source the intermediate hosts specified in source routing to resolve any
routes are stripped, this practice will cause failures. This is one problems. If source routes are stripped, this practice will cause
of several reasons why SMTP clients MUST NOT generate invalid source failures. This is one of several reasons why SMTP clients MUST NOT
routes or depend on serial resolution of names. generate invalid source routes or depend on serial resolution of
names.
When source routes are not used, the process described in RFC 821 for When source routes are not used, the process described in RFC 821 for
constructing a reverse-path from the forward-path is not applicable constructing a reverse-path from the forward-path is not applicable
and the reverse-path at the time of delivery will simply be the and the reverse-path at the time of delivery will simply be the
address that appeared in the MAIL command. address that appeared in the MAIL command.
3.6.2. Mail eXchange Records and Relaying
A relay SMTP server is usually the target of a DNS MX record that A relay SMTP server is usually the target of a DNS MX record that
designates it, rather than the final delivery system. The relay designates it, rather than the final delivery system. The relay
server may accept or reject the task of relaying the mail in the same server may accept or reject the task of relaying the mail in the same
way it accepts or rejects mail for a local user. If it accepts the way it accepts or rejects mail for a local user. If it accepts the
task, it then becomes an SMTP client, establishes a transmission task, it then becomes an SMTP client, establishes a transmission
channel to the next SMTP server specified in the DNS (according to channel to the next SMTP server specified in the DNS (according to
the rules in section 5), and sends it the mail. If it declines to the rules in Section 5), and sends it the mail. If it declines to
relay mail to a particular address for policy reasons, a 550 response relay mail to a particular address for policy reasons, a 550 response
SHOULD be returned. SHOULD be returned.
This specification does not deal with the verification of return
paths for use in delivery notifications. Recent work, such as that
on SPF [41] and DKIM [43] [44], has been done to provide ways to
ascertain that an address is valid or belongs to the person who
actually sent the message. A server MAY attempt to verify the return
path before using its address for delivery notifications, but methods
of doing so are not defined here nor is any particular method
recommended at this time.
3.6.3. Message Submission Servers as Relays
Many mail-sending clients exist, especially in conjunction with Many mail-sending clients exist, especially in conjunction with
facilities that receive mail via POP3 or IMAP, that have limited facilities that receive mail via POP3 or IMAP, that have limited
capability to support some of the requirements of this specification, capability to support some of the requirements of this specification,
such as the ability to queue messages for subsequent delivery such as the ability to queue messages for subsequent delivery
attempts. For these clients, it is common practice to make private attempts. For these clients, it is common practice to make private
arrangements to send all messages to a single server for processing arrangements to send all messages to a single server for processing
and subsequent distribution. SMTP, as specified here, is not ideally and subsequent distribution. SMTP, as specified here, is not ideally
suited for this role, and work is underway on standardized mail suited for this role. A standardized mail submission protocol has
submission protocols that might eventually supercede the current been developed that is gradually superseding practices based on SMTP
practices. In any event, because these arrangements are private and (see RFC4409 [42]). In any event, because these arrangements are
fall outside the scope of this specification, they are not described private and fall outside the scope of this specification, they are
here. not described here.
It is important to note that MX records can point to SMTP servers It is important to note that MX records can point to SMTP servers
which act as gateways into other environments, not just SMTP relays which act as gateways into other environments, not just SMTP relays
and final delivery systems; see sections 3.8 and 5. and final delivery systems; see sections Section 3.7 and Section 5.
If an SMTP server has accepted the task of relaying the mail and If an SMTP server has accepted the task of relaying the mail and
later finds that the destination is incorrect or that the mail cannot later finds that the destination is incorrect or that the mail cannot
be delivered for some other reason, then it MUST construct an be delivered for some other reason, then it MUST construct an
"undeliverable mail" notification message and send it to the "undeliverable mail" notification message and send it to the
originator of the undeliverable mail (as indicated by the reverse- originator of the undeliverable mail (as indicated by the reverse-
path). Formats specified for non-delivery reports by other standards path). Formats specified for non-delivery reports by other standards
(see, for example, [24, 25]) SHOULD be used if possible. (see, for example, RFC3461 [12] and RFC3464 [13]) SHOULD be used if
possible.
This notification message must be from the SMTP server at the relay This notification message must be from the SMTP server at the relay
host or the host that first determines that delivery cannot be host or the host that first determines that delivery cannot be
accomplished. Of course, SMTP servers MUST NOT send notification accomplished. Of course, SMTP servers MUST NOT send notification
messages about problems transporting notification messages. One way messages about problems transporting notification messages. One way
to prevent loops in error reporting is to specify a null reverse-path to prevent loops in error reporting is to specify a null reverse-path
in the MAIL command of a notification message. When such a message in the MAIL command of a notification message. When such a message
is transmitted the reverse-path MUST be set to null (see section is transmitted the reverse-path MUST be set to null (see
4.5.5 for additional discussion). A MAIL command with a null Section 4.5.5 for additional discussion). A MAIL command with a null
reverse-path appears as follows: reverse-path appears as follows:
MAIL FROM:<> MAIL FROM:<>
As discussed in section 2.4.1, a relay SMTP has no need to inspect or As discussed in Section 6.4, a relay SMTP has no need to inspect or
act upon the headers or body of the message data and MUST NOT do so act upon the header section or body of the message data and MUST NOT
except to add its own "Received:" header (section 4.4) and, do so except to add its own "Received:" header field (Section 4.4)
optionally, to attempt to detect looping in the mail system (see and, optionally, to attempt to detect looping in the mail system (see
section 6.2). Section 6.3). Of course this prohibition also applies to any
modifications of these header fields or text (see also Section 7.9).
3.8 Mail Gatewaying 3.7. Mail Gatewaying
While the relay function discussed above operates within the Internet While the relay function discussed above operates within the Internet
SMTP transport service environment, MX records or various forms of SMTP transport service environment, MX records or various forms of
explicit routing may require that an intermediate SMTP server perform explicit routing may require that an intermediate SMTP server perform
a translation function between one transport service and another. As a translation function between one transport service and another. As
discussed in section 2.3.8, when such a system is at the boundary discussed in Section 2.3.10, when such a system is at the boundary
between two transport service environments, we refer to it as a between two transport service environments, we refer to it as a
"gateway" or "gateway SMTP". "gateway" or "gateway SMTP".
Gatewaying mail between different mail environments, such as Gatewaying mail between different mail environments, such as
different mail formats and protocols, is complex and does not easily different mail formats and protocols, is complex and does not easily
yield to standardization. However, some general requirements may be yield to standardization. However, some general requirements may be
given for a gateway between the Internet and another mail given for a gateway between the Internet and another mail
environment. environment.
3.8.1 Header Fields in Gatewaying 3.7.1. Header Fields in Gatewaying
Header fields MAY be rewritten when necessary as messages are Header fields MAY be rewritten when necessary as messages are
gatewayed across mail environment boundaries. This may involve gatewayed across mail environment boundaries. This may involve
inspecting the message body or interpreting the local-part of the inspecting the message body or interpreting the local-part of the
destination address in spite of the prohibitions in section 2.4.1. destination address in spite of the prohibitions in Section 6.4.
Other mail systems gatewayed to the Internet often use a subset of Other mail systems gatewayed to the Internet often use a subset of
RFC 822 headers or provide similar functionality with a different the RFC 822 header section or provide similar functionality with a
syntax, but some of these mail systems do not have an equivalent to different syntax, but some of these mail systems do not have an
the SMTP envelope. Therefore, when a message leaves the Internet equivalent to the SMTP envelope. Therefore, when a message leaves
environment, it may be necessary to fold the SMTP envelope the Internet environment, it may be necessary to fold the SMTP
information into the message header. A possible solution would be to envelope information into the message header section. A possible
create new header fields to carry the envelope information (e.g., solution would be to create new header fields to carry the envelope
"X-SMTP-MAIL:" and "X-SMTP-RCPT:"); however, this would require information (e.g., "X-SMTP-MAIL:" and "X-SMTP-RCPT:"); however, this
changes in mail programs in foreign environments and might risk would require changes in mail programs in foreign environments and
disclosure of private information (see section 7.2). might risk disclosure of private information (see Section 7.2).
3.8.2 Received Lines in Gatewaying 3.7.2. Received Lines in Gatewaying
When forwarding a message into or out of the Internet environment, a When forwarding a message into or out of the Internet environment, a
gateway MUST prepend a Received: line, but it MUST NOT alter in any gateway MUST prepend a Received: line, but it MUST NOT alter in any
way a Received: line that is already in the header. way a Received: line that is already in the header section.
"Received:" fields of messages originating from other environments "Received:" header fields of messages originating from other
may not conform exactly to this specification. However, the most environments may not conform exactly to this specification. However,
important use of Received: lines is for debugging mail faults, and the most important use of Received: lines is for debugging mail
this debugging can be severely hampered by well-meaning gateways that faults, and this debugging can be severely hampered by well-meaning
try to "fix" a Received: line. As another consequence of trace gateways that try to "fix" a Received: line. As another consequence
fields arising in non-SMTP environments, receiving systems MUST NOT of trace header fields arising in non-SMTP environments, receiving
reject mail based on the format of a trace field and SHOULD be systems MUST NOT reject mail based on the format of a trace header
extremely robust in the light of unexpected information or formats in field and SHOULD be extremely robust in the light of unexpected
those fields. information or formats in those header fields.
The gateway SHOULD indicate the environment and protocol in the "via" The gateway SHOULD indicate the environment and protocol in the "via"
clauses of Received field(s) that it supplies. clauses of Received header field(s) that it supplies.
3.8.3 Addresses in Gatewaying 3.7.3. Addresses in Gatewaying
From the Internet side, the gateway SHOULD accept all valid address From the Internet side, the gateway SHOULD accept all valid address
formats in SMTP commands and in RFC 822 headers, and all valid RFC formats in SMTP commands and in the RFC 822 header section, and all
822 messages. Addresses and headers generated by gateways MUST valid RFC 822 messages. Addresses and header fields generated by
conform to applicable Internet standards (including this one and RFC gateways MUST conform to applicable Internet standards (including
822). Gateways are, of course, subject to the same rules for this one and RFC 822). Gateways are, of course, subject to the same
handling source routes as those described for other SMTP systems in rules for handling source routes as those described for other SMTP
section 3.3. systems in Section 3.3.
3.8.4 Other Header Fields in Gatewaying 3.7.4. Other Header Fields in Gatewaying
The gateway MUST ensure that all header fields of a message that it The gateway MUST ensure that all header fields of a message that it
forwards into the Internet mail environment meet the requirements for forwards into the Internet mail environment meet the requirements for
Internet mail. In particular, all addresses in "From:", "To:", Internet mail. In particular, all addresses in "From:", "To:",
"Cc:", etc., fields MUST be transformed (if necessary) to satisfy RFC "Cc:", etc., header fields MUST be transformed (if necessary) to
822 syntax, MUST reference only fully-qualified domain names, and satisfy the standard header syntax of RFC 2822 [11], MUST reference
MUST be effective and useful for sending replies. The translation only fully-qualified domain names, and MUST be effective and useful
algorithm used to convert mail from the Internet protocols to another for sending replies. The translation algorithm used to convert mail
environment's protocol SHOULD ensure that error messages from the from the Internet protocols to another environment's protocol SHOULD
foreign mail environment are delivered to the return path from the ensure that error messages from the foreign mail environment are
SMTP envelope, not to the sender listed in the "From:" field (or delivered to the reverse path from the SMTP envelope, not to an
other fields) of the RFC 822 message. address in the "From:", "Sender:", or similar header fields of the
message.
3.8.5 Envelopes in Gatewaying 3.7.5. Envelopes in Gatewaying
Similarly, when forwarding a message from another environment into Similarly, when forwarding a message from another environment into
the Internet, the gateway SHOULD set the envelope return path in the Internet, the gateway SHOULD set the envelope return path in
accordance with an error message return address, if supplied by the accordance with an error message return address, if supplied by the
foreign environment. If the foreign environment has no equivalent foreign environment. If the foreign environment has no equivalent
concept, the gateway must select and use a best approximation, with concept, the gateway must select and use a best approximation, with
the message originator's address as the default of last resort. the message originator's address as the default of last resort.
3.9 Terminating Sessions and Connections 3.8. Terminating Sessions and Connections
An SMTP connection is terminated when the client sends a QUIT An SMTP connection is terminated when the client sends a QUIT
command. The server responds with a positive reply code, after which command. The server responds with a positive reply code, after which
it closes the connection. it closes the connection.
An SMTP server MUST NOT intentionally close the connection except: An SMTP server MUST NOT intentionally close the connection under
normal operational circumstances (see Section 7.8) except:
- After receiving a QUIT command and responding with a 221 reply. o After receiving a QUIT command and responding with a 221 reply.
- After detecting the need to shut down the SMTP service and o After detecting the need to shut down the SMTP service and
returning a 421 response code. This response code can be issued returning a 421 response code. This response code can be issued
after the server receives any command or, if necessary, after the server receives any command or, if necessary,
asynchronously from command receipt (on the assumption that the asynchronously from command receipt (on the assumption that the
client will receive it after the next command is issued). client will receive it after the next command is issued).
o After a timeout, as specified in Section 4.5.3.2, occurs waiting
for the client to send a command or data.
In particular, a server that closes connections in response to In particular, a server that closes connections in response to
commands that are not understood is in violation of this commands that are not understood is in violation of this
specification. Servers are expected to be tolerant of unknown specification. Servers are expected to be tolerant of unknown
commands, issuing a 500 reply and awaiting further instructions from commands, issuing a 500 reply and awaiting further instructions from
the client. the client.
An SMTP server which is forcibly shut down via external means SHOULD An SMTP server which is forcibly shut down via external means SHOULD
attempt to send a line containing a 421 response code to the SMTP attempt to send a line containing a 421 response code to the SMTP
client before exiting. The SMTP client will normally read the 421 client before exiting. The SMTP client will normally read the 421
response code after sending its next command. response code after sending its next command.
SMTP clients that experience a connection close, reset, or other SMTP clients that experience a connection close, reset, or other
communications failure due to circumstances not under their control communications failure due to circumstances not under their control
(in violation of the intent of this specification but sometimes (in violation of the intent of this specification but sometimes
unavoidable) SHOULD, to maintain the robustness of the mail system, unavoidable) SHOULD, to maintain the robustness of the mail system,
treat the mail transaction as if a 451 response had been received and treat the mail transaction as if a 451 response had been received and
act accordingly. act accordingly.
3.10 Mailing Lists and Aliases 3.9. Mailing Lists and Aliases
An SMTP-capable host SHOULD support both the alias and the list An SMTP-capable host SHOULD support both the alias and the list
models of address expansion for multiple delivery. When a message is models of address expansion for multiple delivery. When a message is
delivered or forwarded to each address of an expanded list form, the delivered or forwarded to each address of an expanded list form, the
return address in the envelope ("MAIL FROM:") MUST be changed to be return address in the envelope ("MAIL FROM:") MUST be changed to be
the address of a person or other entity who administers the list. the address of a person or other entity who administers the list.
However, in this case, the message header [32] MUST be left However, in this case, the message header section (RFC2822 [11]) MUST
unchanged; in particular, the "From" field of the message header is be left unchanged; in particular, the "From" field of the header
unaffected. section is unaffected.
An important mail facility is a mechanism for multi-destination An important mail facility is a mechanism for multi-destination
delivery of a single message, by transforming (or "expanding" or delivery of a single message, by transforming (or "expanding" or
"exploding") a pseudo-mailbox address into a list of destination "exploding") a pseudo-mailbox address into a list of destination
mailbox addresses. When a message is sent to such a pseudo-mailbox mailbox addresses. When a message is sent to such a pseudo-mailbox
(sometimes called an "exploder"), copies are forwarded or (sometimes called an "exploder"), copies are forwarded or
redistributed to each mailbox in the expanded list. Servers SHOULD redistributed to each mailbox in the expanded list. Servers SHOULD
simply utilize the addresses on the list; application of heuristics simply utilize the addresses on the list; application of heuristics
or other matching rules to eliminate some addresses, such as that of or other matching rules to eliminate some addresses, such as that of
the originator, is strongly discouraged. We classify such a pseudo- the originator, is strongly discouraged. We classify such a pseudo-
mailbox as an "alias" or a "list", depending upon the expansion mailbox as an "alias" or a "list", depending upon the expansion
rules. rules.
3.10.1 Alias 3.9.1. Alias
To expand an alias, the recipient mailer simply replaces the pseudo- To expand an alias, the recipient mailer simply replaces the pseudo-
mailbox address in the envelope with each of the expanded addresses mailbox address in the envelope with each of the expanded addresses
in turn; the rest of the envelope and the message body are left in turn; the rest of the envelope and the message body are left
unchanged. The message is then delivered or forwarded to each unchanged. The message is then delivered or forwarded to each
expanded address. expanded address.
3.10.2 List 3.9.2. List
A mailing list may be said to operate by "redistribution" rather than A mailing list may be said to operate by "redistribution" rather than
by "forwarding". To expand a list, the recipient mailer replaces the by "forwarding". To expand a list, the recipient mailer replaces the
pseudo-mailbox address in the envelope with all of the expanded pseudo-mailbox address in the envelope with each of the expanded
addresses. The return address in the envelope is changed so that all addresses in turn. The return (backward-pointing) address in the
error messages generated by the final deliveries will be returned to envelope is changed so that all error messages generated by the final
a list administrator, not to the message originator, who generally deliveries will be returned to a list administrator, not to the
has no control over the contents of the list and will typically find message originator, who generally has no control over the contents of
error messages annoying. the list and will typically find error messages annoying. Note that
the key difference between handling aliases (Section 3.9.1) and
forwarding (this subsection) is the change to the backward-pointing
address in this case. When a list constrains its processing to the
very limited set of modifications and actions described here, it is
attempting to emulate an MTA; such lists can be treated as a
continuation in email transit.
There exist mailing lists that perform additional, sometimes
extensive, modifications to a message and its envelope. Such mailing
lists need to be viewed as full MUAs, which accept a delivery and
post a new message.
4. The SMTP Specifications 4. The SMTP Specifications
4.1 SMTP Commands 4.1. SMTP Commands
4.1.1 Command Semantics and Syntax 4.1.1. Command Semantics and Syntax
The SMTP commands define the mail transfer or the mail system The SMTP commands define the mail transfer or the mail system
function requested by the user. SMTP commands are character strings function requested by the user. SMTP commands are character strings
terminated by <CRLF>. The commands themselves are alphabetic terminated by <CRLF>. The commands themselves are alphabetic
characters terminated by <SP> if parameters follow and <CRLF> characters terminated by <SP> if parameters follow and <CRLF>
otherwise. (In the interest of improved interoperability, SMTP otherwise. (In the interest of improved interoperability, SMTP
receivers are encouraged to tolerate trailing white space before the receivers are SHOULD tolerate trailing white space before the
terminating <CRLF>.) The syntax of the local part of a mailbox must terminating <CRLF>.) The syntax of the local part of a mailbox MUST
conform to receiver site conventions and the syntax specified in conform to receiver site conventions and the syntax specified in
section 4.1.2. The SMTP commands are discussed below. The SMTP Section 4.1.2. The SMTP commands are discussed below. The SMTP
replies are discussed in section 4.2. replies are discussed in Section 4.2.
A mail transaction involves several data objects which are A mail transaction involves several data objects which are
communicated as arguments to different commands. The reverse-path is communicated as arguments to different commands. The reverse-path is
the argument of the MAIL command, the forward-path is the argument of the argument of the MAIL command, the forward-path is the argument of
the RCPT command, and the mail data is the argument of the DATA the RCPT command, and the mail data is the argument of the DATA
command. These arguments or data objects must be transmitted and command. These arguments or data objects must be transmitted and
held pending the confirmation communicated by the end of mail data held pending the confirmation communicated by the end of mail data
indication which finalizes the transaction. The model for this is indication which finalizes the transaction. The model for this is
that distinct buffers are provided to hold the types of data objects, that distinct buffers are provided to hold the types of data objects,
that is, there is a reverse-path buffer, a forward-path buffer, and a that is, there is a reverse-path buffer, a forward-path buffer, and a
mail data buffer. Specific commands cause information to be appended mail data buffer. Specific commands cause information to be appended
to a specific buffer, or cause one or more buffers to be cleared. to a specific buffer, or cause one or more buffers to be cleared.
Several commands (RSET, DATA, QUIT) are specified as not permitting Several commands (RSET, DATA, QUIT) are specified as not permitting
parameters. In the absence of specific extensions offered by the parameters. In the absence of specific extensions offered by the
server and accepted by the client, clients MUST NOT send such server and accepted by the client, clients MUST NOT send such
parameters and servers SHOULD reject commands containing them as parameters and servers SHOULD reject commands containing them as
having invalid syntax. having invalid syntax.
4.1.1.1 Extended HELLO (EHLO) or HELLO (HELO) 4.1.1.1. Extended HELLO (EHLO) or HELLO (HELO)
These commands are used to identify the SMTP client to the SMTP These commands are used to identify the SMTP client to the SMTP
server. The argument field contains the fully-qualified domain name server. The argument clause contains the fully-qualified domain name
of the SMTP client if one is available. In situations in which the of the SMTP client if one is available. In situations in which the
SMTP client system does not have a meaningful domain name (e.g., when SMTP client system does not have a meaningful domain name (e.g., when
its address is dynamically allocated and no reverse mapping record is its address is dynamically allocated and no reverse mapping record is
available), the client SHOULD send an address literal (see section available), the client SHOULD send an address literal (see
4.1.3), optionally followed by information that will help to identify Section 4.1.3).
the client system. y The SMTP server identifies itself to the SMTP
client in the connection greeting reply and in the response to this RFC2821, and some earlier informal practices, encouraged following
command. the literal by information that would help to identify the client
system. That convention was not widely supported and many SMTP
servers considered it an error. In the interest of interoperability,
it is probably wise for servers to be prepared for this string to
occur, but SMTP clients SHOULD NOT send it.
The SMTP server identifies itself to the SMTP client in the
connection greeting reply and in the response to this command.
A client SMTP SHOULD start an SMTP session by issuing the EHLO A client SMTP SHOULD start an SMTP session by issuing the EHLO
command. If the SMTP server supports the SMTP service extensions it command. If the SMTP server supports the SMTP service extensions it
will give a successful response, a failure response, or an error will give a successful response, a failure response, or an error
response. If the SMTP server, in violation of this specification, response. If the SMTP server, in violation of this specification,
does not support any SMTP service extensions it will generate an does not support any SMTP service extensions it will generate an
error response. Older client SMTP systems MAY, as discussed above, error response. Older client SMTP systems MAY, as discussed above,
use HELO (as specified in RFC 821) instead of EHLO, and servers MUST use HELO (as specified in RFC 821) instead of EHLO, and servers MUST
support the HELO command and reply properly to it. In any event, a support the HELO command and reply properly to it. In any event, a
client MUST issue HELO or EHLO before starting a mail transaction. client MUST issue HELO or EHLO before starting a mail transaction.
These commands, and a "250 OK" reply to one of them, confirm that These commands, and a "250 OK" reply to one of them, confirm that
both the SMTP client and the SMTP server are in the initial state, both the SMTP client and the SMTP server are in the initial state,
that is, there is no transaction in progress and all state tables and that is, there is no transaction in progress and all state tables and
buffers are cleared. buffers are cleared.
Syntax: Syntax:
ehlo = "EHLO" SP Domain CRLF ehlo = "EHLO" SP ( Domain / address-literal ) CRLF
helo = "HELO" SP Domain CRLF helo = "HELO" SP Domain CRLF
Normally, the response to EHLO will be a multiline reply. Each line Normally, the response to EHLO will be a multiline reply. Each line
of the response contains a keyword and, optionally, one or more of the response contains a keyword and, optionally, one or more
parameters. Following the normal syntax for multiline replies, these parameters. Following the normal syntax for multiline replies, these
keyworks follow the code (250) and a hyphen for all but the last keywords follow the code (250) and a hyphen for all but the last
line, and the code and a space for the last line. The syntax for a line, and the code and a space for the last line. The syntax for a
positive response, using the ABNF notation and terminal symbols of positive response, using the ABNF notation and terminal symbols of
[8], is: RFC 5234 [5], is:
ehlo-ok-rsp = ( "250" domain [ SP ehlo-greet ] CRLF ) ehlo-ok-rsp = ( "250" SP Domain [ SP ehlo-greet ] CRLF )
/ ( "250-" domain [ SP ehlo-greet ] CRLF / ( "250-" Domain [ SP ehlo-greet ] CRLF
*( "250-" ehlo-line CRLF ) *( "250-" ehlo-line CRLF )
"250" SP ehlo-line CRLF ) "250" SP ehlo-line CRLF )
ehlo-greet = 1*(%d0-9 / %d11-12 / %d14-127) ehlo-greet = 1*(%d0-9 / %d11-12 / %d14-127)
; string of any characters other than CR or LF ; string of any characters other than CR or LF
ehlo-line = ehlo-keyword *( SP ehlo-param ) ehlo-line = ehlo-keyword *( SP ehlo-param )
ehlo-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-") ehlo-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")
; additional syntax of ehlo-params depends on ; additional syntax of ehlo-params depends on
; ehlo-keyword ; ehlo-keyword
ehlo-param = 1*(%d33-127)
ehlo-param = 1*(%d33-126)
; any CHAR excluding <SP> and all ; any CHAR excluding <SP> and all
; control characters (US-ASCII 0-31 inclusive) ; control characters (US-ASCII 0-31 and 127
inclusive)
Although EHLO keywords may be specified in upper, lower, or mixed Although EHLO keywords may be specified in upper, lower, or mixed
case, they MUST always be recognized and processed in a case- case, they MUST always be recognized and processed in a case-
insensitive manner. This is simply an extension of practices insensitive manner. This is simply an extension of practices
specified in RFC 821 and section 2.4.1. specified in RFC 821 and Section 2.4.
4.1.1.2 MAIL (MAIL) The EHLO response MUST contain keywords (and associated parameters if
required) for all commands not listed as "required" in Section 4.5.1
excepting only private-use commands as described in Section 4.1.5.
Private-use commands MAY be listed.
4.1.1.2. MAIL (MAIL)
This command is used to initiate a mail transaction in which the mail This command is used to initiate a mail transaction in which the mail
data is delivered to an SMTP server which may, in turn, deliver it to data is delivered to an SMTP server which may, in turn, deliver it to
one or more mailboxes or pass it on to another system (possibly using one or more mailboxes or pass it on to another system (possibly using
SMTP). The argument field contains a reverse-path and may contain SMTP). The argument clause contains a reverse-path and may contain
optional parameters. In general, the MAIL command may be sent only optional parameters. In general, the MAIL command may be sent only
when no mail transaction is in progress, see section 4.1.4. when no mail transaction is in progress, see Section 4.1.4.
The reverse-path consists of the sender mailbox. Historically, that The reverse-path consists of the sender mailbox. Historically, that
mailbox might optionally have been preceded by a list of hosts, but mailbox might optionally have been preceded by a list of hosts, but
that behavior is now deprecated (see appendix C). In some types of that behavior is now deprecated (see Appendix C). In some types of
reporting messages for which a reply is likely to cause a mail loop reporting messages for which a reply is likely to cause a mail loop
(for example, mail delivery and nondelivery notifications), the (for example, mail delivery and nondelivery notifications), the
reverse-path may be null (see section 3.7). reverse-path may be null (see Section 3.6).
This command clears the reverse-path buffer, the forward-path buffer, This command clears the reverse-path buffer, the forward-path buffer,
and the mail data buffer; and inserts the reverse-path information and the mail data buffer; and inserts the reverse-path information
from this command into the reverse-path buffer. from this command into the reverse-path buffer.
If service extensions were negotiated, the MAIL command may also If service extensions were negotiated, the MAIL command may also
carry parameters associated with a particular service extension. carry parameters associated with a particular service extension.
Syntax: Syntax:
"MAIL FROM:" ("<>" / Reverse-Path) mail = "MAIL FROM:" Reverse-path
[SP Mail-parameters] CRLF [SP Mail-parameters] CRLF
4.1.1.3 RECIPIENT (RCPT) 4.1.1.3. RECIPIENT (RCPT)
This command is used to identify an individual recipient of the mail This command is used to identify an individual recipient of the mail
data; multiple recipients are specified by multiple use of this data; multiple recipients are specified by multiple use of this
command. The argument field contains a forward-path and may contain command. The argument clause contains a forward-path and may contain
optional parameters. optional parameters.
The forward-path normally consists of the required destination The forward-path normally consists of the required destination
mailbox. Sending systems SHOULD not generate the optional list of mailbox. Sending systems SHOULD NOT generate the optional list of
hosts known as a source route. Receiving systems MUST recognize hosts known as a source route. Receiving systems MUST recognize
source route syntax but SHOULD strip off the source route source route syntax but SHOULD strip off the source route
specification and utilize the domain name associated with the mailbox specification and utilize the domain name associated with the mailbox
as if the source route had not been provided. as if the source route had not been provided.
Similarly, relay hosts SHOULD strip or ignore source routes, and Similarly, relay hosts SHOULD strip or ignore source routes, and
names MUST NOT be copied into the reverse-path. When mail reaches names MUST NOT be copied into the reverse-path. When mail reaches
its ultimate destination (the forward-path contains only a its ultimate destination (the forward-path contains only a
destination mailbox), the SMTP server inserts it into the destination destination mailbox), the SMTP server inserts it into the destination
mailbox in accordance with its host mail conventions. mailbox in accordance with its host mail conventions.
This command appends its forward-path argument to the forward-path
buffer; it does not change the reverse-path buffer nor the mail data
buffer.
For example, mail received at relay host xyz.com with envelope For example, mail received at relay host xyz.com with envelope
commands commands
MAIL FROM:<userx@y.foo.org> MAIL FROM:<userx@y.foo.org>
RCPT TO:<@hosta.int,@jkl.org:userc@d.bar.org> RCPT TO:<@hosta.int,@jkl.org:userc@d.bar.org>
will normally be sent directly on to host d.bar.org with envelope will normally be sent directly on to host d.bar.org with envelope
commands commands
MAIL FROM:<userx@y.foo.org> MAIL FROM:<userx@y.foo.org>
RCPT TO:<userc@d.bar.org> RCPT TO:<userc@d.bar.org>
As provided in appendix C, xyz.com MAY also choose to relay the As provided in Appendix C, xyz.com MAY also choose to relay the
message to hosta.int, using the envelope commands message to hosta.int, using the envelope commands
MAIL FROM:<userx@y.foo.org> MAIL FROM:<userx@y.foo.org>
RCPT TO:<@hosta.int,@jkl.org:userc@d.bar.org> RCPT TO:<@hosta.int,@jkl.org:userc@d.bar.org>
or to jkl.org, using the envelope commands or to jkl.org, using the envelope commands
MAIL FROM:<userx@y.foo.org> MAIL FROM:<userx@y.foo.org>
RCPT TO:<@jkl.org:userc@d.bar.org> RCPT TO:<@jkl.org:userc@d.bar.org>
Of course, since hosts are not required to relay mail at all, xyz.com Attempting to use relaying this way is now strongly discouraged.
may also reject the message entirely when the RCPT command is
received, using a 550 code (since this is a "policy reason"). Since hosts are not required to relay mail at all, xyz.com MAY also
reject the message entirely when the RCPT command is received, using
a 550 code (since this is a "policy reason").
If service extensions were negotiated, the RCPT command may also If service extensions were negotiated, the RCPT command may also
carry parameters associated with a particular service extension carry parameters associated with a particular service extension
offered by the server. The client MUST NOT transmit parameters other offered by the server. The client MUST NOT transmit parameters other
than those associated with a service extension offered by the server than those associated with a service extension offered by the server
in its EHLO response. in its EHLO response.
Syntax: Syntax:
"RCPT TO:" ("<Postmaster@" domain ">" / "<Postmaster>" / Forward-Path)
[SP Rcpt-parameters] CRLF
4.1.1.4 DATA (DATA) rcpt = "RCPT TO:" ( "<Postmaster@" Domain ">" / "<Postmaster>" /
Forward-Path ) [SP Rcpt-parameters] CRLF
Note that, in a departure from the usual rules for
local-parts, the "Postmaster" string shown above is
treated as case-insensitive.
4.1.1.4. DATA (DATA)
The receiver normally sends a 354 response to DATA, and then treats The receiver normally sends a 354 response to DATA, and then treats
the lines (strings ending in <CRLF> sequences, as described in the lines (strings ending in <CRLF> sequences, as described in
section 2.3.7) following the command as mail data from the sender. Section 2.3.7) following the command as mail data from the sender.
This command causes the mail data to be appended to the mail data This command causes the mail data to be appended to the mail data
buffer. The mail data may contain any of the 128 ASCII character buffer. The mail data may contain any of the 128 ASCII character
codes, although experience has indicated that use of control codes, although experience has indicated that use of control
characters other than SP, HT, CR, and LF may cause problems and characters other than SP, HT, CR, and LF may cause problems and
SHOULD be avoided when possible. SHOULD be avoided when possible.
The mail data is terminated by a line containing only a period, that The mail data are terminated by a line containing only a period, that
is, the character sequence "<CRLF>.<CRLF>" (see section 4.5.2). This is, the character sequence "<CRLF>.<CRLF>", where the first <CRLF> is
is the end of mail data indication. Note that the first <CRLF> of actually the terminator of the previous line (see Section 4.5.2).
this terminating sequence is also the <CRLF> that ends the final line This is the end of mail data indication. The first <CRLF> of this
of the data (message text) or, if there was no data, ends the DATA terminating sequence is also the <CRLF> that ends the final line of
command itself. An extra <CRLF> MUST NOT be added, as that would the data (message text) or, if there was no mail data, ends the DATA
cause an empty line to be added to the message. The only exception command itself (the "no mail data" case does not conform to this
to this rule would arise if the message body were passed to the specification since it would require that neither the trace header
originating SMTP-sender with a final "line" that did not end in fields required by this specification nor the message header section
<CRLF>; in that case, the originating SMTP system MUST either reject required by RFC2822 [11] be transmitted). An extra <CRLF> MUST NOT
the message as invalid or add <CRLF> in order to have the receiving be added, as that would cause an empty line to be added to the
SMTP server recognize the "end of data" condition. message. The only exception to this rule would arise if the message
body were passed to the originating SMTP-sender with a final "line"
that did not end in <CRLF>; in that case, the originating SMTP system
MUST either reject the message as invalid or add <CRLF> in order to
have the receiving SMTP server recognize the "end of data" condition.
The custom of accepting lines ending only in <LF>, as a concession to The custom of accepting lines ending only in <LF>, as a concession to
non-conforming behavior on the part of some UNIX systems, has proven non-conforming behavior on the part of some UNIX systems, has proven
to cause more interoperability problems than it solves, and SMTP to cause more interoperability problems than it solves, and SMTP
server systems MUST NOT do this, even in the name of improved server systems MUST NOT do this, even in the name of improved
robustness. In particular, the sequence "<LF>.<LF>" (bare line robustness. In particular, the sequence "<LF>.<LF>" (bare line
feeds, without carriage returns) MUST NOT be treated as equivalent to feeds, without carriage returns) MUST NOT be treated as equivalent to
<CRLF>.<CRLF> as the end of mail data indication. <CRLF>.<CRLF> as the end of mail data indication.
Receipt of the end of mail data indication requires the server to Receipt of the end of mail data indication requires the server to
process the stored mail transaction information. This processing process the stored mail transaction information. This processing
consumes the information in the reverse-path buffer, the forward-path consumes the information in the reverse-path buffer, the forward-path
buffer, and the mail data buffer, and on the completion of this buffer, and the mail data buffer, and on the completion of this
command these buffers are cleared. If the processing is successful, command these buffers are cleared. If the processing is successful,
the receiver MUST send an OK reply. If the processing fails the the receiver MUST send an OK reply. If the processing fails the
receiver MUST send a failure reply. The SMTP model does not allow receiver MUST send a failure reply. The SMTP model does not allow
for partial failures at this point: either the message is accepted by for partial failures at this point: either the message is accepted by
the server for delivery and a positive response is returned or it is the server for delivery and a positive response is returned or it is
not accepted and a failure reply is returned. In sending a positive not accepted and a failure reply is returned. In sending a positive
completion reply to the end of data indication, the receiver takes "250 OK" completion reply to the end of data indication, the receiver
full responsibility for the message (see section 6.1). Errors that takes full responsibility for the message (see Section 6.1). Errors
are diagnosed subsequently MUST be reported in a mail message, as that are diagnosed subsequently MUST be reported in a mail message,
discussed in section 4.4. as discussed in Section 4.4.
When the SMTP server accepts a message either for relaying or for When the SMTP server accepts a message either for relaying or for
final delivery, it inserts a trace record (also referred to final delivery, it inserts a trace record (also referred to
interchangeably as a "time stamp line" or "Received" line) at the top interchangeably as a "time stamp line" or "Received" line) at the top
of the mail data. This trace record indicates the identity of the of the mail data. This trace record indicates the identity of the
host that sent the message, the identity of the host that received host that sent the message, the identity of the host that received
the message (and is inserting this time stamp), and the date and time the message (and is inserting this time stamp), and the date and time
the message was received. Relayed messages will have multiple time the message was received. Relayed messages will have multiple time
stamp lines. Details for formation of these lines, including their stamp lines. Details for formation of these lines, including their
syntax, is specified in section 4.4. syntax, is specified in Section 4.4.
Additional discussion about the operation of the DATA command appears Additional discussion about the operation of the DATA command appears
in section 3.3. in Section 3.3.
Syntax: Syntax:
"DATA" CRLF
4.1.1.5 RESET (RSET) data = "DATA" CRLF
4.1.1.5. RESET (RSET)
This command specifies that the current mail transaction will be This command specifies that the current mail transaction will be
aborted. Any stored sender, recipients, and mail data MUST be aborted. Any stored sender, recipients, and mail data MUST be
discarded, and all buffers and state tables cleared. The receiver discarded, and all buffers and state tables cleared. The receiver
MUST send a "250 OK" reply to a RSET command with no arguments. A MUST send a "250 OK" reply to a RSET command with no arguments. A
reset command may be issued by the client at any time. It is reset command may be issued by the client at any time. It is
effectively equivalent to a NOOP (i.e., if has no effect) if issued effectively equivalent to a NOOP (i.e., it has no effect) if issued
immediately after EHLO, before EHLO is issued in the session, after immediately after EHLO, before EHLO is issued in the session, after
an end-of-data indicator has been sent and acknowledged, or an end-of-data indicator has been sent and acknowledged, or
immediately before a QUIT. An SMTP server MUST NOT close the immediately before a QUIT. An SMTP server MUST NOT close the
connection as the result of receiving a RSET; that action is reserved connection as the result of receiving a RSET; that action is reserved
for QUIT (see section 4.1.1.10). for QUIT (see Section 4.1.1.10).
Since EHLO implies some additional processing and response by the Since EHLO implies some additional processing and response by the
server, RSET will normally be more efficient than reissuing that server, RSET will normally be more efficient than reissuing that
command, even though the formal semantics are the same. command, even though the formal semantics are the same.
There are circumstances, contrary to the intent of this There are circumstances, contrary to the intent of this
specification, in which an SMTP server may receive an indication that specification, in which an SMTP server may receive an indication that
the underlying TCP connection has been closed or reset. To preserve the underlying TCP connection has been closed or reset. To preserve
the robustness of the mail system, SMTP servers SHOULD be prepared the robustness of the mail system, SMTP servers SHOULD be prepared
for this condition and SHOULD treat it as if a QUIT had been received for this condition and SHOULD treat it as if a QUIT had been received
before the connection disappeared. before the connection disappeared.
Syntax: Syntax:
"RSET" CRLF
4.1.1.6 VERIFY (VRFY) rset = "RSET" CRLF
4.1.1.6. VERIFY (VRFY)
This command asks the receiver to confirm that the argument This command asks the receiver to confirm that the argument
identifies a user or mailbox. If it is a user name, information is identifies a user or mailbox. If it is a user name, information is
returned as specified in section 3.5. returned as specified in Section 3.5.
This command has no effect on the reverse-path buffer, the forward- This command has no effect on the reverse-path buffer, the forward-
path buffer, or the mail data buffer. path buffer, or the mail data buffer.
Syntax: Syntax:
"VRFY" SP String CRLF
4.1.1.7 EXPAND (EXPN) vrfy = "VRFY" SP String CRLF
4.1.1.7. EXPAND (EXPN)
This command asks the receiver to confirm that the argument This command asks the receiver to confirm that the argument
identifies a mailing list, and if so, to return the membership of identifies a mailing list, and if so, to return the membership of
that list. If the command is successful, a reply is returned that list. If the command is successful, a reply is returned
containing information as described in section 3.5. This reply will containing information as described in Section 3.5. This reply will
have multiple lines except in the trivial case of a one-member list. have multiple lines except in the trivial case of a one-member list.
This command has no effect on the reverse-path buffer, the forward- This command has no effect on the reverse-path buffer, the forward-
path buffer, or the mail data buffer and may be issued at any time. path buffer, or the mail data buffer and may be issued at any time.
Syntax: Syntax:
"EXPN" SP String CRLF
4.1.1.8 HELP (HELP) expn = "EXPN" SP String CRLF
4.1.1.8. HELP (HELP)
This command causes the server to send helpful information to the This command causes the server to send helpful information to the
client. The command MAY take an argument (e.g., any command name) client. The command MAY take an argument (e.g., any command name)
and return more specific information as a response. and return more specific information as a response.
This command has no effect on the reverse-path buffer, the forward- This command has no effect on the reverse-path buffer, the forward-
path buffer, or the mail data buffer and may be issued at any time. path buffer, or the mail data buffer and may be issued at any time.
SMTP servers SHOULD support HELP without arguments and MAY support it SMTP servers SHOULD support HELP without arguments and MAY support it
with arguments. with arguments.
Syntax: Syntax:
"HELP" [ SP String ] CRLF
4.1.1.9 NOOP (NOOP) help = "HELP" [ SP String ] CRLF
4.1.1.9. NOOP (NOOP)
This command does not affect any parameters or previously entered This command does not affect any parameters or previously entered
commands. It specifies no action other than that the receiver send commands. It specifies no action other than that the receiver send a
an OK reply. "250 OK" reply.
This command has no effect on the reverse-path buffer, the forward- This command has no effect on the reverse-path buffer, the forward-
path buffer, or the mail data buffer and may be issued at any time. path buffer, or the mail data buffer and may be issued at any time.
If a parameter string is specified, servers SHOULD ignore it. If a parameter string is specified, servers SHOULD ignore it.
Syntax: Syntax:
"NOOP" [ SP String ] CRLF
4.1.1.10 QUIT (QUIT) noop = "NOOP" [ SP String ] CRLF
This command specifies that the receiver MUST send an OK reply, and 4.1.1.10. QUIT (QUIT)
then close the transmission channel.
This command specifies that the receiver MUST send a "221 OK" reply,
and then close the transmission channel.
The receiver MUST NOT intentionally close the transmission channel The receiver MUST NOT intentionally close the transmission channel
until it receives and replies to a QUIT command (even if there was an until it receives and replies to a QUIT command (even if there was an
error). The sender MUST NOT intentionally close the transmission error). The sender MUST NOT intentionally close the transmission
channel until it sends a QUIT command and SHOULD wait until it channel until it sends a QUIT command and SHOULD wait until it
receives the reply (even if there was an error response to a previous receives the reply (even if there was an error response to a previous
command). If the connection is closed prematurely due to violations command). If the connection is closed prematurely due to violations
of the above or system or network failure, the server MUST cancel any of the above or system or network failure, the server MUST cancel any
pending transaction, but not undo any previously completed pending transaction, but not undo any previously completed
transaction, and generally MUST act as if the command or transaction transaction, and generally MUST act as if the command or transaction
in progress had received a temporary error (i.e., a 4yz response). in progress had received a temporary error (i.e., a 4yz response).
The QUIT command may be issued at any time. The QUIT command may be issued at any time. Any current uncompleted
mail transaction will be aborted.
Syntax: Syntax:
"QUIT" CRLF
4.1.2 Command Argument Syntax quit = "QUIT" CRLF
The syntax of the argument fields of the above commands (using the 4.1.1.11. Mail-parameter and Rcpt-parameter Error Responses
syntax specified in [8] where applicable) is given below. Some of
the productions given below are used only in conjunction with source If the server SMTP does not recognize or cannot implement one or more
routes as described in appendix C. Terminals not defined in this of the parameters associated with a particular MAIL FROM or RCPT TO
document, such as ALPHA, DIGIT, SP, CR, LF, CRLF, are as defined in command, it will return code 555.
the "core" syntax [8 (section 6)] or in the message format syntax
[32]. If for some reason the server is temporarily unable to accommodate
one or more of the parameters associated with a MAIL FROM or RCPT TO
command, and if the definition of the specific parameter does not
mandate the use of another code, it should return code 455.
Errors specific to particular parameters and their values will be
specified in the parameter's defining RFC.
4.1.2. Command Argument Syntax
The syntax of the argument clauses of the above commands (using the
syntax specified in RFC 5234 [5] where applicable) is given below.
Some of the productions given below are used only in conjunction with
source routes as described in Appendix C. Terminals not defined in
this document, such as ALPHA, DIGIT, SP, CR, LF, CRLF, are as defined
in the "core" syntax in RFC 5234 [5] (section 6)] or in the message
format syntax in RFC2822 [11].
Reverse-path = Path / "<>"
Reverse-path = Path
Forward-path = Path Forward-path = Path
Path = "<" [ A-d-l ":" ] Mailbox ">" Path = "<" [ A-d-l ":" ] Mailbox ">"
A-d-l = At-domain *( "," A-d-l )
; Note that this form, the so-called "source route", A-d-l = At-domain *( "," At-domain )
; MUST BE accepted, SHOULD NOT be generated, and SHOULD be ; Note that this form, the so-called "source
; ignored. ; route", MUST BE accepted, SHOULD NOT be
At-domain = "@" domain ; generated, and SHOULD be ignored.
At-domain = "@" Domain
Mail-parameters = esmtp-param *(SP esmtp-param) Mail-parameters = esmtp-param *(SP esmtp-param)
Rcpt-parameters = esmtp-param *(SP esmtp-param) Rcpt-parameters = esmtp-param *(SP esmtp-param)
esmtp-param = esmtp-keyword ["=" esmtp-value] esmtp-param = esmtp-keyword ["=" esmtp-value]
esmtp-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-") esmtp-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-")
esmtp-value = 1*(%d33-60 / %d62-127)
; any CHAR excluding "=", SP, and control characters esmtp-value = 1*(%d33-60 / %d62-126)
; any CHAR excluding "=", SP, and control
; characters. If this string is an email address,
; i.e., a Mailbox, then the "xtext" syntax [12]
; SHOULD be used.
Keyword = Ldh-str Keyword = Ldh-str
Argument = Atom Argument = Atom
Domain = (sub-domain 1*("." sub-domain)) / address-literal
Domain = sub-domain *("." sub-domain)
sub-domain = Let-dig [Ldh-str] sub-domain = Let-dig [Ldh-str]
address-literal = "[" IPv4-address-literal / Let-dig = ALPHA / DIGIT
Ldh-str = *( ALPHA / DIGIT / "-" ) Let-dig
address-literal = "[" ( IPv4-address-literal /
IPv6-address-literal / IPv6-address-literal /
General-address-literal "]" General-address-literal ) "]"
; See section 4.1.3 ; See Section 4.1.3
Mailbox = Local-part "@" Domain Mailbox = Local-part "@" ( Domain / address-literal )
Local-part = Dot-string / Quoted-string Local-part = Dot-string / Quoted-string
; MAY be case-sensitive ; MAY be case-sensitive
Dot-string = Atom *("." Atom) Dot-string = Atom *("." Atom)
Atom = 1*atext Atom = 1*atext
Quoted-string = DQUOTE *qcontent DQUOTE Quoted-string = DQUOTE *qcontentSMTP DQUOTE
QcontentSMTP = qtextSMTP / quoted-pairSMTP
quoted-pairSMTP = %d92 %d32-126
; i.e., backslash followed by any ASCII
; graphic (including itself) or SPace
qtextSMTP = %d32-33 / %d35-91 / %d93-126
; i.e., within a quoted string, any
; ASCII graphic or space is permitted
; without blackslash-quoting except
; double-quote and the backslash itself.
String = Atom / Quoted-string String = Atom / Quoted-string
While the above definition for Local-part is relatively permissive, While the above definition for Local-part is relatively permissive,
for maximum interoperability, a host that expects to receive mail for maximum interoperability, a host that expects to receive mail
SHOULD avoid defining mailboxes where the Local-part requires (or SHOULD avoid defining mailboxes where the Local-part requires (or
uses) the Quoted-string form or where the Local-part is case- uses) the Quoted-string form or where the Local-part is case-
sensitive. For any purposes that require generating or comparing sensitive. For any purposes that require generating or comparing
Local-parts (e.g., to specific mailbox names), all quoted forms MUST Local-parts (e.g., to specific mailbox names), all quoted forms MUST
be treated as equivalent and the sending system SHOULD transmit the be treated as equivalent and the sending system SHOULD transmit the
skipping to change at page 37, line 49 skipping to change at page 43, line 30
Systems MUST NOT define mailboxes in such a way as to require the use Systems MUST NOT define mailboxes in such a way as to require the use
in SMTP of non-ASCII characters (octets with the high order bit set in SMTP of non-ASCII characters (octets with the high order bit set
to one) or ASCII "control characters" (decimal value 0-31 and 127). to one) or ASCII "control characters" (decimal value 0-31 and 127).
These characters MUST NOT be used in MAIL or RCPT commands or other These characters MUST NOT be used in MAIL or RCPT commands or other
commands that require mailbox names. commands that require mailbox names.
Note that the backslash, "\", is a quote character, which is used to Note that the backslash, "\", is a quote character, which is used to
indicate that the next character is to be used literally (instead of indicate that the next character is to be used literally (instead of
its normal interpretation). For example, "Joe\,Smith" indicates a its normal interpretation). For example, "Joe\,Smith" indicates a
single nine character user field with the comma being the fourth single nine character user name string with the comma being the
character of the field. fourth character of that string.
To promote interoperability and consistent with long-standing To promote interoperability and consistent with long-standing
guidance about conservative use of the DNS in naming and applications guidance about conservative use of the DNS in naming and applications
(e.g., see section 2.3.1 of the base DNS document, RFC1035 [22]), (e.g., see section 2.3.1 of the base DNS document, RFC1035 [7]),
characters outside the set of alphas, digits, and hyphen MUST NOT characters outside the set of alphabetic characters, digits, and
appear in domain name labels for SMTP clients or servers. In hyphen MUST NOT appear in domain name labels for SMTP clients or
particular, the underscore character is not permitted. SMTP servers servers. In particular, the underscore character is not permitted.
that receive a command in which invalid character codes have been SMTP servers that receive a command in which invalid character codes
employed, and for which there are no other reasons for rejection, have been employed, and for which there are no other reasons for
MUST reject that command with a 501 response. rejection, MUST reject that command with a 501 response (this rule,
like others, could be overridden by appropriate SMTP extensions).
4.1.3 Address Literals 4.1.3. Address Literals
Sometimes a host is not known to the domain name system and Sometimes a host is not known to the domain name system and
communication (and, in particular, communication to report and repair communication (and, in particular, communication to report and repair
the error) is blocked. To bypass this barrier a special literal form the error) is blocked. To bypass this barrier a special literal form
of the address is allowed as an alternative to a domain name. For of the address is allowed as an alternative to a domain name. For
IPv4 addresses, this form uses four small decimal integers separated IPv4 addresses, this form uses four small decimal integers separated
by dots and enclosed by brackets such as [123.255.37.2], which by dots and enclosed by brackets such as [123.255.37.2], which
indicates an (IPv4) Internet Address in sequence-of-octets form. For indicates an (IPv4) Internet Address in sequence-of-octets form. For
IPv6 and other forms of addressing that might eventually be IPv6 and other forms of addressing that might eventually be
standardized, the form consists of a standardized "tag" that standardized, the form consists of a standardized "tag" that
identifies the address syntax, a colon, and the address itself, in a identifies the address syntax, a colon, and the address itself, in a
format specified as part of the IPv6 standards [17]. format specified as part of the IPv6 standards (RFC4291 [6]).
Specifically: Specifically:
IPv4-address-literal = Snum 3("." Snum) IPv4-address-literal = Snum 3("." Snum)
IPv6-address-literal = "IPv6:" IPv6-addr IPv6-address-literal = "IPv6:" IPv6-addr
General-address-literal = Standardized-tag ":" 1*dcontent General-address-literal = Standardized-tag ":" 1*dcontent
Standardized-tag = Ldh-str
; MUST be specified in a standards-track RFC Standardized-tag ; MUST be specified in a standards-track RFC
; and registered with IANA ; and registered with IANA
Snum = 1*3DIGIT ; representing a decimal integer Snum = 1*3DIGIT
; representing a decimal integer
; value in the range 0 through 255 ; value in the range 0 through 255
Let-dig = ALPHA / DIGIT
Ldh-str = *( ALPHA / DIGIT / "-" ) Let-dig
IPv6-addr = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp IPv6-addr = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp
IPv6-hex = 1*4HEXDIG IPv6-hex = 1*4HEXDIG
IPv6-full = IPv6-hex 7(":" IPv6-hex) IPv6-full = IPv6-hex 7(":" IPv6-hex)
IPv6-comp = [IPv6-hex *5(":" IPv6-hex)] "::" [IPv6-hex *5(":" IPv6-comp = [IPv6-hex *5(":" IPv6-hex)] "::" [IPv6-hex *5(":"
IPv6-hex)] IPv6-hex)]
; The "::" represents at least 2 16-bit groups of zeros ; The "::" represents at least 2 16-bit groups of
; No more than 6 groups in addition to the "::" may be ; zeros. No more than 6 groups in addition to the
; present ; "::" may be present.
IPv6v4-full = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal IPv6v4-full = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal
IPv6v4-comp = [IPv6-hex *3(":" IPv6-hex)] "::" IPv6v4-comp = [IPv6-hex *3(":" IPv6-hex)] "::"
[IPv6-hex *3(":" IPv6-hex) ":"] IPv4-address-literal [IPv6-hex *3(":" IPv6-hex) ":"]
; The "::" represents at least 2 16-bit groups of zeros IPv4-address-literal
; No more than 4 groups in addition to the "::" and ; The "::" represents at least 2 16-bit groups of
; IPv4-address-literal may be present ; zeros. No more than 4 groups in addition to the
; "::" and IPv4-address-literal may be present.
4.1.4 Order of Commands 4.1.4. Order of Commands
There are restrictions on the order in which these commands may be There are restrictions on the order in which these commands may be
used. used.
A session that will contain mail transactions MUST first be A session that will contain mail transactions MUST first be
initialized by the use of the EHLO command. An SMTP server SHOULD initialized by the use of the EHLO command. An SMTP server SHOULD
accept commands for non-mail transactions (e.g., VRFY or EXPN) accept commands for non-mail transactions (e.g., VRFY or EXPN)
without this initialization. without this initialization.
An EHLO command MAY be issued by a client later in the session. If An EHLO command MAY be issued by a client later in the session. If
it is issued after the session begins, the SMTP server MUST clear all it is issued after the session begins and the EHLO command is
buffers and reset the state exactly as if a RSET command had been acceptable to the SMTP server, the SMTP server MUST clear all buffers
issued. In other words, the sequence of RSET followed immediately by and reset the state exactly as if a RSET command had been issued. In
EHLO is redundant, but not harmful other than in the performance cost other words, the sequence of RSET followed immediately by EHLO is
of executing unnecessary commands. redundant, but not harmful other than in the performance cost of
executing unnecessary commands.
If the EHLO command is not acceptable to the SMTP server, 501, 500, If the EHLO command is not acceptable to the SMTP server, 501, 500,
or 502 failure replies MUST be returned as appropriate. The SMTP 502, or 550 failure replies MUST be returned as appropriate. The
server MUST stay in the same state after transmitting these replies SMTP server MUST stay in the same state after transmitting these
that it was in before the EHLO was received. replies that it was in before the EHLO was received.
The SMTP client MUST, if possible, ensure that the domain parameter The SMTP client MUST, if possible, ensure that the domain parameter
to the EHLO command is a valid principal host name (not a CNAME or MX to the EHLO command is a primary host name as specified for this
name) for its host. If this is not possible (e.g., when the client's command in Section 2.3.5. If this is not possible (e.g., when the
address is dynamically assigned and the client does not have an client's address is dynamically assigned and the client does not have
obvious name), an address literal SHOULD be substituted for the an obvious name), an address literal SHOULD be substituted for the
domain name and supplemental information provided that will assist in domain name.
identifying the client.
An SMTP server MAY verify that the domain name parameter in the EHLO An SMTP server MAY verify that the domain name argument in the EHLO
command actually corresponds to the IP address of the client. command actually corresponds to the IP address of the client.
However, the server MUST NOT refuse to accept a message for this However, if the verification fails the server MUST NOT refuse to
reason if the verification fails: the information about verification accept a message on that basis. Information captured in the
failure is for logging and tracing only. verification attempt is for logging and tracing purposes. Note that
this prohibition applies to matching of the parameter to its IP
address only; see Section 7.9 for a more extensive discussion of
rejecting incoming connections or mail messages.
The NOOP, HELP, EXPN, VRFY, and RSET commands can be used at any time The NOOP, HELP, EXPN, VRFY, and RSET commands can be used at any time
during a session, or without previously initializing a session. SMTP during a session, or without previously initializing a session. SMTP
servers SHOULD process these normally (that is, not return a 503 servers SHOULD process these normally (that is, not return a 503
code) even if no EHLO command has yet been received; clients SHOULD code) even if no EHLO command has yet been received; clients SHOULD
open a session with EHLO before sending these commands. open a session with EHLO before sending these commands.
If these rules are followed, the example in RFC 821 that shows "550 If these rules are followed, the example in RFC 821 that shows "550
access denied to you" in response to an EXPN command is incorrect access denied to you" in response to an EXPN command is incorrect
unless an EHLO command precedes the EXPN or the denial of access is unless an EHLO command precedes the EXPN or the denial of access is
based on the client's IP address or other authentication or based on the client's IP address or other authentication or
authorization-determining mechanisms. authorization-determining mechanisms.
The MAIL command (or the obsolete SEND, SOML, or SAML commands) The MAIL command (or the obsolete SEND, SOML, or SAML commands)
begins a mail transaction. Once started, a mail transaction consists begins a mail transaction. Once started, a mail transaction consists
of a transaction beginning command, one or more RCPT commands, and a of a transaction beginning command, one or more RCPT commands, and a
DATA command, in that order. A mail transaction may be aborted by DATA command, in that order. A mail transaction may be aborted by
the RSET (or a new EHLO) command. There may be zero or more the RSET, a new EHLO, or the QUIT command. There may be zero or more
transactions in a session. MAIL (or SEND, SOML, or SAML) MUST NOT be transactions in a session. MAIL (or SEND, SOML, or SAML) MUST NOT be
sent if a mail transaction is already open, i.e., it should be sent sent if a mail transaction is already open, i.e., it should be sent
only if no mail transaction had been started in the session, or it only if no mail transaction had been started in the session, or if
the previous one successfully concluded with a successful DATA the previous one successfully concluded with a successful DATA
command, or if the previous one was aborted with a RSET. command, or if the previous one was aborted, e.g., with a RSET or new
EHLO.
If the transaction beginning command argument is not acceptable, a If the transaction beginning command argument is not acceptable, a
501 failure reply MUST be returned and the SMTP server MUST stay in 501 failure reply MUST be returned and the SMTP server MUST stay in
the same state. If the commands in a transaction are out of order to the same state. If the commands in a transaction are out of order to
the degree that they cannot be processed by the server, a 503 failure the degree that they cannot be processed by the server, a 503 failure
reply MUST be returned and the SMTP server MUST stay in the same reply MUST be returned and the SMTP server MUST stay in the same
state. state.
The last command in a session MUST be the QUIT command. The QUIT The last command in a session MUST be the QUIT command. The QUIT
command cannot be used at any other time in a session, but SHOULD be command SHOULD be used by the client SMTP to request connection
used by the client SMTP to request connection closure, even when no closure, even when no session opening command was sent and accepted.
session opening command was sent and accepted.
4.1.5 Private-use Commands 4.1.5. Private-use Commands
As specified in section 2.2.2, commands starting in "X" may be used As specified in Section 2.2.2, commands starting in "X" may be used
by bilateral agreement between the client (sending) and server by bilateral agreement between the client (sending) and server
(receiving) SMTP agents. An SMTP server that does not recognize such (receiving) SMTP agents. An SMTP server that does not recognize such
a command is expected to reply with "500 Command not recognized". An a command is expected to reply with "500 Command not recognized". An
extended SMTP server MAY list the feature names associated with these extended SMTP server MAY list the feature names associated with these
private commands in the response to the EHLO command. private commands in the response to the EHLO command.
Commands sent or accepted by SMTP systems that do not start with "X" Commands sent or accepted by SMTP systems that do not start with "X"
MUST conform to the requirements of section 2.2.2. MUST conform to the requirements of Section 2.2.2.
4.2 SMTP Replies 4.2. SMTP Replies
Replies to SMTP commands serve to ensure the synchronization of Replies to SMTP commands serve to ensure the synchronization of
requests and actions in the process of mail transfer and to guarantee requests and actions in the process of mail transfer and to guarantee
that the SMTP client always knows the state of the SMTP server. that the SMTP client always knows the state of the SMTP server.
Every command MUST generate exactly one reply. Every command MUST generate exactly one reply.
The details of the command-reply sequence are described in section The details of the command-reply sequence are described in
4.3. Section 4.3.
An SMTP reply consists of a three digit number (transmitted as three An SMTP reply consists of a three digit number (transmitted as three
numeric characters) followed by some text unless specified otherwise numeric characters) followed by some text unless specified otherwise
in this document. The number is for use by automata to determine in this document. The number is for use by automata to determine
what state to enter next; the text is for the human user. The three what state to enter next; the text is for the human user. The three
digits contain enough encoded information that the SMTP client need digits contain enough encoded information that the SMTP client need
not examine the text and may either discard it or pass it on to the not examine the text and may either discard it or pass it on to the
user, as appropriate. Exceptions are as noted elsewhere in this user, as appropriate. Exceptions are as noted elsewhere in this
document. In particular, the 220, 221, 251, 421, and 551 reply codes document. In particular, the 220, 221, 251, 421, and 551 reply codes
are associated with message text that must be parsed and interpreted are associated with message text that must be parsed and interpreted
by machines. In the general case, the text may be receiver dependent by machines. In the general case, the text may be receiver dependent
and context dependent, so there are likely to be varying texts for and context dependent, so there are likely to be varying texts for
each reply code. A discussion of the theory of reply codes is given each reply code. A discussion of the theory of reply codes is given
in section 4.2.1. Formally, a reply is defined to be the sequence: a in Section 4.2.1. Formally, a reply is defined to be the sequence: a
three-digit code, <SP>, one line of text, and <CRLF>, or a multiline three-digit code, <SP>, one line of text, and <CRLF>, or a multiline
reply (as defined in section 4.2.1). Since, in violation of this reply (as defined in the same section). Since, in violation of this
specification, the text is sometimes not sent, clients which do not specification, the text is sometimes not sent, clients which do not
receive it SHOULD be prepared to process the code alone (with or receive it SHOULD be prepared to process the code alone (with or
without a trailing space character). Only the EHLO, EXPN, and HELP without a trailing space character). Only the EHLO, EXPN, and HELP
commands are expected to result in multiline replies in normal commands are expected to result in multiline replies in normal
circumstances, however, multiline replies are allowed for any circumstances, however, multiline replies are allowed for any
command. command.
In ABNF, server responses are: In ABNF, server responses are:
Greeting = "220 " Domain [ SP text ] CRLF Greeting = ( "220 " (Domain / address-literal) [ SP text ] CRLF
Reply-line = Reply-code [ SP text ] CRLF ) /
( "220-" (Domain / address-literal) [ SP text ] CRLF
*( "220-" [ text ] CRLF )
"220" [ SP text ] CRLF )
Reply-line = *( Reply-code "-" [ text ] CRLF )
Reply-code [ SP text ] CRLF
Reply-code = %x32-35 %x30-35 %x30-39
where "Greeting" appears only in the 220 response that announces that where "Greeting" appears only in the 220 response that announces that
the server is opening its part of the connection. the server is opening its part of the connection. (Other possible
server responses upon connection follow the syntax of Reply-line.)
An SMTP server SHOULD send only the reply codes listed in this An SMTP server SHOULD send only the reply codes listed in this
document. An SMTP server SHOULD use the text shown in the examples document. An SMTP server SHOULD use the text shown in the examples
whenever appropriate. whenever appropriate.
An SMTP client MUST determine its actions only by the reply code, not An SMTP client MUST determine its actions only by the reply code, not
by the text (except for the "change of address" 251 and 551 and, if by the text (except for the "change of address" 251 and 551 and, if
necessary, 220, 221, and 421 replies); in the general case, any text, necessary, 220, 221, and 421 replies); in the general case, any text,
including no text at all (although senders SHOULD NOT send bare including no text at all (although senders SHOULD NOT send bare
codes), MUST be acceptable. The space (blank) following the reply codes), MUST be acceptable. The space (blank) following the reply
skipping to change at page 42, line 14 skipping to change at page 48, line 11
The list of codes that appears below MUST NOT be construed as The list of codes that appears below MUST NOT be construed as
permanent. While the addition of new codes should be a rare and permanent. While the addition of new codes should be a rare and
significant activity, with supplemental information in the textual significant activity, with supplemental information in the textual
part of the response being preferred, new codes may be added as the part of the response being preferred, new codes may be added as the
result of new Standards or Standards-track specifications. result of new Standards or Standards-track specifications.
Consequently, a sender-SMTP MUST be prepared to handle codes not Consequently, a sender-SMTP MUST be prepared to handle codes not
specified in this document and MUST do so by interpreting the first specified in this document and MUST do so by interpreting the first
digit only. digit only.
4.2.1 Reply Code Severities and Theory In the absence of extensions negotiated with the client, SMTP servers
MUST NOT send reply codes whose first digits are other than 2, 3, 4,
or 5. Clients that receive such out-of-range codes SHOULD normally
treat them as fatal errors and terminate the mail transaction.
4.2.1. Reply Code Severities and Theory
The three digits of the reply each have a special significance. The The three digits of the reply each have a special significance. The
first digit denotes whether the response is good, bad or incomplete. first digit denotes whether the response is good, bad or incomplete.
An unsophisticated SMTP client, or one that receives an unexpected An unsophisticated SMTP client, or one that receives an unexpected
code, will be able to determine its next action (proceed as planned, code, will be able to determine its next action (proceed as planned,
redo, retrench, etc.) by examining this first digit. An SMTP client redo, retrench, etc.) by examining this first digit. An SMTP client
that wants to know approximately what kind of error occurred (e.g., that wants to know approximately what kind of error occurred (e.g.,
mail system error, command syntax error) may examine the second mail system error, command syntax error) may examine the second
digit. The third digit and any supplemental information that may be digit. The third digit and any supplemental information that may be
present is reserved for the finest gradation of information. present is reserved for the finest gradation of information.
There are five values for the first digit of the reply code: There are four values for the first digit of the reply code:
1yz Positive Preliminary reply
The command has been accepted, but the requested action is being
held in abeyance, pending confirmation of the information in this
reply. The SMTP client should send another command specifying
whether to continue or abort the action. Note: unextended SMTP
does not have any commands that allow this type of reply, and so
does not have continue or abort commands.
2yz Positive Completion reply 2yz Positive Completion reply
The requested action has been successfully completed. A new The requested action has been successfully completed. A new
request may be initiated. request may be initiated.
3yz Positive Intermediate reply 3yz Positive Intermediate reply
The command has been accepted, but the requested action is being The command has been accepted, but the requested action is being
held in abeyance, pending receipt of further information. The held in abeyance, pending receipt of further information. The
SMTP client should send another command specifying this SMTP client should send another command specifying this
information. This reply is used in command sequence groups (i.e., information. This reply is used in command sequence groups (i.e.,
in DATA). in DATA).
4yz Transient Negative Completion reply 4yz Transient Negative Completion reply
The command was not accepted, and the requested action did not The command was not accepted, and the requested action did not
occur. However, the error condition is temporary and the action occur. However, the error condition is temporary and the action
may be requested again. The sender should return to the beginning may be requested again. The sender should return to the beginning
of the command sequence (if any). It is difficult to assign a of the command sequence (if any). It is difficult to assign a
meaning to "transient" when two different sites (receiver- and meaning to "transient" when two different sites (receiver- and
sender-SMTP agents) must agree on the interpretation. Each reply sender-SMTP agents) must agree on the interpretation. Each reply
in this category might have a different time value, but the SMTP in this category might have a different time value, but the SMTP
client is encouraged to try again. A rule of thumb to determine client SHOULD try again. A rule of thumb to determine whether a
whether a reply fits into the 4yz or the 5yz category (see below) reply fits into the 4yz or the 5yz category (see below) is that
is that replies are 4yz if they can be successful if repeated replies are 4yz if they can be successful if repeated without any
without any change in command form or in properties of the sender change in command form or in properties of the sender or receiver
or receiver (that is, the command is repeated identically and the (that is, the command is repeated identically and the receiver
receiver does not put up a new implementation.) does not put up a new implementation.)
5yz Permanent Negative Completion reply 5yz Permanent Negative Completion reply
The command was not accepted and the requested action did not The command was not accepted and the requested action did not
occur. The SMTP client is discouraged from repeating the exact occur. The SMTP client SHOULD NOT repeat the exact request (in
request (in the same sequence). Even some "permanent" error the same sequence). Even some "permanent" error conditions can be
conditions can be corrected, so the human user may want to direct corrected, so the human user may want to direct the SMTP client to
the SMTP client to reinitiate the command sequence by direct reinitiate the command sequence by direct action at some point in
action at some point in the future (e.g., after the spelling has the future (e.g., after the spelling has been changed, or the user
been changed, or the user has altered the account status). has altered the account status).
It is worth noting that the file transfer protocol (FTP [18]) uses a
very similar code architecture and that the SMTP codes are based on
the FTP model. However, SMTP uses a one-command, one-response model
(while FTP is asynchronous) and FTP's 1yz codes are not part of the
SMTP model.
The second digit encodes responses in specific categories: The second digit encodes responses in specific categories:
x0z Syntax: These replies refer to syntax errors, syntactically x0z Syntax: These replies refer to syntax errors, syntactically
correct commands that do not fit any functional category, and correct commands that do not fit any functional category, and
unimplemented or superfluous commands. unimplemented or superfluous commands.
x1z Information: These are replies to requests for information, x1z Information: These are replies to requests for information, such
such as status or help. as status or help.
x2z Connections: These are replies referring to the transmission x2z Connections: These are replies referring to the transmission
channel. channel.
x3z Unspecified. x3z Unspecified.
x4z Unspecified. x4z Unspecified.
x5z Mail system: These replies indicate the status of the receiver x5z Mail system: These replies indicate the status of the receiver
mail system vis-a-vis the requested transfer or other mail system mail system vis-a-vis the requested transfer or other mail system
skipping to change at page 44, line 27 skipping to change at page 50, line 27
The format for multiline replies requires that every line, except the The format for multiline replies requires that every line, except the
last, begin with the reply code, followed immediately by a hyphen, last, begin with the reply code, followed immediately by a hyphen,
"-" (also known as minus), followed by text. The last line will "-" (also known as minus), followed by text. The last line will
begin with the reply code, followed immediately by <SP>, optionally begin with the reply code, followed immediately by <SP>, optionally
some text, and <CRLF>. As noted above, servers SHOULD send the <SP> some text, and <CRLF>. As noted above, servers SHOULD send the <SP>
if subsequent text is not sent, but clients MUST be prepared for it if subsequent text is not sent, but clients MUST be prepared for it
to be omitted. to be omitted.
For example: For example:
123-First line 250-First line
123-Second line 250-Second line
123-234 text beginning with numbers 250-234 text beginning with numbers
123 The last line 250 The last line
In many cases the SMTP client then simply needs to search for a line In a multiline reply the reply code on each of the lines MUST be the
beginning with the reply code followed by <SP> or <CRLF> and ignore same. It is reasonable for the client to rely on this, so it can
all preceding lines. In a few cases, there is important data for the make processing decisions based on the code in any line, assuming
client in the reply "text". The client will be able to identify that all others will be the same. In a few cases, there is important
these cases from the current context. data for the client in the reply "text". The client will be able to
identify these cases from the current context.
4.2.2 Reply Codes by Function Groups 4.2.2. Reply Codes by Function Groups
500 Syntax error, command unrecognized (This may include errors such
as command line too long)
500 Syntax error, command unrecognized
(This may include errors such as command line too long)
501 Syntax error in parameters or arguments 501 Syntax error in parameters or arguments
502 Command not implemented (see section 4.2.4)
502 Command not implemented (see Section 4.2.4)
503 Bad sequence of commands 503 Bad sequence of commands
504 Command parameter not implemented 504 Command parameter not implemented
211 System status, or system help reply 211 System status, or system help reply
214 Help message
(Information on how to use the receiver or the meaning of a 214 Help message (Information on how to use the receiver or the
particular non-standard command; this reply is useful only meaning of a particular non-standard command; this reply is useful
to the human user) only to the human user)
220 <domain> Service ready 220 <domain> Service ready
221 <domain> Service closing transmission channel 221 <domain> Service closing transmission channel
421 <domain> Service not available, closing transmission channel 421 <domain> Service not available, closing transmission channel
(This may be a reply to any command if the service knows it (This may be a reply to any command if the service knows it must
must shut down) shut down)
250 Requested mail action okay, completed 250 Requested mail action okay, completed
251 User not local; will forward to <forward-path>
(See section 3.4) 251 User not local; will forward to <forward-path> (See Section 3.4)
252 Cannot VRFY user, but will accept message and attempt
delivery 252 Cannot VRFY user, but will accept message and attempt delivery
(See section 3.5.3) (See Section 3.5.3)
450 Requested mail action not taken: mailbox unavailable
(e.g., mailbox busy) 455 Server unable to accommodate parameters
550 Requested action not taken: mailbox unavailable
(e.g., mailbox not found, no access, or command rejected 555 MAIL FROM/RCPT TO parameters not recognized or not implemented
for policy reasons)
450 Requested mail action not taken: mailbox unavailable (e.g.,
mailbox busy or temporarily blocked for policy reasons)
550 Requested action not taken: mailbox unavailable (e.g., mailbox
not found, no access, or command rejected for policy reasons)
451 Requested action aborted: error in processing 451 Requested action aborted: error in processing
551 User not local; please try <forward-path>
(See section 3.4) 551 User not local; please try <forward-path> (See Section 3.4)
452 Requested action not taken: insufficient system storage 452 Requested action not taken: insufficient system storage
552 Requested mail action aborted: exceeded storage allocation 552 Requested mail action aborted: exceeded storage allocation
553 Requested action not taken: mailbox name not allowed
(e.g., mailbox syntax incorrect) 553 Requested action not taken: mailbox name not allowed (e.g.,
mailbox syntax incorrect)
354 Start mail input; end with <CRLF>.<CRLF> 354 Start mail input; end with <CRLF>.<CRLF>
554 Transaction failed (Or, in the case of a connection-opening 554 Transaction failed (Or, in the case of a connection-opening
response, "No SMTP service here") response, "No SMTP service here")
4.2.3 Reply Codes in Numeric Order 4.2.3. Reply Codes in Numeric Order
211 System status, or system help reply 211 System status, or system help reply
214 Help message
(Information on how to use the receiver or the meaning of a 214 Help message (Information on how to use the receiver or the
particular non-standard command; this reply is useful only meaning of a particular non-standard command; this reply is useful
to the human user) only to the human user)
220 <domain> Service ready 220 <domain> Service ready
221 <domain> Service closing transmission channel 221 <domain> Service closing transmission channel
250 Requested mail action okay, completed 250 Requested mail action okay, completed
251 User not local; will forward to <forward-path>
(See section 3.4) 251 User not local; will forward to <forward-path> (See Section 3.4)
252 Cannot VRFY user, but will accept message and attempt
delivery 252 Cannot VRFY user, but will accept message and attempt delivery
(See section 3.5.3) (See Section 3.5.3)
354 Start mail input; end with <CRLF>.<CRLF> 354 Start mail input; end with <CRLF>.<CRLF>
421 <domain> Service not available, closing transmission channel 421 <domain> Service not available, closing transmission channel
(This may be a reply to any command if the service knows it (This may be a reply to any command if the service knows it must
must shut down) shut down)
450 Requested mail action not taken: mailbox unavailable
(e.g., mailbox busy) 450 Requested mail action not taken: mailbox unavailable (e.g.,
mailbox busy or temporarily blocked for policy reasons))
451 Requested action aborted: local error in processing 451 Requested action aborted: local error in processing
452 Requested action not taken: insufficient system storage 452 Requested action not taken: insufficient system storage
500 Syntax error, command unrecognized
(This may include errors such as command line too long) 455 Server unable to accommodate parameters
500 Syntax error, command unrecognized (This may include errors such
as command line too long)
501 Syntax error in parameters or arguments 501 Syntax error in parameters or arguments
502 Command not implemented (see section 4.2.4)
502 Command not implemented (see Section 4.2.4)
503 Bad sequence of commands 503 Bad sequence of commands
504 Command parameter not implemented 504 Command parameter not implemented
550 Requested action not taken: mailbox unavailable
(e.g., mailbox not found, no access, or command rejected 550 Requested action not taken: mailbox unavailable (e.g., mailbox
for policy reasons) not found, no access, or command rejected for policy reasons)
551 User not local; please try <forward-path>
(See section 3.4) 551 User not local; please try <forward-path> (See Section 3.4)
552 Requested mail action aborted: exceeded storage allocation 552 Requested mail action aborted: exceeded storage allocation
553 Requested action not taken: mailbox name not allowed
(e.g., mailbox syntax incorrect) 553 Requested action not taken: mailbox name not allowed (e.g.,
mailbox syntax incorrect)
554 Transaction failed (Or, in the case of a connection-opening 554 Transaction failed (Or, in the case of a connection-opening
response, "No SMTP service here") response, "No SMTP service here")
4.2.4 Reply Code 502 555 MAIL FROM/RCPT TO parameters not recognized or not implemented
4.2.4. Reply Code 502
Questions have been raised as to when reply code 502 (Command not Questions have been raised as to when reply code 502 (Command not
implemented) SHOULD be returned in preference to other codes. 502 implemented) SHOULD be returned in preference to other codes. 502
SHOULD be used when the command is actually recognized by the SMTP SHOULD be used when the command is actually recognized by the SMTP
server, but not implemented. If the command is not recognized, code server, but not implemented. If the command is not recognized, code
500 SHOULD be returned. Extended SMTP systems MUST NOT list 500 SHOULD be returned. Extended SMTP systems MUST NOT list
capabilities in response to EHLO for which they will return 502 (or capabilities in response to EHLO for which they will return 502 (or
500) replies. 500) replies.
4.2.5 Reply Codes After DATA and the Subsequent <CRLF>.<CRLF> 4.2.5. Reply Codes After DATA and the Subsequent <CRLF>.<CRLF>
When an SMTP server returns a positive completion status (2yz code) When an SMTP server returns a positive completion status (2yz code)
after the DATA command is completed with <CRLF>.<CRLF>, it accepts after the DATA command is completed with <CRLF>.<CRLF>, it accepts
responsibility for: responsibility for:
- delivering the message (if the recipient mailbox exists), or o delivering the message (if the recipient mailbox exists), or
- if attempts to deliver the message fail due to transient o if attempts to deliver the message fail due to transient
conditions, retrying delivery some reasonable number of times at conditions, retrying delivery some reasonable number of times at
intervals as specified in section 4.5.4. intervals as specified in Section 4.5.4.
- if attempts to deliver the message fail due to permanent o if attempts to deliver the message fail due to permanent
conditions, or if repeated attempts to deliver the message fail conditions, or if repeated attempts to deliver the message fail
due to transient conditions, returning appropriate notification to due to transient conditions, returning appropriate notification to
the sender of the original message (using the address in the SMTP the sender of the original message (using the address in the SMTP
MAIL command). MAIL command).
When an SMTP server returns a permanent error status (5yz) code after When an SMTP server returns a temporary error status (4yz) code after
the DATA command is completed with <CRLF>.<CRLF>, it MUST NOT make the DATA command is completed with <CRLF>.<CRLF>, it MUST NOT make a
any subsequent attempt to deliver that message. The SMTP client subsequent attempt to deliver that message. The SMTP client retains
retains responsibility for delivery of that message and may either responsibility for delivery of that message and may either return it
return it to the user or requeue it for a subsequent attempt (see to the user or requeue it for a subsequent attempt (see
section 4.5.4.1). Section 4.5.4.1).
The user who originated the message SHOULD be able to interpret the The user who originated the message SHOULD be able to interpret the
return of a transient failure status (by mail message or otherwise) return of a transient failure status (by mail message or otherwise)
as a non-delivery indication, just as a permanent failure would be as a non-delivery indication, just as a permanent failure would be
interpreted. I.e., if the client SMTP successfully handles these interpreted. If the client SMTP successfully handles these
conditions, the user will not receive such a reply. conditions, the user will not receive such a reply.
When an SMTP server returns a permanent error status (5yz) code after When an SMTP server returns a permanent error status (5yz) code after
the DATA command is completely with <CRLF>.<CRLF>, it MUST NOT make the DATA command is completed with <CRLF>.<CRLF>, it MUST NOT make
any subsequent attempt to deliver the message. As with temporary any subsequent attempt to deliver the message. As with temporary
error status codes, the SMTP client retains responsibility for the error status codes, the SMTP client retains responsibility for the
message, but SHOULD not again attempt delivery to the same server message, but SHOULD not again attempt delivery to the same server
without user review and intervention of the message. without user review of the message and response and appropriate
intervention.
4.3 Sequencing of Commands and Replies 4.3. Sequencing of Commands and Replies
4.3.1 Sequencing Overview 4.3.1. Sequencing Overview
The communication between the sender and receiver is an alternating The communication between the sender and receiver is an alternating
dialogue, controlled by the sender. As such, the sender issues a dialogue, controlled by the sender. As such, the sender issues a
command and the receiver responds with a reply. Unless other command and the receiver responds with a reply. Unless other
arrangements are negotiated through service extensions, the sender arrangements are negotiated through service extensions, the sender
MUST wait for this response before sending further commands. MUST wait for this response before sending further commands. One
important reply is the connection greeting. Normally, a receiver
One important reply is the connection greeting. Normally, a receiver
will send a 220 "Service ready" reply when the connection is will send a 220 "Service ready" reply when the connection is
completed. The sender SHOULD wait for this greeting message before completed. The sender SHOULD wait for this greeting message before
sending any commands. sending any commands.
Note: all the greeting-type replies have the official name (the Note: all the greeting-type replies have the official name (the
fully-qualified primary domain name) of the server host as the first fully-qualified primary domain name) of the server host as the first
word following the reply code. Sometimes the host will have no word following the reply code. Sometimes the host will have no
meaningful name. See 4.1.3 for a discussion of alternatives in these meaningful name. See Section 4.1.3 for a discussion of alternatives
situations. in these situations.
For example, For example,
220 ISIF.USC.EDU Service ready 220 ISIF.USC.EDU Service ready
or or
220 mail.foo.com SuperSMTP v 6.1.2 Service ready
220 mail.example.com SuperSMTP v 6.1.2 Service ready
or or
220 [10.0.0.1] Clueless host service ready 220 [10.0.0.1] Clueless host service ready
The table below lists alternative success and failure replies for The table below lists alternative success and failure replies for
each command. These SHOULD be strictly adhered to: a receiver may each command. These SHOULD be strictly adhered to. A receiver MAY
substitute text in the replies, but the meaning and action implied by substitute text in the replies, but the meanings and actions implied
the code numbers and by the specific command reply sequence cannot be by the code numbers and by the specific command reply sequence MUST
altered. be preserved.
4.3.2 Command-Reply Sequences 4.3.2. Command-Reply Sequences
Each command is listed with its usual possible replies. The prefixes Each command is listed with its usual possible replies. The prefixes
used before the possible replies are "I" for intermediate, "S" for used before the possible replies are "I" for intermediate, "S" for
success, and "E" for error. Since some servers may generate other success, and "E" for error. Since some servers may generate other
replies under special circumstances, and to allow for future replies under special circumstances, and to allow for future
extension, SMTP clients SHOULD, when possible, interpret only the extension, SMTP clients SHOULD, when possible, interpret only the
first digit of the reply and MUST be prepared to deal with first digit of the reply and MUST be prepared to deal with
unrecognized reply codes by interpreting the first digit only. unrecognized reply codes by interpreting the first digit only.
Unless extended using the mechanisms described in section 2.2, SMTP Unless extended using the mechanisms described in Section 2.2, SMTP
servers MUST NOT transmit reply codes to an SMTP client that are servers MUST NOT transmit reply codes to an SMTP client that are
other than three digits or that do not start in a digit between 2 and other than three digits or that do not start in a digit between 2 and
5 inclusive. 5 inclusive.
These sequencing rules and, in principle, the codes themselves, can These sequencing rules and, in principle, the codes themselves, can
be extended or modified by SMTP extensions offered by the server and be extended or modified by SMTP extensions offered by the server and
accepted (requested) by the client. accepted (requested) by the client. However, if the target is more
precise granularity in the codes, rather than codes for completely
new purposes, the system described in RFC 3463 [37] SHOULD be used in
preference to the invention of new codes.
In addition to the codes listed below, any SMTP command can return In addition to the codes listed below, any SMTP command can return
any of the following codes if the corresponding unusual circumstances any of the following codes if the corresponding unusual circumstances
are encountered: are encountered:
500 For the "command line too long" case or if the command name was 500 For the "command line too long" case or if the command name was
not recognized. Note that producing a "command not recognized" not recognized. Note that producing a "command not recognized"
error in response to the required subset of these commands is a error in response to the required subset of these commands is a
violation of this specification. violation of this specification. Similarly, producing a "command
too long" message for a command line shorter than 512 characters
would violate the provisions of Section 4.5.3.1.4.
501 Syntax error in command or arguments. In order to provide for 501 Syntax error in command or arguments. In order to provide for
future extensions, commands that are specified in this document as future extensions, commands that are specified in this document as
not accepting arguments (DATA, RSET, QUIT) SHOULD return a 501 not accepting arguments (DATA, RSET, QUIT) SHOULD return a 501
message if arguments are supplied in the absence of EHLO- message if arguments are supplied in the absence of EHLO-
advertised extensions. advertised extensions.
421 Service shutting down and closing transmission channel 421 Service shutting down and closing transmission channel
Specific sequences are: Specific sequences are:
CONNECTION ESTABLISHMENT CONNECTION ESTABLISHMENT
S: 220 S: 220
E: 554 E: 554
EHLO or HELO EHLO or HELO
S: 250 S: 250
E: 504, 550 E: 504 (a conforming implementation could return this code only
in fairly obscure cases), 550, 502 (permitted only with an old-
style server that does not support EHLO)
MAIL MAIL
S: 250 S: 250
E: 552, 451, 452, 550, 553, 503 E: 552, 451, 452, 550, 553, 503, 455, 555
RCPT RCPT
S: 250, 251 (but see section 3.4 for discussion of 251 and 551)
E: 550, 551, 552, 553, 450, 451, 452, 503, 550 S: 250, 251 (but see Section 3.4 for discussion of 251 and 551)
E: 550, 551, 552, 553, 450, 451, 452, 503, 455, 555
DATA DATA
I: 354 -> data -> S: 250 I: 354 -> data -> S: 250
E: 552, 554, 451, 452 E: 552, 554, 451, 452
E: 451, 554, 503
E: 450, 550 (rejections for policy reasons)
E: 503, 554
RSET RSET
S: 250 S: 250
VRFY VRFY
S: 250, 251, 252 S: 250, 251, 252
E: 550, 551, 553, 502, 504 E: 550, 551, 553, 502, 504
EXPN EXPN
S: 250, 252 S: 250, 252
E: 550, 500, 502, 504 E: 550, 500, 502, 504
HELP HELP
S: 211, 214 S: 211, 214
E: 502, 504 E: 502, 504
NOOP NOOP
S: 250 S: 250
QUIT QUIT
S: 221 S: 221
4.4 Trace Information 4.4. Trace Information
When an SMTP server receives a message for delivery or further When an SMTP server receives a message for delivery or further
processing, it MUST insert trace ("time stamp" or "Received") processing, it MUST insert trace ("time stamp" or "Received")
information at the beginning of the message content, as discussed in information at the beginning of the message content, as discussed in
section 4.1.1.4. Section 4.1.1.4.
This line MUST be structured as follows: This line MUST be structured as follows:
- The FROM field, which MUST be supplied in an SMTP environment, o The FROM clause, which MUST be supplied in an SMTP environment,
SHOULD contain both (1) the name of the source host as presented SHOULD contain both (1) the name of the source host as presented
in the EHLO command and (2) an address literal containing the IP in the EHLO command and (2) an address literal containing the IP
address of the source, determined from the TCP connection. address of the source, determined from the TCP connection.
- The ID field MAY contain an "@" as suggested in RFC 822, but this o The ID clause MAY contain an "@" as suggested in RFC 822, but this
is not required. is not required.
- The FOR field MAY contain a list of <path> entries when multiple o If the FOR clause appears, it MUST contain exactly one <path>
RCPT commands have been given. This may raise some security entry, even when multiple RCPT commands have been given. Multiple
issues and is usually not desirable; see section 7.2. <path>s raise some security issues and have been deprecated, see
Section 7.2.
An Internet mail program MUST NOT change a Received: line that was An Internet mail program MUST NOT change or delete a Received: line
previously added to the message header. SMTP servers MUST prepend that was previously added to the message header section. SMTP
Received lines to messages; they MUST NOT change the order of servers MUST prepend Received lines to messages; they MUST NOT change
existing lines or insert Received lines in any other location. the order of existing lines or insert Received lines in any other
location.
As the Internet grows, comparability of Received fields is important As the Internet grows, comparability of Received header fields is
for detecting problems, especially slow relays. SMTP servers that important for detecting problems, especially slow relays. SMTP
create Received fields SHOULD use explicit offsets in the dates servers that create Received header fields SHOULD use explicit
(e.g., -0800), rather than time zone names of any type. Local time offsets in the dates (e.g., -0800), rather than time zone names of
(with an offset) is preferred to UT when feasible. This formulation any type. Local time (with an offset) SHOULD be used rather than UT
allows slightly more information about local circumstances to be when feasible. This formulation allows slightly more information
specified. If UT is needed, the receiver need merely do some simple about local circumstances to be specified. If UT is needed, the
arithmetic to convert the values. Use of UT loses information about receiver need merely do some simple arithmetic to convert the values.
the time zone-location of the server. If it is desired to supply a Use of UT loses information about the time zone-location of the
time zone name, it SHOULD be included in a comment. server. If it is desired to supply a time zone name, it SHOULD be
included in a comment.
When the delivery SMTP server makes the "final delivery" of a When the delivery SMTP server makes the "final delivery" of a
message, it inserts a return-path line at the beginning of the mail message, it inserts a return-path line at the beginning of the mail
data. This use of return-path is required; mail systems MUST support data. This use of return-path is required; mail systems MUST support
it. The return-path line preserves the information in the <reverse- it. The return-path line preserves the information in the <reverse-
path> from the MAIL command. Here, final delivery means the message path> from the MAIL command. Here, final delivery means the message
has left the SMTP environment. Normally, this would mean it had been has left the SMTP environment. Normally, this would mean it had been
delivered to the destination user or an associated mail drop, but in delivered to the destination user or an associated mail drop, but in
some cases it may be further processed and transmitted by another some cases it may be further processed and transmitted by another
mail system. mail system.
It is possible for the mailbox in the return path to be different It is possible for the mailbox in the return path to be different
from the actual sender's mailbox, for example, if error responses are from the actual sender's mailbox, for example, if error responses are
to be delivered to a special error handling mailbox rather than to to be delivered to a special error handling mailbox rather than to
the message sender. When mailing lists are involved, this the message sender. When mailing lists are involved, this
arrangement is common and useful as a means of directing errors to arrangement is common and useful as a means of directing errors to
the list maintainer rather than the message originator. the list maintainer rather than the message originator.
The text above implies that the final mail data will begin with a The text above implies that the final mail data will begin with a
return path line, followed by one or more time stamp lines. These return path line, followed by one or more time stamp lines. These
lines will be followed by the mail data headers and body [32]. lines will be followed by the rest of the mail data: first the
balance of the mail header section and then the body (RFC2822 [11]).
It is sometimes difficult for an SMTP server to determine whether or It is sometimes difficult for an SMTP server to determine whether or
not it is making final delivery since forwarding or other operations not it is making final delivery since forwarding or other operations
may occur after the message is accepted for delivery. Consequently, may occur after the message is accepted for delivery. Consequently,
any further (forwarding, gateway, or relay) systems MAY remove the any further (forwarding, gateway, or relay) systems MAY remove the
return path and rebuild the MAIL command as needed to ensure that return path and rebuild the MAIL command as needed to ensure that
exactly one such line appears in a delivered message. exactly one such line appears in a delivered message.
A message-originating SMTP system SHOULD NOT send a message that A message-originating SMTP system SHOULD NOT send a message that
already contains a Return-path header. SMTP servers performing a already contains a Return-path header field. SMTP servers performing
relay function MUST NOT inspect the message data, and especially not a relay function MUST NOT inspect the message data, and especially
to the extent needed to determine if Return-path headers are present. not to the extent needed to determine if Return-path header fields
SMTP servers making final delivery MAY remove Return-path headers are present. SMTP servers making final delivery MAY remove Return-
before adding their own. path header fields before adding their own.
The primary purpose of the Return-path is to designate the address to The primary purpose of the Return-path is to designate the address to
which messages indicating non-delivery or other mail system failures which messages indicating non-delivery or other mail system failures
are to be sent. For this to be unambiguous, exactly one return path are to be sent. For this to be unambiguous, exactly one return path
SHOULD be present when the message is delivered. Systems using RFC SHOULD be present when the message is delivered. Systems using RFC
822 syntax with non-SMTP transports SHOULD designate an unambiguous 822 syntax with non-SMTP transports SHOULD designate an unambiguous
address, associated with the transport envelope, to which error address, associated with the transport envelope, to which error
reports (e.g., non-delivery messages) should be sent. reports (e.g., non-delivery messages) should be sent.
Historical note: Text in RFC 822 that appears to contradict the use Historical note: Text in RFC 822 that appears to contradict the use
of the Return-path header (or the envelope reverse path address from of the Return-path header field (or the envelope reverse path address
the MAIL command) as the destination for error messages is not from the MAIL command) as the destination for error messages is not
applicable on the Internet. The reverse path address (as copied into applicable on the Internet. The reverse path address (as copied into
the Return-path) MUST be used as the target of any mail containing the Return-path) MUST be used as the target of any mail containing
delivery error messages. delivery error messages.
In particular: In particular:
- a gateway from SMTP->elsewhere SHOULD insert a return-path header, o a gateway from SMTP -> elsewhere SHOULD insert a return-path
unless it is known that the "elsewhere" transport also uses header field, unless it is known that the "elsewhere" transport
Internet domain addresses and maintains the envelope sender also uses Internet domain addresses and maintains the envelope
address separately. sender address separately.
- a gateway from elsewhere->SMTP SHOULD delete any return-path o a gateway from elsewhere -> SMTP SHOULD delete any return-path
header present in the message, and either copy that information to header field present in the message, and either copy that
the SMTP envelope or combine it with information present in the information to the SMTP envelope or combine it with information
envelope of the other transport system to construct the reverse present in the envelope of the other transport system to construct
path argument to the MAIL command in the SMTP envelope. the reverse path argument to the MAIL command in the SMTP
envelope.
The server must give special treatment to cases in which the The server must give special treatment to cases in which the
processing following the end of mail data indication is only processing following the end of mail data indication is only
partially successful. This could happen if, after accepting several partially successful. This could happen if, after accepting several
recipients and the mail data, the SMTP server finds that the mail recipients and the mail data, the SMTP server finds that the mail
data could be successfully delivered to some, but not all, of the data could be successfully delivered to some, but not all, of the
recipients. In such cases, the response to the DATA command MUST be recipients. In such cases, the response to the DATA command MUST be
an OK reply. However, the SMTP server MUST compose and send an an OK reply. However, the SMTP server MUST compose and send an
"undeliverable mail" notification message to the originator of the "undeliverable mail" notification message to the originator of the
message. message.
A single notification listing all of the failed recipients or A single notification listing all of the failed recipients or
separate notification messages MUST be sent for each failed separate notification messages MUST be sent for each failed
recipient. For economy of processing by the sender, the former is recipient. For economy of processing by the sender, the former
preferred when possible. All undeliverable mail notification SHOULD be used when possible. Note that the key difference between
messages are sent using the MAIL command (even if they result from handling aliases (Section 3.9.1) and forwarding (this subsection) is
processing the obsolete SEND, SOML, or SAML commands) and use a null the change to the backward-pointing address in this case. All
return path as discussed in section 3.7. notification messages about undeliverable mail MUST be sent using the
MAIL command (even if they result from processing the obsolete SEND,
SOML, or SAML commands) and MUST use a null return path as discussed
in Section 3.6.
The time stamp line and the return path line are formally defined as The time stamp line and the return path line are formally defined as
follows: follows (the definitions for "FWS" and "CFWS" appear in RFC2822
[11]):
Return-path-line = "Return-Path:" FWS Reverse-path <CRLF> Return-path-line = "Return-Path:" FWS Reverse-path <CRLF>
Time-stamp-line = "Received:" FWS Stamp <CRLF> Time-stamp-line = "Received:" FWS Stamp <CRLF>
Stamp = From-domain By-domain Opt-info ";" FWS date-time Stamp = From-domain By-domain Opt-info [CFWS] ";"
FWS date-time
; where "date-time" is as defined in [32] ; where "date-time" is as defined in RFC2822 [11]
; but the "obs-" forms, especially two-digit ; but the "obs-" forms, especially two-digit
; years, are prohibited in SMTP and MUST NOT be used. ; years, are prohibited in SMTP and MUST NOT be used.
From-domain = "FROM" FWS Extended-Domain CFWS From-domain = "FROM" FWS Extended-Domain
By-domain = "BY" FWS Extended-Domain CFWS By-domain = CFWS "BY" FWS Extended-Domain
Extended-Domain = Domain / Extended-Domain = Domain /
( Domain FWS "(" TCP-info ")" ) / ( Domain FWS "(" TCP-info ")" ) /
( Address-literal FWS "(" TCP-info ")" ) ( address-literal FWS "(" TCP-info ")" )
TCP-info = Address-literal / ( Domain FWS Address-literal ) TCP-info = Address-literal / ( Domain FWS address-literal )
; Information derived by server from TCP connection ; Information derived by server from TCP connection
; not client EHLO. ; not client EHLO.
Opt-info = [Via] [With] [ID] [For] Opt-info = [Via] [With] [ID] [For]
[Additional-Registered-Clauses]
Via = "VIA" FWS Link CFWS Via = CFWS "VIA" FWS Link
With = "WITH" FWS Protocol CFWS With = CFWS "WITH" FWS Protocol
ID = "ID" FWS String / msg-id CFWS ID = CFWS "ID" FWS ( Atom / msg-id )
; msg-id is defined in RFC2822 [11]
For = "FOR" FWS 1*( Path / Mailbox ) CFWS For = CFWS "FOR" FWS ( Path / Mailbox )
Additional-Registered-Clauses = CFWS Atom FWS String
; Additional standard clauses may be added in this
; location by future standards and registration with
; IANA. SMTP servers SHOULD NOT use unregistered
; names. See Section 8.
Link = "TCP" / Addtl-Link Link = "TCP" / Addtl-Link
Addtl-Link = Atom Addtl-Link = Atom
; Additional standard names for links are registered with the ; Additional standard names for links are
; Internet Assigned Numbers Authority (IANA). "Via" is ; registered with the Internet Assigned Numbers
; primarily of value with non-Internet transports. SMTP ; Authority (IANA). "Via" is primarily of value
; servers SHOULD NOT use unregistered names. ; with non-Internet transports. SMTP servers
; SHOULD NOT use unregistered names.
Protocol = "ESMTP" / "SMTP" / Attdl-Protocol Protocol = "ESMTP" / "SMTP" / Attdl-Protocol
Attdl-Protocol = Atom Attdl-Protocol = Atom
; Additional standard names for protocols are registered with the ; Additional standard names for protocols are
; Internet Assigned Numbers Authority (IANA). SMTP servers ; registered with the Internet Assigned Numbers
; SHOULD NOT use unregistered names. ; Authority (IANA) in the "mail parameters"
; registry [9]. SMTP servers SHOULD NOT
; use unregistered names.
4.5 Additional Implementation Issues 4.5. Additional Implementation Issues
4.5.1 Minimum Implementation 4.5.1. Minimum Implementation
In order to make SMTP workable, the following minimum implementation In order to make SMTP workable, the following minimum implementation
is required for all receivers. The following commands MUST be MUST be provided by all receivers. The following commands MUST be
supported to conform to this specification: supported to conform to this specification:
EHLO EHLO
HELO HELO
MAIL MAIL
RCPT RCPT
DATA DATA
RSET RSET
NOOP NOOP
QUIT QUIT
VRFY VRFY
Any system that includes an SMTP server supporting mail relaying or Any system that includes an SMTP server supporting mail relaying or
delivery MUST support the reserved mailbox "postmaster" as a case- delivery MUST support the reserved mailbox "postmaster" as a case-
insensitive local name. This postmaster address is not strictly insensitive local name. This postmaster address is not strictly
necessary if the server always returns 554 on connection opening (as necessary if the server always returns 554 on connection opening (as
described in section 3.1). The requirement to accept mail for described in Section 3.1). The requirement to accept mail for
postmaster implies that RCPT commands which specify a mailbox for postmaster implies that RCPT commands which specify a mailbox for
postmaster at any of the domains for which the SMTP server provides postmaster at any of the domains for which the SMTP server provides
mail service, as well as the special case of "RCPT TO:<Postmaster>" mail service, as well as the special case of "RCPT TO:<Postmaster>"
(with no domain specification), MUST be supported. (with no domain specification), MUST be supported.
SMTP systems are expected to make every reasonable effort to accept SMTP systems are expected to make every reasonable effort to accept
mail directed to Postmaster from any other system on the Internet. mail directed to Postmaster from any other system on the Internet.
In extreme cases --such as to contain a denial of service attack or In extreme cases --such as to contain a denial of service attack or
other breach of security-- an SMTP server may block mail directed to other breach of security-- an SMTP server may block mail directed to
Postmaster. However, such arrangements SHOULD be narrowly tailored Postmaster. However, such arrangements SHOULD be narrowly tailored
so as to avoid blocking messages which are not part of such attacks. so as to avoid blocking messages which are not part of such attacks.
4.5.2 Transparency 4.5.2. Transparency
Without some provision for data transparency, the character sequence Without some provision for data transparency, the character sequence
"<CRLF>.<CRLF>" ends the mail text and cannot be sent by the user. "<CRLF>.<CRLF>" ends the mail text and cannot be sent by the user.
In general, users are not aware of such "forbidden" sequences. To In general, users are not aware of such "forbidden" sequences. To
allow all user composed text to be transmitted transparently, the allow all user composed text to be transmitted transparently, the
following procedures are used: following procedures are used:
- Before sending a line of mail text, the SMTP client checks the o Before sending a line of mail text, the SMTP client checks the
first character of the line. If it is a period, one additional first character of the line. If it is a period, one additional
period is inserted at the beginning of the line. period is inserted at the beginning of the line.
- When a line of mail text is received by the SMTP server, it checks o When a line of mail text is received by the SMTP server, it checks
the line. If the line is composed of a single period, it is the line. If the line is composed of a single period, it is
treated as the end of mail indicator. If the first character is a treated as the end of mail indicator. If the first character is a
period and there are other characters on the line, the first period and there are other characters on the line, the first
character is deleted. character is deleted.
The mail data may contain any of the 128 ASCII characters. All The mail data may contain any of the 128 ASCII characters. All
characters are to be delivered to the recipient's mailbox, including characters are to be delivered to the recipient's mailbox, including
spaces, vertical and horizontal tabs, and other control characters. spaces, vertical and horizontal tabs, and other control characters.
If the transmission channel provides an 8-bit byte (octet) data If the transmission channel provides an 8-bit byte (octet) data
stream, the 7-bit ASCII codes are transmitted right justified in the stream, the 7-bit ASCII codes are transmitted right justified in the
octets, with the high order bits cleared to zero. See 3.7 for octets, with the high order bits cleared to zero. See Section 3.6
special treatment of these conditions in SMTP systems serving a relay for special treatment of these conditions in SMTP systems serving a
function. relay function.
In some systems it may be necessary to transform the data as it is In some systems it may be necessary to transform the data as it is
received and stored. This may be necessary for hosts that use a received and stored. This may be necessary for hosts that use a
different character set than ASCII as their local character set, that different character set than ASCII as their local character set, that
store data in records rather than strings, or which use special store data in records rather than strings, or which use special
character sequences as delimiters inside mailboxes. If such character sequences as delimiters inside mailboxes. If such
transformations are necessary, they MUST be reversible, especially if transformations are necessary, they MUST be reversible, especially if
they are applied to mail being relayed. they are applied to mail being relayed.
4.5.3 Sizes and Timeouts 4.5.3. Sizes and Timeouts
4.5.3.1 Size limits and minimums 4.5.3.1. Size limits and minimums
There are several objects that have required minimum/maximum sizes. There are several objects that have required minimum/maximum sizes.
Every implementation MUST be able to receive objects of at least Every implementation MUST be able to receive objects of at least
these sizes. Objects larger than these sizes SHOULD be avoided when these sizes. Objects larger than these sizes SHOULD be avoided when
possible. However, some Internet mail constructs such as encoded possible. However, some Internet mail constructs such as encoded
X.400 addresses [16] will often require larger objects: clients MAY X.400 addresses (RFC 2156 [30]) will often require larger objects.
attempt to transmit these, but MUST be prepared for a server to Clients MAY attempt to transmit these, but MUST be prepared for a
reject them if they cannot be handled by it. To the maximum extent server to reject them if they cannot be handled by it. To the
possible, implementation techniques which impose no limits on the maximum extent possible, implementation techniques which impose no
length of these objects should be used. limits on the length of these objects should be used.
Extensions to SMTP may involve the use of characters that occupy more
than a single octet each. This section therefore specifies lengths
in octets where absolute lengths, rather than character counts, are
intended.
4.5.3.1.1. local-part
local-part
The maximum total length of a user name or other local-part is 64 The maximum total length of a user name or other local-part is 64
characters. octets.
domain 4.5.3.1.2. domain
The maximum total length of a domain name or number is 255
characters. The maximum total length of a domain name or number is 255 octets.
4.5.3.1.3. path
path
The maximum total length of a reverse-path or forward-path is 256 The maximum total length of a reverse-path or forward-path is 256
characters (including the punctuation and element separators). octets (including the punctuation and element separators).
command line 4.5.3.1.4. command line
The maximum total length of a command line including the command
word and the <CRLF> is 512 characters. SMTP extensions may be
used to increase this limit.
reply line The maximum total length of a command line including the command word
The maximum total length of a reply line including the reply code and the <CRLF> is 512 octets. SMTP extensions may be used to
and the <CRLF> is 512 characters. More information may be increase this limit.
conveyed through multiple-line replies.
text line 4.5.3.1.5. reply line
The maximum total length of a text line including the <CRLF> is
1000 characters (not counting the leading dot duplicated for
transparency). This number may be increased by the use of SMTP
Service Extensions.
message content The maximum total length of a reply line including the reply code and
The maximum total length of a message content (including any the <CRLF> is 512 octets. More information may be conveyed through
message headers as well as the message body) MUST BE at least 64K multiple-line replies.
octets. Since the introduction of Internet standards for
multimedia mail [12], message lengths on the Internet have grown
dramatically, and message size restrictions should be avoided if
at all possible. SMTP server systems that must impose
restrictions SHOULD implement the "SIZE" service extension [18],
and SMTP client systems that will send large messages SHOULD
utilize it when possible.
recipients buffer 4.5.3.1.6. text line
The minimum total number of recipients that must be buffered is
100 recipients. Rejection of messages (for excessive recipients) The maximum total length of a text line including the <CRLF> is 1000
with fewer than 100 RCPT commands is a violation of this octets (not counting the leading dot duplicated for transparency).
specification. The general principle that relaying SMTP servers This number may be increased by the use of SMTP Service Extensions.
MUST NOT, and delivery SMTP servers SHOULD NOT, perform validation
tests on message headers suggests that rejecting a message based 4.5.3.1.7. message content
on the total number of recipients shown in header fields is to be
discouraged. A server which imposes a limit on the number of The maximum total length of a message content (including any message
recipients MUST behave in an orderly fashion, such as to reject header section as well as the message body) MUST BE at least 64K
additional addresses over its limit rather than silently octets. Since the introduction of Internet standards for multimedia
discarding addresses previously accepted. A client that needs to mail (RFC2045 [28]), message lengths on the Internet have grown
deliver a message containing over 100 RCPT commands SHOULD be dramatically, and message size restrictions should be avoided if at
prepared to transmit in 100-recipient "chunks" if the server all possible. SMTP server systems that must impose restrictions
declines to accept more than 100 recipients in a single message. SHOULD implement the "SIZE" service extension of RFC 1870 [4], and
SMTP client systems that will send large messages SHOULD utilize it
when possible.
4.5.3.1.8. recipients buffer
The minimum total number of recipients that MUST be buffered is 100
recipients. Rejection of messages (for excessive recipients) with
fewer than 100 RCPT commands is a violation of this specification.
The general principle that relaying SMTP server MUST NOT, and
delivery SMTP servers SHOULD NOT, perform validation tests on message
header fields suggests that messages SHOULD NOT be rejected based on
the total number of recipients shown in header fields. A server that
imposes a limit on the number of recipients MUST behave in an orderly
fashion, such as rejecting additional addresses over its limit rather
than silently discarding addresses previously accepted. A client
that needs to deliver a message containing over 100 RCPT commands
SHOULD be prepared to transmit in 100-recipient "chunks" if the
server declines to accept more than 100 recipients in a single
message.
4.5.3.1.9. Treatment When Limits Exceeded
Errors due to exceeding these limits may be reported by using the Errors due to exceeding these limits may be reported by using the
reply codes. Some examples of reply codes are: reply codes. Some examples of reply codes are:
500 Line too long. 500 Line too long.
or or
501 Path too long 501 Path too long
or or
452 Too many recipients (see below) 452 Too many recipients (see below)
or or
552 Too much mail data. 552 Too much mail data.
RFC 821 [30] incorrectly listed the error where an SMTP server 4.5.3.1.10. Too Many Recipients code
exhausts its implementation limit on the number of RCPT commands
("too many recipients") as having reply code 552. The correct reply RFC821 [8] incorrectly listed the error where an SMTP server exhausts
code for this condition is 452. Clients SHOULD treat a 552 code in its implementation limit on the number of RCPT commands ("too many
this case as a temporary, rather than permanent, failure so the logic recipients") as having reply code 552. The correct reply code for
below works. this condition is 452. Clients SHOULD treat a 552 code in this case
as a temporary, rather than permanent, failure so the logic below
works.
When a conforming SMTP server encounters this condition, it has at When a conforming SMTP server encounters this condition, it has at
least 100 successful RCPT commands in its recipients buffer. If the least 100 successful RCPT commands in its recipients buffer. If the
server is able to accept the message, then at least these 100 server is able to accept the message, then at least these 100
addresses will be removed from the SMTP client's queue. When the addresses will be removed from the SMTP client's queue. When the
client attempts retransmission of those addresses which received 452 client attempts retransmission of those addresses which received 452
responses, at least 100 of these will be able to fit in the SMTP responses, at least 100 of these will be able to fit in the SMTP
server's recipients buffer. Each retransmission attempt which is server's recipients buffer. Each retransmission attempt which is
able to deliver anything will be able to dispose of at least 100 of able to deliver anything will be able to dispose of at least 100 of
these recipients. these recipients.
If an SMTP server has an implementation limit on the number of RCPT If an SMTP server has an implementation limit on the number of RCPT
commands and this limit is exhausted, it MUST use a response code of commands and this limit is exhausted, it MUST use a response code of
452 (but the client SHOULD also be prepared for a 552, as noted 452 (but the client SHOULD also be prepared for a 552, as noted
above). If the server has a configured site-policy limitation on the above). If the server has a configured site-policy limitation on the
number of RCPT commands, it MAY instead use a 5XX response code. number of RCPT commands, it MAY instead use a 5yz response code. In
This would be most appropriate if the policy limitation was intended particular, if the intent is to prohibit messages with more than a
to apply if the total recipient count for a particular message body site-specified number of recipients, rather than merely limit the
were enforced even if that message body was sent in multiple mail number of recipients in a given mail transaction, it would be
transactions. reasonable to return a 503 response to any DATA command received
subsequent to the 452 (or 552) code or to simply return the 503 after
DATA without returning any previous negative response.
4.5.3.2 Timeouts 4.5.3.2. Timeouts
An SMTP client MUST provide a timeout mechanism. It MUST use per- An SMTP client MUST provide a timeout mechanism. It MUST use per-
command timeouts rather than somehow trying to time the entire mail command timeouts rather than somehow trying to time the entire mail
transaction. Timeouts SHOULD be easily reconfigurable, preferably transaction. Timeouts SHOULD be easily reconfigurable, preferably
without recompiling the SMTP code. To implement this, a timer is set without recompiling the SMTP code. To implement this, a timer is set
for each SMTP command and for each buffer of the data transfer. The for each SMTP command and for each buffer of the data transfer. The
latter means that the overall timeout is inherently proportional to latter means that the overall timeout is inherently proportional to
the size of the message. the size of the message.
Based on extensive experience with busy mail-relay hosts, the minimum Based on extensive experience with busy mail-relay hosts, the minimum
per-command timeout values SHOULD be as follows: per-command timeout values SHOULD be as follows:
Initial 220 Message: 5 minutes 4.5.3.2.1. Initial 220 Message: 5 minutes
An SMTP client process needs to distinguish between a failed TCP An SMTP client process needs to distinguish between a failed TCP
connection and a delay in receiving the initial 220 greeting connection and a delay in receiving the initial 220 greeting message.
message. Many SMTP servers accept a TCP connection but delay Many SMTP servers accept a TCP connection but delay delivery of the
delivery of the 220 message until their system load permits more 220 message until their system load permits more mail to be
mail to be processed. processed.
MAIL Command: 5 minutes 4.5.3.2.2. MAIL Command: 5 minutes
4.5.3.2.3. RCPT Command: 5 minutes
RCPT Command: 5 minutes
A longer timeout is required if processing of mailing lists and A longer timeout is required if processing of mailing lists and
aliases is not deferred until after the message was accepted. aliases is not deferred until after the message was accepted.
DATA Initiation: 2 minutes 4.5.3.2.4. DATA Initiation: 2 minutes
This is while awaiting the "354 Start Input" reply to a DATA
command. This is while awaiting the "354 Start Input" reply to a DATA command.
4.5.3.2.5. Data Block: 3 minutes
Data Block: 3 minutes
This is while awaiting the completion of each TCP SEND call This is while awaiting the completion of each TCP SEND call
transmitting a chunk of data. transmitting a chunk of data.
DATA Termination: 10 minutes. 4.5.3.2.6. DATA Termination: 10 minutes.
This is while awaiting the "250 OK" reply. When the receiver gets This is while awaiting the "250 OK" reply. When the receiver gets
the final period terminating the message data, it typically the final period terminating the message data, it typically performs
performs processing to deliver the message to a user mailbox. A processing to deliver the message to a user mailbox. A spurious
spurious timeout at this point would be very wasteful and would timeout at this point would be very wasteful and would typically
typically result in delivery of multiple copies of the message, result in delivery of multiple copies of the message, since it has
since it has been successfully sent and the server has accepted been successfully sent and the server has accepted responsibility for
responsibility for delivery. See section 6.1 for additional delivery. See Section 6.1 for additional discussion.
discussion.
4.5.3.2.7. Server Timeout: 5 minutes.
An SMTP server SHOULD have a timeout of at least 5 minutes while it An SMTP server SHOULD have a timeout of at least 5 minutes while it
is awaiting the next command from the sender. is awaiting the next command from the sender.
4.5.4 Retry Strategies 4.5.4. Retry Strategies
The common structure of a host SMTP implementation includes user The common structure of a host SMTP implementation includes user
mailboxes, one or more areas for queuing messages in transit, and one mailboxes, one or more areas for queuing messages in transit, and one
or more daemon processes for sending and receiving mail. The exact or more daemon processes for sending and receiving mail. The exact
structure will vary depending on the needs of the users on the host structure will vary depending on the needs of the users on the host
and the number and size of mailing lists supported by the host. We and the number and size of mailing lists supported by the host. We
describe several optimizations that have proved helpful, particularly describe several optimizations that have proved helpful, particularly
for mailers supporting high traffic levels. for mailers supporting high traffic levels.
Any queuing strategy MUST include timeouts on all activities on a Any queuing strategy MUST include timeouts on all activities on a
per-command basis. A queuing strategy MUST NOT send error messages per-command basis. A queuing strategy MUST NOT send error messages
in response to error messages under any circumstances. in response to error messages under any circumstances.
4.5.4.1 Sending Strategy 4.5.4.1. Sending Strategy
The general model for an SMTP client is one or more processes that The general model for an SMTP client is one or more processes that
periodically attempt to transmit outgoing mail. In a typical system, periodically attempt to transmit outgoing mail. In a typical system,
the program that composes a message has some method for requesting the program that composes a message has some method for requesting
immediate attention for a new piece of outgoing mail, while mail that immediate attention for a new piece of outgoing mail, while mail that
cannot be transmitted immediately MUST be queued and periodically cannot be transmitted immediately MUST be queued and periodically
retried by the sender. A mail queue entry will include not only the retried by the sender. A mail queue entry will include not only the
message itself but also the envelope information. message itself but also the envelope information.
The sender MUST delay retrying a particular destination after one The sender MUST delay retrying a particular destination after one
attempt has failed. In general, the retry interval SHOULD be at attempt has failed. In general, the retry interval SHOULD be at
least 30 minutes; however, more sophisticated and variable strategies least 30 minutes; however, more sophisticated and variable strategies
will be beneficial when the SMTP client can determine the reason for will be beneficial when the SMTP client can determine the reason for
non-delivery. non-delivery.
Retries continue until the message is transmitted or the sender gives Retries continue until the message is transmitted or the sender gives
up; the give-up time generally needs to be at least 4-5 days. The up; the give-up time generally needs to be at least 4-5 days. It MAY
parameters to the retry algorithm MUST be configurable. be appropriate to set a shorter maximum number of retries for non-
delivery notifications and equivalent error messages than for
standard messages. The parameters to the retry algorithm MUST be
configurable.
A client SHOULD keep a list of hosts it cannot reach and A client SHOULD keep a list of hosts it cannot reach and
corresponding connection timeouts, rather than just retrying queued corresponding connection timeouts, rather than just retrying queued
mail items. mail items.
Experience suggests that failures are typically transient (the target Experience suggests that failures are typically transient (the target
system or its connection has crashed), favoring a policy of two system or its connection has crashed), favoring a policy of two
connection attempts in the first hour the message is in the queue, connection attempts in the first hour the message is in the queue,
and then backing off to one every two or three hours. and then backing off to one every two or three hours.
The SMTP client can shorten the queuing delay in cooperation with the The SMTP client can shorten the queuing delay in cooperation with the
SMTP server. For example, if mail is received from a particular SMTP server. For example, if mail is received from a particular
address, it is likely that mail queued for that host can now be sent. address, it is likely that mail queued for that host can now be sent.
Application of this principle may, in many cases, eliminate the Application of this principle may, in many cases, eliminate the
requirement for an explicit "send queues now" function such as ETRN requirement for an explicit "send queues now" function such as ETRN,
[9]. RFC1985 [27].
The strategy may be further modified as a result of multiple The strategy may be further modified as a result of multiple
addresses per host (see below) to optimize delivery time vs. resource addresses per host (see below) to optimize delivery time vs. resource
usage. usage.
An SMTP client may have a large queue of messages for each An SMTP client may have a large queue of messages for each
unavailable destination host. If all of these messages were retried unavailable destination host. If all of these messages were retried
in every retry cycle, there would be excessive Internet overhead and in every retry cycle, there would be excessive Internet overhead and
the sending system would be blocked for a long period. Note that an the sending system would be blocked for a long period. Note that an
SMTP client can generally determine that a delivery attempt has SMTP client can generally determine that a delivery attempt has
skipping to change at page 59, line 28 skipping to change at page 68, line 22
answers may be returned by the server. More significantly, 5yz answers may be returned by the server. More significantly, 5yz
responses to the MAIL command MUST NOT be cached. responses to the MAIL command MUST NOT be cached.
When a mail message is to be delivered to multiple recipients, and When a mail message is to be delivered to multiple recipients, and
the SMTP server to which a copy of the message is to be sent is the the SMTP server to which a copy of the message is to be sent is the
same for multiple recipients, then only one copy of the message same for multiple recipients, then only one copy of the message
SHOULD be transmitted. That is, the SMTP client SHOULD use the SHOULD be transmitted. That is, the SMTP client SHOULD use the
command sequence: MAIL, RCPT, RCPT,... RCPT, DATA instead of the command sequence: MAIL, RCPT, RCPT,... RCPT, DATA instead of the
sequence: MAIL, RCPT, DATA, ..., MAIL, RCPT, DATA. However, if there sequence: MAIL, RCPT, DATA, ..., MAIL, RCPT, DATA. However, if there
are very many addresses, a limit on the number of RCPT commands per are very many addresses, a limit on the number of RCPT commands per
MAIL command MAY be imposed. Implementation of this efficiency MAIL command MAY be imposed. This efficiency feature SHOULD be
feature is strongly encouraged. implemented.
Similarly, to achieve timely delivery, the SMTP client MAY support Similarly, to achieve timely delivery, the SMTP client MAY support
multiple concurrent outgoing mail transactions. However, some limit multiple concurrent outgoing mail transactions. However, some limit
may be appropriate to protect the host from devoting all its may be appropriate to protect the host from devoting all its
resources to mail. resources to mail.
4.5.4.2 Receiving Strategy 4.5.4.2. Receiving Strategy
The SMTP server SHOULD attempt to keep a pending listen on the SMTP The SMTP server SHOULD attempt to keep a pending listen on the SMTP
port at all times. This requires the support of multiple incoming port (specified by IANA as port 25) at all times. This requires the
TCP connections for SMTP. Some limit MAY be imposed but servers that support of multiple incoming TCP connections for SMTP. Some limit
cannot handle more than one SMTP transaction at a time are not in MAY be imposed but servers that cannot handle more than one SMTP
conformance with the intent of this specification. transaction at a time are not in conformance with the intent of this
specification.
As discussed above, when the SMTP server receives mail from a As discussed above, when the SMTP server receives mail from a
particular host address, it could activate its own SMTP queuing particular host address, it could activate its own SMTP queuing
mechanisms to retry any mail pending for that host address. mechanisms to retry any mail pending for that host address.
4.5.5 Messages with a null reverse-path 4.5.5. Messages with a null reverse-path
There are several types of notification messages which are required There are several types of notification messages which are required
by existing and proposed standards to be sent with a null reverse by existing and proposed standards to be sent with a null reverse
path, namely non-delivery notifications as discussed in section 3.7, path, namely non-delivery notifications as discussed in Section 3.7,
other kinds of Delivery Status Notifications (DSNs) [24], and also other kinds of Delivery Status Notifications (DSNs, RFC3461 [12]),
Message Disposition Notifications (MDNs) [10]. All of these kinds of and also Message Disposition Notifications (MDNs, RFC3798 [39]). All
messages are notifications about a previous message, and they are of these kinds of messages are notifications about a previous
sent to the reverse-path of the previous mail message. (If the message, and they are sent to the reverse-path of the previous mail
delivery of such a notification message fails, that usually indicates message. (If the delivery of such a notification message fails, that
a problem with the mail system of the host to which the notification usually indicates a problem with the mail system of the host to which
message is addressed. For this reason, at some hosts the MTA is set the notification message is addressed. For this reason, at some
up to forward such failed notification messages to someone who is hosts the MTA is set up to forward such failed notification messages
able to fix problems with the mail system, e.g., via the postmaster to someone who is able to fix problems with the mail system, e.g.,
alias.) via the postmaster alias.)
All other types of messages (i.e., any message which is not required All other types of messages (i.e., any message which is not required
by a standards-track RFC to have a null reverse-path) SHOULD be sent by a standards-track RFC to have a null reverse-path) SHOULD be sent
with with a valid, non-null reverse-path. with a valid, non-null reverse-path.
Implementors of automated email processors should be careful to make Implementers of automated email processors should be careful to make
sure that the various kinds of messages with null reverse-path are sure that the various kinds of messages with a null reverse-path are
handled correctly, in particular such systems SHOULD NOT reply to handled correctly. In particular such systems SHOULD NOT reply to
messages with null reverse-path. messages with a null reverse-path and they SHOULD NOT add a non-null
reverse-path, or change a null reverse-path to a non-null one, to
such messages when forwarding.
5. Address Resolution and Mail Handling 5. Address Resolution and Mail Handling
5.1. Locating the Target Host
Once an SMTP client lexically identifies a domain to which mail will Once an SMTP client lexically identifies a domain to which mail will
be delivered for processing (as described in sections 3.6 and 3.7), a be delivered for processing (as described in sections Section 2.3.5
DNS lookup MUST be performed to resolve the domain name [22]. The and Section 3.6), a DNS lookup MUST be performed to resolve the
names are expected to be fully-qualified domain names (FQDNs): domain name (RFC1035 [7]). The names are expected to be fully-
mechanisms for inferring FQDNs from partial names or local aliases qualified domain names (FQDNs): mechanisms for inferring FQDNs from
are outside of this specification and, due to a history of problems, partial names or local aliases are outside of this specification.
are generally discouraged. The lookup first attempts to locate an MX Due to a history of problems, SMTP servers used for initial
record associated with the name. If a CNAME record is found instead, submission of messages SHOULD NOT make such inferences (Message
the resulting name is processed as if it were the initial name. If Submission Servers [42] have somewhat more flexibility) and
no MX records are found, but an A RR is found, the A RR is treated as intermediate (relay) SMTP servers MUST NOT make them.
if it was associated with an implicit MX RR, with a preference of 0,
pointing to that host. If one or more MX RRs are found for a given The lookup first attempts to locate an MX record associated with the
name, SMTP systems MUST NOT utilize any A RRs associated with that name. If a CNAME record is found, the resulting name is processed as
name unless they are located using the MX RRs; the "implicit MX" rule if it were the initial name. If a non-existent domain error is
above applies only if there are no MX records present. If MX records returned, this situation MUST be reported as an error. If a
are present, but none of them are usable, this situation MUST be temporary error is returned, the message MUST be queued and retried
reported as an error. later (See Section 4.5.4.1). If an empty list of MXs is returned,
the address is treated as if it was associated with an implicit MX
RR, with a preference of 0, pointing to that host. If MX records are
present, but none of them are usable, or the implicit MX is unusable,
this situation MUST be reported as an error.
If one or more MX RRs are found for a given name, SMTP systems MUST
NOT utilize any address RRs associated with that name unless they are
located using the MX RRs; the "implicit MX" rule above applies only
if there are no MX records present. If MX records are present, but
none of them are usable, this situation MUST be reported as an error.
When a domain name associated with an MX RR is looked up and the
associated data field obtained, the data field of that response MUST
contain a domain-name. That domain-name, when queried, MUST return
at least one address record (e.g., A or AAAA RR) that gives the IP
address of the SMTP server to which the message should be directed.
Any other response, specifically including a value that will return a
CNAME record when queried, lies outside the scope of this standard.
The prohibition on labels in the data that resolve to CNAMEs is
discussed in more detail in RFC 2181, Section 10.3 [31].
When the lookup succeeds, the mapping can result in a list of When the lookup succeeds, the mapping can result in a list of
alternative delivery addresses rather than a single address, because alternative delivery addresses rather than a single address, because
of multiple MX records, multihoming, or both. To provide reliable of multiple MX records, multihoming, or both. To provide reliable
mail transmission, the SMTP client MUST be able to try (and retry) mail transmission, the SMTP client MUST be able to try (and retry)
each of the relevant addresses in this list in order, until a each of the relevant addresses in this list in order, until a
delivery attempt succeeds. However, there MAY also be a configurable delivery attempt succeeds. However, there MAY also be a configurable
limit on the number of alternate addresses that can be tried. In any limit on the number of alternate addresses that can be tried. In any
case, the SMTP client SHOULD try at least two addresses. case, the SMTP client SHOULD try at least two addresses.
Two types of information is used to rank the host addresses: multiple Two types of information are used to rank the host addresses:
MX records, and multihomed hosts. multiple MX records, and multihomed hosts.
Multiple MX records contain a preference indication that MUST be used MX records contain a preference indication that MUST be used in
in sorting (see below). Lower numbers are more preferred than higher sorting if more than one such record appears (see below). Lower
ones. If there are multiple destinations with the same preference numbers are more preferred than higher ones. If there are multiple
and there is no clear reason to favor one (e.g., by recognition of an destinations with the same preference and there is no clear reason to
easily-reached address), then the sender-SMTP MUST randomize them to favor one (e.g., by recognition of an easily-reached address), then
spread the load across multiple mail exchangers for a specific the sender-SMTP MUST randomize them to spread the load across
organization. multiple mail exchangers for a specific organization.
The destination host (perhaps taken from the preferred MX record) may The destination host (perhaps taken from the preferred MX record) may
be multihomed, in which case the domain name resolver will return a be multihomed, in which case the domain name resolver will return a
list of alternative IP addresses. It is the responsibility of the list of alternative IP addresses. It is the responsibility of the
domain name resolver interface to have ordered this list by domain name resolver interface to have ordered this list by
decreasing preference if necessary, and SMTP MUST try them in the decreasing preference if necessary, and the SMTP sender MUST try them
order presented. in the order presented.
Although the capability to try multiple alternative addresses is Although the capability to try multiple alternative addresses is
required, specific installations may want to limit or disable the use required, specific installations may want to limit or disable the use
of alternative addresses. The question of whether a sender should of alternative addresses. The question of whether a sender should
attempt retries using the different addresses of a multihomed host attempt retries using the different addresses of a multihomed host
has been controversial. The main argument for using the multiple has been controversial. The main argument for using the multiple
addresses is that it maximizes the probability of timely delivery, addresses is that it maximizes the probability of timely delivery,
and indeed sometimes the probability of any delivery; the counter- and indeed sometimes the probability of any delivery; the counter-
argument is that it may result in unnecessary resource use. Note argument is that it may result in unnecessary resource use. Note
that resource use is also strongly determined by the sending strategy that resource use is also strongly determined by the sending strategy
discussed in section 4.5.4.1. discussed in Section 4.5.4.1.
If an SMTP server receives a message with a destination for which it If an SMTP server receives a message with a destination for which it
is a designated Mail eXchanger, it MAY relay the message (potentially is a designated Mail eXchanger, it MAY relay the message (potentially
after having rewritten the MAIL FROM and/or RCPT TO addresses), make after having rewritten the MAIL FROM and/or RCPT TO addresses), make
final delivery of the message, or hand it off using some mechanism final delivery of the message, or hand it off using some mechanism
outside the SMTP-provided transport environment. Of course, neither outside the SMTP-provided transport environment. Of course, neither
of the latter require that the list of MX records be examined of the latter require that the list of MX records be examined
further. further.
If it determines that it should relay the message without rewriting If it determines that it should relay the message without rewriting
skipping to change at page 62, line 5 skipping to change at page 71, line 27
delivery. The records are first ordered by preference, with the delivery. The records are first ordered by preference, with the
lowest-numbered records being most preferred. The relay host MUST lowest-numbered records being most preferred. The relay host MUST
then inspect the list for any of the names or addresses by which it then inspect the list for any of the names or addresses by which it
might be known in mail transactions. If a matching record is found, might be known in mail transactions. If a matching record is found,
all records at that preference level and higher-numbered ones MUST be all records at that preference level and higher-numbered ones MUST be
discarded from consideration. If there are no records left at that discarded from consideration. If there are no records left at that
point, it is an error condition, and the message MUST be returned as point, it is an error condition, and the message MUST be returned as
undeliverable. If records do remain, they SHOULD be tried, best undeliverable. If records do remain, they SHOULD be tried, best
preference first, as described above. preference first, as described above.
5.2. IPv6 and MX Records
In the contemporary Internet, SMTP clients and servers may be hosted
on IPv4 systems, IPv6 systems, or dual-stack systems that are
compatible with either version of the Internet Protocol. The host
domains to which MX records point may, consequently, contain "A RR"s
(IPv4), "AAAA RR"s (IPv6), or any combination of them. While RFC
3974 [14] discusses some operational experience in mixed
environments, it was not comprehensive enough to justify
standardization and some of its recommendations appear to be
inconsistent with this specification. The appropriate actions to be
taken will either depend on local circumstances, such as performance
of the relevant networks and any conversions that might be necessary,
or will be obvious (e.g., an IPv6-only client need not attempt to
look up A RRs or attempt to reach IPv4-only servers). Designers of
SMTP implementations that might run in IPv6 or dual stack
environments should study the procedures above, especially the
comments about multihomed hosts, and, preferably, provide mechanisms
to facilitate operational tuning and mail interoperability between
IPv4 and IPv6 systems while considering local circumstances.
6. Problem Detection and Handling 6. Problem Detection and Handling
6.1 Reliable Delivery and Replies by Email 6.1. Reliable Delivery and Replies by Email
When the receiver-SMTP accepts a piece of mail (by sending a "250 OK" When the receiver-SMTP accepts a piece of mail (by sending a "250 OK"
message in response to DATA), it is accepting responsibility for message in response to DATA), it is accepting responsibility for
delivering or relaying the message. It must take this responsibility delivering or relaying the message. It must take this responsibility
seriously. It MUST NOT lose the message for frivolous reasons, such seriously. It MUST NOT lose the message for frivolous reasons, such
as because the host later crashes or because of a predictable as because the host later crashes or because of a predictable
resource shortage. resource shortage. Some reasons that are not considered frivolous
are discussed in the next subsection and in Section 7.8.
If there is a delivery failure after acceptance of a message, the If there is a delivery failure after acceptance of a message, the
receiver-SMTP MUST formulate and mail a notification message. This receiver-SMTP MUST formulate and mail a notification message. This
notification MUST be sent using a null ("<>") reverse path in the notification MUST be sent using a null ("<>") reverse path in the
envelope. The recipient of this notification MUST be the address envelope. The recipient of this notification MUST be the address
from the envelope return path (or the Return-Path: line). However, from the envelope return path (or the Return-Path: line). However,
if this address is null ("<>"), the receiver-SMTP MUST NOT send a if this address is null ("<>"), the receiver-SMTP MUST NOT send a
notification. Obviously, nothing in this section can or should notification. Obviously, nothing in this section can or should
prohibit local decisions (i.e., as part of the same system prohibit local decisions (i.e., as part of the same system
environment as the receiver-SMTP) to log or otherwise transmit environment as the receiver-SMTP) to log or otherwise transmit
skipping to change at page 62, line 48 skipping to change at page 72, line 47
Some delivery failures after the message is accepted by SMTP will be Some delivery failures after the message is accepted by SMTP will be
unavoidable. For example, it may be impossible for the receiving unavoidable. For example, it may be impossible for the receiving
SMTP server to validate all the delivery addresses in RCPT command(s) SMTP server to validate all the delivery addresses in RCPT command(s)
due to a "soft" domain system error, because the target is a mailing due to a "soft" domain system error, because the target is a mailing
list (see earlier discussion of RCPT), or because the server is list (see earlier discussion of RCPT), or because the server is
acting as a relay and has no immediate access to the delivering acting as a relay and has no immediate access to the delivering
system. system.
To avoid receiving duplicate messages as the result of timeouts, a To avoid receiving duplicate messages as the result of timeouts, a
receiver-SMTP MUST seek to minimize the time required to respond to receiver-SMTP MUST seek to minimize the time required to respond to
the final <CRLF>.<CRLF> end of data indicator. See RFC 1047 [28] for the final <CRLF>.<CRLF> end of data indicator. See RFC1047 [20] for
a discussion of this problem. a discussion of this problem.
6.2 Loop Detection 6.2. Unwanted, unsolicited, and "attack" messages
Simple counting of the number of "Received:" headers in a message has Utility and predictability of the Internet mail system requires that
proven to be an effective, although rarely optimal, method of messages that can be delivered should be delivered, regardless of any
detecting loops in mail systems. SMTP servers using this technique syntax or other faults associated with those messages and regardless
SHOULD use a large rejection threshold, normally at least 100 of their content. If they cannot be delivered, and cannot be
Received entries. Whatever mechanisms are used, servers MUST contain rejected by the SMTP server during the SMTP transaction, they should
provisions for detecting and stopping trivial loops. be "bounced" (returned with non-delivery notification messages) as
described above. In today's world, in which many SMTP server
operators have discovered that the quantity of undesirable bulk email
vastly exceeds the quantity of desired mail and in which accepting a
message may trigger additional undesirable traffic by providing
verification of the address, those principles may not be practical.
6.3 Compensating for Irregularities As discussed in Section 7.8 and Section 7.9 below, dropping mail
without notification of the sender is permitted in practice.
However, it is extremely dangerous and violates a long tradition and
community expectations that mail is either delivered or returned. If
silent message-dropping is misused, it could easily undermine
confidence in the reliability of the Internet's mail systems. So
silent dropping of messages should be considered only in those cases
where there is very high confidence that the messages are seriously
fraudulent or otherwise inappropriate.
To stretch the principle of delivery if possible even further, it may
be a rational policy to not deliver mail that has an invalid return
address, although the history of the network is that users are
typically better served by delivering any message that can be
delivered. Reliably determining that a return address is invalid can
be a difficult and time-consuming process, especially if the putative
sending system is not directly accessible or doesn't fully and
accurately support VRFY and, even if a "drop messages with invalid
return addresses" policy is adopted, it SHOULD be applied only when
there is near-certainty that the return addresses are, in fact,
invalid.
Conversely, if a message is rejected because it is found to contain
hostile content (a decision that is outside the scope of an SMTP
server as defined in this document), rejection ("bounce") messages
SHOULD NOT be sent unless the receiving site is confident that those
messages will be usefully delivered. The preference and default in
these cases is to avoid sending non-delivery messages when the
incoming message is determined to contain hostile content.
6.3. Loop Detection
Simple counting of the number of "Received:" header fields in a
message has proven to be an effective, although rarely optimal,
method of detecting loops in mail systems. SMTP servers using this
technique SHOULD use a large rejection threshold, normally at least
100 Received entries. Whatever mechanisms are used, servers MUST
contain provisions for detecting and stopping trivial loops.
6.4. Compensating for Irregularities
Unfortunately, variations, creative interpretations, and outright Unfortunately, variations, creative interpretations, and outright
violations of Internet mail protocols do occur; some would suggest violations of Internet mail protocols do occur; some would suggest
that they occur quite frequently. The debate as to whether a well- that they occur quite frequently. The debate as to whether a well-
behaved SMTP receiver or relay should reject a malformed message, behaved SMTP receiver or relay should reject a malformed message,
attempt to pass it on unchanged, or attempt to repair it to increase attempt to pass it on unchanged, or attempt to repair it to increase
the odds of successful delivery (or subsequent reply) began almost the odds of successful delivery (or subsequent reply) began almost
with the dawn of structured network mail and shows no signs of with the dawn of structured network mail and shows no signs of
abating. Advocates of rejection claim that attempted repairs are abating. Advocates of rejection claim that attempted repairs are
rarely completely adequate and that rejection of bad messages is the rarely completely adequate and that rejection of bad messages is the
only way to get the offending software repaired. Advocates of only way to get the offending software repaired. Advocates of
"repair" or "deliver no matter what" argue that users prefer that "repair" or "deliver no matter what" argue that users prefer that
mail go through it if at all possible and that there are significant mail go through it if at all possible and that there are significant
market pressures in that direction. In practice, these market market pressures in that direction. In practice, these market
pressures may be more important to particular vendors than strict pressures may be more important to particular vendors than strict
conformance to the standards, regardless of the preference of the conformance to the standards, regardless of the preference of the
actual developers. actual developers.
The problems associated with ill-formed messages were exacerbated by The problems associated with ill-formed messages were exacerbated by
the introduction of the split-UA mail reading protocols [3, 26, 5, the introduction of the split-UA mail reading protocols (Post Office
21]. These protocols have encouraged the use of SMTP as a posting Protocol (POP) version 2 [17], Post Office Protocol (POP) version 3
[26], IMAP version 2 [22], and PCMAIL [21]). These protocols
encouraged the use of SMTP as a posting (message submission)
protocol, and SMTP servers as relay systems for these client hosts protocol, and SMTP servers as relay systems for these client hosts
(which are often only intermittently connected to the Internet). (which are often only intermittently connected to the Internet).
Historically, many of those client machines lacked some of the Historically, many of those client machines lacked some of the
mechanisms and information assumed by SMTP (and indeed, by the mail mechanisms and information assumed by SMTP (and indeed, by the mail
format protocol [7]). Some could not keep adequate track of time; format protocol, RFC822 [16]). Some could not keep adequate track of
others had no concept of time zones; still others could not identify time; others had no concept of time zones; still others could not
their own names or addresses; and, of course, none could satisfy the identify their own names or addresses; and, of course, none could
assumptions that underlay RFC 822's conception of authenticated satisfy the assumptions that underlay RFC 822's conception of
addresses. authenticated addresses.
In response to these weak SMTP clients, many SMTP systems now In response to these weak SMTP clients, many SMTP systems now
complete messages that are delivered to them in incomplete or complete messages that are delivered to them in incomplete or
incorrect form. This strategy is generally considered appropriate incorrect form. This strategy is generally considered appropriate
when the server can identify or authenticate the client, and there when the server can identify or authenticate the client, and there
are prior agreements between them. By contrast, there is at best are prior agreements between them. By contrast, there is at best
great concern about fixes applied by a relay or delivery SMTP server great concern about fixes applied by a relay or delivery SMTP server
that has little or no knowledge of the user or client machine. that has little or no knowledge of the user or client machine. Many
of these issues are addressed by using a separate protocol, such as
that defined in RFC 4409 [42], for message submission, rather than
using originating SMTP servers for that purpose.
The following changes to a message being processed MAY be applied The following changes to a message being processed MAY be applied
when necessary by an originating SMTP server, or one used as the when necessary by an originating SMTP server, or one used as the
target of SMTP as an initial posting protocol: target of SMTP as an initial posting (message submission) protocol:
- Addition of a message-id field when none appears o Addition of a message-id field when none appears
- Addition of a date, time or time zone when none appears o Addition of a date, time or time zone when none appears
- Correction of addresses to proper FQDN format o Correction of addresses to proper FQDN format
The less information the server has about the client, the less likely The less information the server has about the client, the less likely
these changes are to be correct and the more caution and conservatism these changes are to be correct and the more caution and conservatism
should be applied when considering whether or not to perform fixes should be applied when considering whether or not to perform fixes
and how. These changes MUST NOT be applied by an SMTP server that and how. These changes MUST NOT be applied by an SMTP server that
provides an intermediate relay function. provides an intermediate relay function.
In all cases, properly-operating clients supplying correct In all cases, properly-operating clients supplying correct
information are preferred to corrections by the SMTP server. In all information are preferred to corrections by the SMTP server. In all
cases, documentation of actions performed by the servers (in trace cases, documentation SHOULD be provided in trace header fields and/or
fields and/or header comments) is strongly encouraged. header field comments for actions performed by the servers.
7. Security Considerations 7. Security Considerations
7.1 Mail Security and Spoofing 7.1. Mail Security and Spoofing
SMTP mail is inherently insecure in that it is feasible for even SMTP mail is inherently insecure in that it is feasible for even
fairly casual users to negotiate directly with receiving and relaying fairly casual users to negotiate directly with receiving and relaying
SMTP servers and create messages that will trick a naive recipient SMTP servers and create messages that will trick a naive recipient
into believing that they came from somewhere else. Constructing such into believing that they came from somewhere else. Constructing such
a message so that the "spoofed" behavior cannot be detected by an a message so that the "spoofed" behavior cannot be detected by an
expert is somewhat more difficult, but not sufficiently so as to be a expert is somewhat more difficult, but not sufficiently so as to be a
deterrent to someone who is determined and knowledgeable. deterrent to someone who is determined and knowledgeable.
Consequently, as knowledge of Internet mail increases, so does the Consequently, as knowledge of Internet mail increases, so does the
knowledge that SMTP mail inherently cannot be authenticated, or knowledge that SMTP mail inherently cannot be authenticated, or
integrity checks provided, at the transport level. Real mail integrity checks provided, at the transport level. Real mail
security lies only in end-to-end methods involving the message security lies only in end-to-end methods involving the message
bodies, such as those which use digital signatures (see [14] and, bodies, such as those which use digital signatures (see RFC1847 [24]
e.g., PGP [4] or S/MIME [31]). and, e.g., PGP in RFC 4880 [15] or S/MIME in RFC3851 [40]).
Various protocol extensions and configuration options that provide Various protocol extensions and configuration options that provide
authentication at the transport level (e.g., from an SMTP client to authentication at the transport level (e.g., from an SMTP client to
an SMTP server) improve somewhat on the traditional situation an SMTP server) improve somewhat on the traditional situation
described above. However, unless they are accompanied by careful described above. However, in general they only authenticate one
handoffs of responsibility in a carefully-designed trust environment, server to another rather than a chain of relays and servers, much
they remain inherently weaker than end-to-end mechanisms which use less authenticating users or user machines. Consequently, unless
digitally signed messages rather than depending on the integrity of they are accompanied by careful handoffs of responsibility in a
the transport system. carefully-designed trust environment, they remain inherently weaker
than end-to-end mechanisms which use digitally signed messages rather
than depending on the integrity of the transport system.
Efforts to make it more difficult for users to set envelope return Efforts to make it more difficult for users to set envelope return
path and header "From" fields to point to valid addresses other than path and header "From" fields to point to valid addresses other than
their own are largely misguided: they frustrate legitimate their own are largely misguided: they frustrate legitimate
applications in which mail is sent by one user on behalf of another applications in which mail is sent by one user on behalf of another,
or in which error (or normal) replies should be directed to a special in which error (or normal) replies should be directed to a special
address. (Systems that provide convenient ways for users to alter address, or in which a single message is sent to multiple recipients
these fields on a per-message basis should attempt to establish a on different hosts. (Systems that provide convenient ways for users
primary and permanent mailbox address for the user so that Sender to alter these header fields on a per-message basis should attempt to
fields within the message data can be generated sensibly.) establish a primary and permanent mailbox address for the user so
that Sender header fields within the message data can be generated
sensibly.)
This specification does not further address the authentication issues This specification does not further address the authentication issues
associated with SMTP other than to advocate that useful functionality associated with SMTP other than to advocate that useful functionality
not be disabled in the hope of providing some small margin of not be disabled in the hope of providing some small margin of
protection against an ignorant user who is trying to fake mail. protection against a user who is trying to fake mail.
7.2 "Blind" Copies 7.2. "Blind" Copies
Addresses that do not appear in the message headers may appear in the Addresses that do not appear in the message header section may appear
RCPT commands to an SMTP server for a number of reasons. The two in the RCPT commands to an SMTP server for a number of reasons. The
most common involve the use of a mailing address as a "list exploder" two most common involve the use of a mailing address as a "list
(a single address that resolves into multiple addresses) and the exploder" (a single address that resolves into multiple addresses)
appearance of "blind copies". Especially when more than one RCPT and the appearance of "blind copies". Especially when more than one
command is present, and in order to avoid defeating some of the RCPT command is present, and in order to avoid defeating some of the
purpose of these mechanisms, SMTP clients and servers SHOULD NOT copy purpose of these mechanisms, SMTP clients and servers SHOULD NOT copy
the full set of RCPT command arguments into the headers, either as the full set of RCPT command arguments into the header section,
part of trace headers or as informational or private-extension either as part of trace header fields or as informational or private-
headers. Since this rule is often violated in practice, and cannot extension header fields. Since this rule is often violated in
be enforced, sending SMTP systems that are aware of "bcc" use MAY practice, and cannot be enforced, sending SMTP systems that are aware
find it helpful to send each blind copy as a separate message of "bcc" use MAY find it helpful to send each blind copy as a
transaction containing only a single RCPT command. separate message transaction containing only a single RCPT command.
There is no inherent relationship between either "reverse" (from There is no inherent relationship between either "reverse" (from
MAIL, SAML, etc., commands) or "forward" (RCPT) addresses in the SMTP MAIL, SAML, etc., commands) or "forward" (RCPT) addresses in the SMTP
transaction ("envelope") and the addresses in the headers. Receiving transaction ("envelope") and the addresses in the header section.
systems SHOULD NOT attempt to deduce such relationships and use them Receiving systems SHOULD NOT attempt to deduce such relationships and
to alter the headers of the message for delivery. The popular use them to alter the header section of the message for delivery.
"Apparently-to" header is a violation of this principle as well as a The popular "Apparently-to" header field is a violation of this
common source of unintended information disclosure and SHOULD NOT be principle as well as a common source of unintended information
used. disclosure and SHOULD NOT be used.
7.3 VRFY, EXPN, and Security 7.3. VRFY, EXPN, and Security
As discussed in section 3.5, individual sites may want to disable As discussed in Section 3.5, individual sites may want to disable
either or both of VRFY or EXPN for security reasons. As a corollary either or both of VRFY or EXPN for security reasons (see below). As
to the above, implementations that permit this MUST NOT appear to a corollary to the above, implementations that permit this MUST NOT
have verified addresses that are not, in fact, verified. If a site appear to have verified addresses that are not, in fact, verified.
disables these commands for security reasons, the SMTP server MUST If a site disables these commands for security reasons, the SMTP
return a 252 response, rather than a code that could be confused with server MUST return a 252 response, rather than a code that could be
successful or unsuccessful verification. confused with successful or unsuccessful verification.
Returning a 250 reply code with the address listed in the VRFY Returning a 250 reply code with the address listed in the VRFY
command after having checked it only for syntax violates this rule. command after having checked it only for syntax violates this rule.
Of course, an implementation that "supports" VRFY by always returning Of course, an implementation that "supports" VRFY by always returning
550 whether or not the address is valid is equally not in 550 whether or not the address is valid is equally not in
conformance. conformance.
Within the last few years, the contents of mailing lists have become On the public Internet, the contents of mailing lists have become
popular as an address information source for so-called "spammers." popular as an address information source for so-called "spammers."
The use of EXPN to "harvest" addresses has increased as list The use of EXPN to "harvest" addresses has increased as list
administrators have installed protections against inappropriate uses administrators have installed protections against inappropriate uses
of the lists themselves. Implementations SHOULD still provide of the lists themselves. However, VRFY and EXPN are still useful for
support for EXPN, but sites SHOULD carefully evaluate the tradeoffs. authenticated users and within an administrative domain. For
As authentication mechanisms are introduced into SMTP, some sites may example, VRFY and EXPN are useful for performing internal audits of
choose to make EXPN available only to authenticated requestors. how email gets routed to check and to make sure no one is
automatically forwarding sensitive mail outside the organization.
Sites implementating SMTP authentication may choose to make VRFY and
EXPN available only to authenticated requestors. Implementations
SHOULD still provide support for EXPN, but sites SHOULD carefully
evaluate the tradeoffs.
7.4 Information Disclosure in Announcements Whether disabling VRFY provides any real marginal security depends on
a series of other conditions. In many cases, RCPT commands can be
used to obtain the same information about address validity. On the
other hand, especially in situations where determination of address
validity for RCPT commands is deferred until after the DATA command
is received, RCPT may return no information at all, while VRFY is
expected to make a serious attempt to determine validity before
generating a response code (see discussion above).
7.4. Mail Rerouting Based on the 251 and 551 Response Codes
Before a client uses the 251 or 551 reply codes from a RCPT command
to automatically update its future behavior (e.g., updating the
user's address book), it should be certain of the server's
authenticity. If it does not, it may be subject to a man in the
middle attack.
7.5. Information Disclosure in Announcements
There has been an ongoing debate about the tradeoffs between the There has been an ongoing debate about the tradeoffs between the
debugging advantages of announcing server type and version (and, debugging advantages of announcing server type and version (and,
sometimes, even server domain name) in the greeting response or in sometimes, even server domain name) in the greeting response or in
response to the HELP command and the disadvantages of exposing response to the HELP command and the disadvantages of exposing
information that might be useful in a potential hostile attack. The information that might be useful in a potential hostile attack. The
utility of the debugging information is beyond doubt. Those who utility of the debugging information is beyond doubt. Those who
argue for making it available point out that it is far better to argue for making it available point out that it is far better to
actually secure an SMTP server rather than hope that trying to actually secure an SMTP server rather than hope that trying to
conceal known vulnerabilities by hiding the server's precise identity conceal known vulnerabilities by hiding the server's precise identity
will provide more protection. Sites are encouraged to evaluate the will provide more protection. Sites are encouraged to evaluate the
tradeoff with that issue in mind; implementations are strongly tradeoff with that issue in mind; implementations SHOULD minimally
encouraged to minimally provide for making type and version provide for making type and version information available in some way
information available in some way to other network hosts. to other network hosts.
7.5 Information Disclosure in Trace Fields 7.6. Information Disclosure in Trace Fields
In some circumstances, such as when mail originates from within a LAN In some circumstances, such as when mail originates from within a LAN
whose hosts are not directly on the public Internet, trace whose hosts are not directly on the public Internet, trace
("Received") fields produced in conformance with this specification ("Received") header fields produced in conformance with this
may disclose host names and similar information that would not specification may disclose host names and similar information that
normally be available. This ordinarily does not pose a problem, but would not normally be available. This ordinarily does not pose a
sites with special concerns about name disclosure should be aware of problem, but sites with special concerns about name disclosure should
it. Also, the optional FOR clause should be supplied with caution or be aware of it. Also, the optional FOR clause should be supplied
not at all when multiple recipients are involved lest it with caution or not at all when multiple recipients are involved lest
inadvertently disclose the identities of "blind copy" recipients to it inadvertently disclose the identities of "blind copy" recipients
others. to others.
7.6 Information Disclosure in Message Forwarding 7.7. Information Disclosure in Message Forwarding
As discussed in section 3.4, use of the 251 or 551 reply codes to As discussed in Section 3.4, use of the 251 or 551 reply codes to
identify the replacement address associated with a mailbox may identify the replacement address associated with a mailbox may
inadvertently disclose sensitive information. Sites that are inadvertently disclose sensitive information. Sites that are
concerned about those issues should ensure that they select and concerned about those issues should ensure that they select and
configure servers appropriately. configure servers appropriately.
7.7 Scope of Operation of SMTP Servers 7.8. Resistance to Attacks
In recent years, there has been an increase of attacks on SMTP
servers, either in conjunction with attempts to discover addresses
for sending unsolicited messages or simply to make the servers
inaccessible to others (i.e., as an application-level denial of
service attack). While the means of doing so are beyond the scope of
this standard, rational operational behavior requires that servers be
permitted to detect such attacks and take action to defend
themselves. For example, if a server determines that a large number
of RCPT TO commands are being sent, most or all with invalid
addresses, as part of such an attack, it would be reasonable for the
server to close the connection after generating an appropriate number
of 5yz (normally 550) replies.
7.9. Scope of Operation of SMTP Servers
It is a well-established principle that an SMTP server may refuse to It is a well-established principle that an SMTP server may refuse to
accept mail for any operational or technical reason that makes sense accept mail for any operational or technical reason that makes sense
to the site providing the server. However, cooperation among sites to the site providing the server. However, cooperation among sites
and installations makes the Internet possible. If sites take and installations makes the Internet possible. If sites take
excessive advantage of the right to reject traffic, the ubiquity of excessive advantage of the right to reject traffic, the ubiquity of
email availability (one of the strengths of the Internet) will be email availability (one of the strengths of the Internet) will be
threatened; considerable care should be taken and balance maintained threatened; considerable care should be taken and balance maintained
if a site decides to be selective about the traffic it will accept if a site decides to be selective about the traffic it will accept
and process. and process.
In recent years, use of the relay function through arbitrary sites In recent years, use of the relay function through arbitrary sites
has been used as part of hostile efforts to hide the actual origins has been used as part of hostile efforts to hide the actual origins
of mail. Some sites have decided to limit the use of the relay of mail. Some sites have decided to limit the use of the relay
function to known or identifiable sources, and implementations SHOULD function to known or identifiable sources, and implementations SHOULD
provide the capability to perform this type of filtering. When mail provide the capability to perform this type of filtering. When mail
is rejected for these or other policy reasons, a 550 code SHOULD be is rejected for these or other policy reasons, a 550 code SHOULD be
used in response to EHLO, MAIL, or RCPT as appropriate. used in response to EHLO (or HELO), MAIL, or RCPT as appropriate.
8. IANA Considerations 8. IANA Considerations
IANA will maintain three registries in support of this specification. IANA will maintain three registries in support of this specification,
The first consists of SMTP service extensions with the associated all of which were created for RFC2821 or earlier. This document
keywords, and, as needed, parameters and verbs. As specified in expands the third one as specified below. The registry references
section 2.2.2, no entry may be made in this registry that starts in listed are as of the time of publication; IANA does not guarantee the
an "X". Entries may be made only for service extensions (and locations associated with the URLs. The registries are
associated keywords, parameters, or verbs) that are defined in
standards-track or experimental RFCs specifically approved by the
IESG for this purpose.
The second registry consists of "tags" that identify forms of domain o The first, "Simple Mail Transfer Protocol (SMTP) Service
literals other than those for IPv4 addresses (specified in RFC 821 Extensions" [45], consists of SMTP service extensions with the
and in this document) and IPv6 addresses (specified in this associated keywords, and, as needed, parameters and verbs. As
document). Additional literal types require standardization before specified in Section 2.2.2, no entry may be made in this registry
being used; none are anticipated at this time. that starts in an "X". Entries may be made only for service
extensions (and associated keywords, parameters, or verbs) that
are defined in standards-track or experimental RFCs specifically
approved by the IESG for this purpose.
The third, established by RFC 821 and renewed by this specification, o The second registry [46], consists of "tags" that identify forms
is a registry of link and protocol identifiers to be used with the of domain literals other than those for IPv4 addresses (specified
"via" and "with" subclauses of the time stamp ("Received: header") in RFC 821 and in this document) and IPv6 addresses (specified in
described in section 4.4. Link and protocol identifiers in addition this document). Additional literal types require standardization
to those specified in this document may be registered only by before being used; none are anticipated at this time.
o The third, "Mail Transmission Types" [45], established by RFC 821
and renewed by this specification, is a registry of link and
protocol identifiers to be used with the "via" and "with"
subclauses of the time stamp ("Received:" header field) described
in Section 4.4. Link and protocol identifiers in addition to
those specified in this document may be registered only by
standardization or by way of an RFC-documented, IESG-approved, standardization or by way of an RFC-documented, IESG-approved,
Experimental protocol extension. Experimental protocol extension. This name space is for
identification and not limited in size: the IESG is encouraged to
approve on the basis of clear documentation and a distinct method
rather than preferences about the properties of the method itself.
9. References An additional subsection will be added to the "VIA link types" and
"WITH protocol types" subsections of this registry to contain
registrations of "Additional-registered-clauses" as described
above. The registry will contain clause names, a description, a
summary of the syntax of the associated String, and a reference.
As new clauses are defined, they may, in principle, specify
creation of their own registries if the Strings consist of
reserved terms or keywords rather than less-restricted strings.
As with link and protocol identifiers, additional clauses may be
registered only by standardization or by way of an RFC-documented,
IESG-approved, Experimental protocol extension. The additional
clause name space is for identification and is not limited in
size: the IESG is encouraged to approve on the basis of clear
documentation, actual use or strong signs that the clause will be
used, and a distinct requirement rather than preferences about the
properties of the clause itself.
[1] American National Standards Institute (formerly United States of In addition, if additional trace header fields (i.e., in addition to
America Standards Institute), X3.4, 1968, "USA Code for Return-path and Received) are ever created, those trace fields MUST
Information Interchange". ANSI X3.4-1968 has been replaced by be added to the IANA registry established by BCP 90 (RFC3864) [10]
newer versions with slight modifications, but the 1968 version for use with RFC2822 [11].
remains definitive for the Internet.
[2] Braden, R., "Requirements for Internet hosts - application and 9. Acknowledgments
support", STD 3, RFC 1123, October 1989.
[3] Butler, M., Chase, D., Goldberger, J., Postel, J. and J. Many people contributed to the development of RFC 2821. That
Reynolds, "Post Office Protocol - version 2", RFC 937, February document should be consulted for those acknowledgments. For the
1985. present draft, the editor and the community owe thanks to Dawn Mann
and Tony Hansen who assisted in the very painful process of editing
and converting the internal format of the document from one system to
another.
[4] Callas, J., Donnerhacke, L., Finney, H. and R. Thayer, "OpenPGP Many people made comments or suggestions on the mailing list or in
Message Format", RFC 2440, November 1998. notes to the author. Important corrections or clarifications were
suggested by several people, including Matti Aarnio, Glenn Anderson,
Derek J. Balling, Alex van den Bogaerdt, Stephane Bortzmeyer, Vint
Cerf, Jutta Degener, Steve Dorner, Lisa Dusseault, Frank Ellerman,
Ned Freed, Randy Gellens, Sabahattin Gucukoglu, Philip Guenther, Arnt
Gulbrandsen, Eric Hall, Richard O. Hammer, Tony Hansen, Peter J.
Holzer, Kari Hurtta, Bryon Roche Kain, Valdis Kletnieks, Mathias
Koerber, John Leslie, Bruce Lilly, Jeff Macdonald, Mark E. Mallett,
Mark Martinec, S. Moonesamy, Lyndon Nerenberg, Chris Newman, Douglas
Otis, Pete Resnick, Robert A. Rosenberg, Vince Sabio, Hector Santos,
David F. Skoll, Paul Smith, and Brett Watson.
[5] Crispin, M., "Interactive Mail Access Protocol - Version 2", RFC The efforts of the Area Directors -- Lisa Dusseault, Ted Hardie, and
1176, August 1990. Chris Newman -- to get this effort restarted and keep it moving, and
of an ad hoc committee with the same purpose, are gratefully
acknowledged. The members of that committee were (in alphabetical
order) Dave Crocker, Cyrus Daboo, Tony Finch, Ned Freed, Randall
Gellens, Tony Hansen, the author, and Alexey Melnikov. Tony Hansen
also acted as ad hoc chair on the mailing list reviewing this
document; without his efforts, sense of balance and fairness, and
patience, it clearly would not have been possible.
[6] Crispin, M., "Internet Message Access Protocol - Version 4", RFC 10. References
2060, December 1996.
[7] Crocker, D., "Standard for the Format of ARPA Internet Text 10.1. Normative References
Messages", RFC 822, August 1982.
[8] Crocker, D. and P. Overell, Eds., "Augmented BNF for Syntax [1] Bradner, S., "Key words for use in RFCs to Indicate Requirement
Specifications: ABNF", RFC 2234, November 1997. Levels", BCP 14, RFC 2119, March 1997.
[9] De Winter, J., "SMTP Service Extension for Remote Message Queue [2] American National Standards Institute (formerly United States
Starting", RFC 1985, August 1996. of America Standards Institute), "USA Code for Information
Interchange", ANSI X3.4-1968, 1968.
[10] Fajman, R., "An Extensible Message Format for Message ANSI X3.4-1968 has been replaced by newer versions with slight
Disposition Notifications", RFC 2298, March 1998. modifications, but the 1968 version remains definitive for the
Internet.
[11] Freed, N, "Behavior of and Requirements for Internet Firewalls", [3] Braden, R., "Requirements for Internet Hosts - Application and
RFC 2979, October 2000. Support", STD 3, RFC 1123, October 1989.
[12] Freed, N. and N. Borenstein, "Multipurpose Internet Mail [4] Klensin, J., Freed, N., and K. Moore, "SMTP Service Extension
Extensions (MIME) Part One: Format of Internet Message Bodies", for Message Size Declaration", STD 10, RFC 1870, November 1995.
RFC 2045, December 1996.
[13] Freed, N., "SMTP Service Extension for Command Pipelining", RFC [5] Crocker, D. and P. Overell, "Augmented BNF for Syntax
2920, September 2000. Specifications: ABNF", STD 68, RFC 5234, January 2008.
[14] Galvin, J., Murphy, S., Crocker, S. and N. Freed, "Security [6] Hinden, R. and S. Deering, "IP Version 6 Addressing
Multiparts for MIME: Multipart/Signed and Multipart/Encrypted", Architecture", RFC 4291, February 2006.
RFC 1847, October 1995.
[15] Gellens, R. and J. Klensin, "Message Submission", RFC 2476, [7] Mockapetris, P., "Domain names - implementation and
December 1998. specification", STD 13, RFC 1035, November 1987.
[16] Kille, S., "Mapping between X.400 and RFC822/MIME", RFC 2156, [8] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC 821,
January 1998. August 1982.
[17] Hinden, R and S. Deering, Eds. "IP Version 6 Addressing [9] Newman, C., "ESMTP and LMTP Transmission Types Registration",
Architecture", RFC 2373, July 1998. RFC 3848, July 2004.
[18] Klensin, J., Freed, N. and K. Moore, "SMTP Service Extension for [10] Klyne, G., Nottingham, M., and J. Mogul, "Registration
Message Size Declaration", STD 10, RFC 1870, November 1995. Procedures for Message Header Fields", BCP 90, RFC 3864,
September 2004.
[19] Klensin, J., Freed, N., Rose, M., Stefferud, E. and D. Crocker, [11] Resnick, P., "Internet Message Format",
"SMTP Service Extensions", STD 10, RFC 1869, November 1995. draft-resnick-2822upd-06 (work in progress), February 2008.
[20] Klensin, J., Freed, N., Rose, M., Stefferud, E. and D. Crocker, [[Note in Draft: RFC Editor, please straighten this out when
"SMTP Service Extension for 8bit-MIMEtransport", RFC 1652, July 2822bis makes it through the system. Since this is a normative
1994. reference to an I-D, we assume you will hold publication until
then.]]
10.2. Informative References
[12] Moore, K., "Simple Mail Transfer Protocol (SMTP) Service
Extension for Delivery Status Notifications (DSNs)", RFC 3461,
January 2003.
[13] Moore, K. and G. Vaudreuil, "An Extensible Message Format for
Delivery Status Notifications", RFC 3464, January 2003.
[14] Nakamura, M. and J. Hagino, "SMTP Operational Experience in
Mixed IPv4/v6 Environments", RFC 3974, January 2005.
[15] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R.
Thayer, "OpenPGP Message Format", RFC 4880, November 2007.
[16] Crocker, D., "Standard for the format of ARPA Internet text
messages", STD 11, RFC 822, August 1982.
[17] Butler, M., Postel, J., Chase, D., Goldberger, J., and J.
Reynolds, "Post Office Protocol: Version 2", RFC 937,
February 1985.
[18] Postel, J. and J. Reynolds, "File Transfer Protocol", STD 9,
RFC 959, October 1985.
[19] Partridge, C., "Mail routing and the domain system", RFC 974,
January 1986.
[20] Partridge, C., "Duplicate messages and SMTP", RFC 1047,
February 1988.
[21] Lambert, M., "PCMAIL: A distributed mail system for personal [21] Lambert, M., "PCMAIL: A distributed mail system for personal
computers", RFC 1056, July 1988. computers", RFC 1056, June 1988.
[22] Mockapetris, P., "Domain names - implementation and [22] Crispin, M., "Interactive Mail Access Protocol: Version 2",
specification", STD 13, RFC 1035, November 1987. RFC 1176, August 1990.
Mockapetris, P., "Domain names - concepts and facilities", STD [23] Klensin, J., Freed, N., Rose, M., Stefferud, E., and D.
13, RFC 1034, November 1987. Crocker, "SMTP Service Extension for 8bit-MIMEtransport",
RFC 1652, July 1994.
[23] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part [24] Galvin, J., Murphy, S., Crocker, S., and N. Freed, "Security
Multiparts for MIME: Multipart/Signed and Multipart/Encrypted",
RFC 1847, October 1995.
[25] Klensin, J., Freed, N., Rose, M., Stefferud, E., and D.
Crocker, "SMTP Service Extensions", STD 10, RFC 1869,
November 1995.
[26] Myers, J. and M. Rose, "Post Office Protocol - Version 3",
STD 53, RFC 1939, May 1996.
[27] De Winter, J., "SMTP Service Extension for Remote Message Queue
Starting", RFC 1985, August 1996.
[28] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part One: Format of Internet Message Bodies",
RFC 2045, November 1996.
[29] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part
Three: Message Header Extensions for Non-ASCII Text", RFC 2047, Three: Message Header Extensions for Non-ASCII Text", RFC 2047,
December 1996. November 1996.
[24] Moore, K., "SMTP Service Extension for Delivery Status [30] Kille, S., "MIXER (Mime Internet X.400 Enhanced Relay): Mapping
Notifications", RFC 1891, January 1996. between X.400 and RFC 822/MIME", RFC 2156, January 1998.
[25] Moore, K., and G. Vaudreuil, "An Extensible Message Format for [31] Elz, R. and R. Bush, "Clarifications to the DNS Specification",
Delivery Status Notifications", RFC 1894, January 1996. RFC 2181, July 1997.
[26] Myers, J. and M. Rose, "Post Office Protocol - Version 3", STD [32] Freed, N. and K. Moore, "MIME Parameter Value and Encoded Word
53, RFC 1939, May 1996. Extensions: Character Sets, Languages, and Continuations",
RFC 2231, November 1997.
[27] Partridge, C., "Mail routing and the domain system", RFC 974, [33] Klensin, J., "Simple Mail Transfer Protocol", RFC 2821,
January 1986. April 2001.
[28] Partridge, C., "Duplicate messages and SMTP", RFC 1047, February [34] Freed, N., "SMTP Service Extension for Command Pipelining",
1988. STD 60, RFC 2920, September 2000.
[29] Postel, J., ed., "Transmission Control Protocol - DARPA Internet [35] Freed, N., "Behavior of and Requirements for Internet
Program Protocol Specification", STD 7, RFC 793, September 1981. Firewalls", RFC 2979, October 2000.
[30] Postel, J., "Simple Mail Transfer Protocol", RFC 821, August [36] Vaudreuil, G., "SMTP Service Extensions for Transmission of
1982. Large and Binary MIME Messages", RFC 3030, December 2000.
[31] Ramsdell, B., Ed., "S/MIME Version 3 Message Specification", RFC [37] Vaudreuil, G., "Enhanced Mail System Status Codes", RFC 3463,
2633, June 1999. January 2003.
[32] Resnick, P., Ed., "Internet Message Format", RFC 2822, April [38] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION
2001. 4rev1", RFC 3501, March 2003.
[33] Vaudreuil, G., "SMTP Service Extensions for Transmission of [39] Hansen, T. and G. Vaudreuil, "Message Disposition
Large and Binary MIME Messages", RFC 1830, August 1995. Notification", RFC 3798, May 2004.
[34] Vaudreuil, G., "Enhanced Mail System Status Codes", RFC 1893, [40] Ramsdell, B., "Secure/Multipurpose Internet Mail Extensions
January 1996. (S/MIME) Version 3.1 Message Specification", RFC 3851,
July 2004.
10. Editor's Address [41] Wong, M. and W. Schlitt, "Sender Policy Framework (SPF) for
Authorizing Use of Domains in E-Mail, Version 1", RFC 4408,
April 2006.
John C. Klensin [42] Gellens, R. and J. Klensin, "Message Submission for Mail",
AT&T Laboratories RFC 4409, April 2006.
99 Bedford St
Boston, MA 02111 USA
Phone: 617-574-3076 [43] Fenton, J., "Analysis of Threats Motivating DomainKeys
EMail: klensin@research.att.com Identified Mail (DKIM)", RFC 4686, September 2006.
11. Acknowledgments [44] Allman, E., Callas, J., Delany, M., Libbey, M., Fenton, J., and
M. Thomas, "DomainKeys Identified Mail (DKIM) Signatures",
RFC 4871, May 2007.
Many people worked long and hard on the many iterations of this [45] Internet Assigned Number Authority (IANA), "IANA Mail
document. There was wide-ranging debate in the IETF DRUMS Working Parameters", 2007,
Group, both on its mailing list and in face to face discussions, <http://www.iana.org/assignments/mail-parameters>.
about many technical issues and the role of a revised standard for
Internet mail transport, and many contributors helped form the
wording in this specification. The hundreds of participants in the
many discussions since RFC 821 was produced are too numerous to
mention, but they all helped this document become what it is.
APPENDICES [46] Internet Assigned Number Authority (IANA), "Address Literal
Tags", 2007,
<http://www.iana.org/assignments/address-literal-tags>.
A. TCP Transport Service Appendix A. TCP Transport Service
The TCP connection supports the transmission of 8-bit bytes. The The TCP connection supports the transmission of 8-bit bytes. The
SMTP data is 7-bit ASCII characters. Each character is transmitted SMTP data is 7-bit ASCII characters. Each character is transmitted
as an 8-bit byte with the high-order bit cleared to zero. Service as an 8-bit byte with the high-order bit cleared to zero. Service
extensions may modify this rule to permit transmission of full 8-bit extensions may modify this rule to permit transmission of full 8-bit
data bytes as part of the message body, but not in SMTP commands or data bytes as part of the message body, or, if specifically designed
responses. to do so, in in SMTP commands or responses.
B. Generating SMTP Commands from RFC 822 Headers Appendix B. Generating SMTP Commands from RFC 822 Header Fields
Some systems use RFC 822 headers (only) in a mail submission Some systems use an RFC 822 header section (only) in a mail
protocol, or otherwise generate SMTP commands from RFC 822 headers submission protocol, or otherwise generate SMTP commands from RFC 822
when such a message is handed to an MTA from a UA. While the MTA-UA header fields when such a message is handed to an MTA from a UA.
protocol is a private matter, not covered by any Internet Standard, While the MTA-UA protocol is a private matter, not covered by any
there are problems with this approach. For example, there have been Internet Standard, there are problems with this approach. For
repeated problems with proper handling of "bcc" copies and example, there have been repeated problems with proper handling of
redistribution lists when information that conceptually belongs to a "bcc" copies and redistribution lists when information that
mail envelopes is not separated early in processing from header conceptually belongs to the mail envelope is not separated early in
information (and kept separate). processing from header field information (and kept separate).
It is recommended that the UA provide its initial ("submission It is recommended that the UA provide its initial ("submission
client") MTA with an envelope separate from the message itself. client") MTA with an envelope separate from the message itself.
However, if the envelope is not supplied, SMTP commands SHOULD be However, if the envelope is not supplied, SMTP commands SHOULD be
generated as follows: generated as follows:
1. Each recipient address from a TO, CC, or BCC header field SHOULD 1. Each recipient address from a TO, CC, or BCC header field SHOULD
be copied to a RCPT command (generating multiple message copies if be copied to a RCPT command (generating multiple message copies
that is required for queuing or delivery). This includes any if that is required for queuing or delivery). This includes any
addresses listed in a RFC 822 "group". Any BCC fields SHOULD then addresses listed in a RFC 822 "group". Any BCC header fields
be removed from the headers. Once this process is completed, the SHOULD then be removed from the header section. Once this
remaining headers SHOULD be checked to verify that at least one process is completed, the remaining header fields SHOULD be
To:, Cc:, or Bcc: header remains. If none do, then a bcc: header checked to verify that at least one To:, Cc:, or Bcc: header
with no additional information SHOULD be inserted as specified in field remains. If none do, then a bcc: header field with no
[32]. additional information SHOULD be inserted as specified in [11].
2. The return address in the MAIL command SHOULD, if possible, be 2. The return address in the MAIL command SHOULD, if possible, be
derived from the system's identity for the submitting (local) derived from the system's identity for the submitting (local)
user, and the "From:" header field otherwise. If there is a user, and the "From:" header field otherwise. If there is a
system identity available, it SHOULD also be copied to the Sender system identity available, it SHOULD also be copied to the Sender
header field if it is different from the address in the From header field if it is different from the address in the From
header field. (Any Sender field that was already there SHOULD be header field. (Any Sender header field that was already there
removed.) Systems may provide a way for submitters to override SHOULD be removed.) Systems may provide a way for submitters to
the envelope return address, but may want to restrict its use to override the envelope return address, but may want to restrict
privileged users. This will not prevent mail forgery, but may its use to privileged users. This will not prevent mail forgery,
lessen its incidence; see section 7.1. but may lessen its incidence; see Section 7.1.
When an MTA is being used in this way, it bears responsibility for When an MTA is being used in this way, it bears responsibility for
ensuring that the message being transmitted is valid. The mechanisms ensuring that the message being transmitted is valid. The mechanisms
for checking that validity, and for handling (or returning) messages for checking that validity, and for handling (or returning) messages
that are not valid at the time of arrival, are part of the MUA-MTA that are not valid at the time of arrival, are part of the MUA-MTA
interface and not covered by this specification. interface and not covered by this specification.
A submission protocol based on Standard RFC 822 information alone A submission protocol based on Standard RFC 822 information alone
MUST NOT be used to gateway a message from a foreign (non-SMTP) mail MUST NOT be used to gateway a message from a foreign (non-SMTP) mail
system into an SMTP environment. Additional information to construct system into an SMTP environment. Additional information to construct
an envelope must come from some source in the other environment, an envelope must come from some source in the other environment,
whether supplemental headers or the foreign system's envelope. whether supplemental header fields or the foreign system's envelope.
Attempts to gateway messages using only their header "to" and "cc" Attempts to gateway messages using only their header "To" and "Cc"
fields have repeatedly caused mail loops and other behavior adverse fields have repeatedly caused mail loops and other behavior adverse
to the proper functioning of the Internet mail environment. These to the proper functioning of the Internet mail environment. These
problems have been especially common when the message originates from problems have been especially common when the message originates from
an Internet mailing list and is distributed into the foreign an Internet mailing list and is distributed into the foreign
environment using envelope information. When these messages are then environment using envelope information. When these messages are then
processed by a header-only remailer, loops back to the Internet processed by a header-section-only remailer, loops back to the
environment (and the mailing list) are almost inevitable. Internet environment (and the mailing list) are almost inevitable.
C. Source Routes Appendix C. Source Routes
Historically, the <reverse-path> was a reverse source routing list of Historically, the <reverse-path> was a reverse source routing list of
hosts and a source mailbox. The first host in the <reverse-path> hosts and a source mailbox. The first host in the <reverse-path> was
SHOULD be the host sending the MAIL command. Similarly, the historically the host sending the MAIL command; today, source routes
<forward-path> may be a source routing lists of hosts and a SHOULD NOT appear in the reverse-path. Similarly, the <forward-path>
destination mailbox. However, in general, the <forward-path> SHOULD may be a source routing lists of hosts and a destination mailbox.
contain only a mailbox and domain name, relying on the domain name However, in general, the <forward-path> SHOULD contain only a mailbox
system to supply routing information if required. The use of source and domain name, relying on the domain name system to supply routing
routes is deprecated; while servers MUST be prepared to receive and information if required. The use of source routes is deprecated (see
handle them as discussed in section 3.3 and F.2, clients SHOULD NOT Appendix F.2); while servers MUST be prepared to receive and handle
transmit them and this section was included only to provide context. them as discussed in Section 3.3 and Appendix F.2, clients SHOULD NOT
transmit them and this section is included in the current
specification only to provide context. It has been modified somewhat
from the material in RFC 821 to prevent server actions that might
confuse clients or subsequent servers that do not expect a full
source route implementation.
For relay purposes, the forward-path may be a source route of the For relay purposes, the forward-path may be a source route of the
form "@ONE,@TWO:JOE@THREE", where ONE, TWO, and THREE MUST BE fully- form "@ONE,@TWO:JOE@THREE", where ONE, TWO, and THREE MUST be fully-
qualified domain names. This form is used to emphasize the qualified domain names. This form is used to emphasize the
distinction between an address and a route. The mailbox is an distinction between an address and a route. The mailbox (here, JOE@
absolute address, and the route is information about how to get THREE) is an absolute address, and the route is information about how
there. The two concepts should not be confused. to get there. The two concepts should not be confused.
If source routes are used, RFC 821 and the text below should be If source routes are used, RFC 821 and the text below should be
consulted for the mechanisms for constructing and updating the consulted for the mechanisms for constructing and updating the
forward- and reverse-paths. forward-path. A server that is reached by means of a source route
(e.g., its domain name appears first in the list in the forward-path)
The SMTP server transforms the command arguments by moving its own MUST remove its domain name from any forward-paths in which that
identifier (its domain name or that of any domain for which it is domain name appears before forwarding the message and MAY remove all
acting as a mail exchanger), if it appears, from the forward-path to other source routing information. The reverse-path SHOULD NOT be
the beginning of the reverse-path. updated by servers conforming to this specification.
Notice that the forward-path and reverse-path appear in the SMTP Notice that the forward-path and reverse-path appear in the SMTP
commands and replies, but not necessarily in the message. That is, commands and replies, but not necessarily in the message. That is,
there is no need for these paths and especially this syntax to appear there is no need for these paths and especially this syntax to appear
in the "To:" , "From:", "CC:", etc. fields of the message header. in the "To:" , "From:", "CC:", etc. fields of the message header
Conversely, SMTP servers MUST NOT derive final message delivery section. Conversely, SMTP servers MUST NOT derive final message
information from message header fields. routing information from message header fields.
When the list of hosts is present, it is a "reverse" source route and When the list of hosts is present despite the recommendations above,
indicates that the mail was relayed through each host on the list it is a "reverse" source route and indicates that the mail was
(the first host in the list was the most recent relay). This list is relayed through each host on the list (the first host in the list was
used as a source route to return non-delivery notices to the sender. the most recent relay). This list is used as a source route to
As each relay host adds itself to the beginning of the list, it MUST return non-delivery notices to the sender. If, contrary to the
use its name as known in the transport environment to which it is recommendations here, a relay host adds itself to the beginning of
relaying the mail rather than that of the transport environment from the list, it MUST use its name as known in the transport environment
which the mail came (if they are different). to which it is relaying the mail rather than that of the transport
environment from which the mail came (if they are different). Note
that a situation could easily arise in which some relay hosts add
their names to the reverse source route and others do not, generating
discontinuities in the routing list. This is another reason why
servers needing to return a message SHOULD ignore the source route
entirely and simply use the domain as specified in the Mailbox.
D. Scenarios Appendix D. Scenarios
This section presents complete scenarios of several types of SMTP This section presents complete scenarios of several types of SMTP
sessions. In the examples, "C:" indicates what is said by the SMTP sessions. In the examples, "C:" indicates what is said by the SMTP
client, and "S:" indicates what is said by the SMTP server. client, and "S:" indicates what is said by the SMTP server.
D.1 A Typical SMTP Transaction Scenario D.1. A Typical SMTP Transaction Scenario
This SMTP example shows mail sent by Smith at host bar.com, to Jones, This SMTP example shows mail sent by Smith at host bar.com, to Jones,
Green, and Brown at host foo.com. Here we assume that host bar.com Green, and Brown at host foo.com. Here we assume that host bar.com
contacts host foo.com directly. The mail is accepted for Jones and contacts host foo.com directly. The mail is accepted for Jones and
Brown. Green does not have a mailbox at host foo.com. Brown. Green does not have a mailbox at host foo.com.
S: 220 foo.com Simple Mail Transfer Service Ready S: 220 foo.com Simple Mail Transfer Service Ready
C: EHLO bar.com C: EHLO bar.com
S: 250-foo.com greets bar.com S: 250-foo.com greets bar.com
S: 250-8BITMIME S: 250-8BITMIME
skipping to change at page 74, line 14 skipping to change at page 88, line 21
S: 250 OK S: 250 OK
C: DATA C: DATA
S: 354 Start mail input; end with <CRLF>.<CRLF> S: 354 Start mail input; end with <CRLF>.<CRLF>
C: Blah blah blah... C: Blah blah blah...
C: ...etc. etc. etc. C: ...etc. etc. etc.
C: . C: .
S: 250 OK S: 250 OK
C: QUIT C: QUIT
S: 221 foo.com Service closing transmission channel S: 221 foo.com Service closing transmission channel
D.2 Aborted SMTP Transaction Scenario D.2. Aborted SMTP Transaction Scenario
S: 220 foo.com Simple Mail Transfer Service Ready S: 220 foo.com Simple Mail Transfer Service Ready
C: EHLO bar.com C: EHLO bar.com
S: 250-foo.com greets bar.com S: 250-foo.com greets bar.com
S: 250-8BITMIME S: 250-8BITMIME
S: 250-SIZE S: 250-SIZE
S: 250-DSN S: 250-DSN
S: 250 HELP S: 250 HELP
C: MAIL FROM:<Smith@bar.com> C: MAIL FROM:<Smith@bar.com>
S: 250 OK S: 250 OK
C: RCPT TO:<Jones@foo.com> C: RCPT TO:<Jones@foo.com>
S: 250 OK S: 250 OK
C: RCPT TO:<Green@foo.com> C: RCPT TO:<Green@foo.com>
S: 550 No such user here S: 550 No such user here
C: RSET C: RSET
S: 250 OK S: 250 OK
C: QUIT C: QUIT
S: 221 foo.com Service closing transmission channel S: 221 foo.com Service closing transmission channel
D.3 Relayed Mail Scenario D.3. Relayed Mail Scenario
Step 1 -- Source Host to Relay Host Step 1 -- Source Host to Relay Host
The source host performs a DNS lookup on XYZ.COM (the destination
address) and finds DNS MX records specifying xyz.com as the best
preference and foo.com as a lower preference. It attempts to open a
connection to xyz.com and fails. It then opens a connection to
foo.com, with the following dialogue:
S: 220 foo.com Simple Mail Transfer Service Ready S: 220 foo.com Simple Mail Transfer Service Ready
C: EHLO bar.com C: EHLO bar.com
S: 250-foo.com greets bar.com S: 250-foo.com greets bar.com
S: 250-8BITMIME S: 250-8BITMIME
S: 250-SIZE S: 250-SIZE
S: 250-DSN S: 250-DSN
S: 250 HELP S: 250 HELP
C: MAIL FROM:<JQP@bar.com> C: MAIL FROM:<JQP@bar.com>
S: 250 OK S: 250 OK
C: RCPT TO:<@foo.com:Jones@XYZ.COM> C: RCPT TO:<Jones@XYZ.COM>
S: 250 OK S: 250 OK
C: DATA C: DATA
S: 354 Start mail input; end with <CRLF>.<CRLF> S: 354 Start mail input; end with <CRLF>.<CRLF>
C: Date: Thu, 21 May 1998 05:33:29 -0700 C: Date: Thu, 21 May 1998 05:33:29 -0700
C: From: John Q. Public <JQP@bar.com> C: From: John Q. Public <JQP@bar.com>
C: Subject: The Next Meeting of the Board C: Subject: The Next Meeting of the Board
C: To: Jones@xyz.com C: To: Jones@xyz.com
C: C:
C: Bill: C: Bill:
C: The next meeting of the board of directors will be C: The next meeting of the board of directors will be
C: on Tuesday. C: on Tuesday.
C: John. C: John.
C: . C: .
S: 250 OK S: 250 OK
C: QUIT C: QUIT
S: 221 foo.com Service closing transmission channel S: 221 foo.com Service closing transmission channel
Step 2 -- Relay Host to Destination Host Step 2 -- Relay Host to Destination Host
foo.com, having received the message, now does a DNS lookup on
xyz.com. It finds the same set of MX records, but cannot use the one
that points to itself (or to any other host as a worse preference).
It tries to open a connection to xyz.com itself and succeeds. Then
we have:
S: 220 xyz.com Simple Mail Transfer Service Ready S: 220 xyz.com Simple Mail Transfer Service Ready
C: EHLO foo.com C: EHLO foo.com
S: 250 xyz.com is on the air S: 250 xyz.com is on the air
C: MAIL FROM:<@foo.com:JQP@bar.com> C: MAIL FROM:<JQP@bar.com>
S: 250 OK S: 250 OK
C: RCPT TO:<Jones@XYZ.COM> C: RCPT TO:<Jones@XYZ.COM>
S: 250 OK S: 250 OK
C: DATA C: DATA
S: 354 Start mail input; end with <CRLF>.<CRLF> S: 354 Start mail input; end with <CRLF>.<CRLF>
C: 05:33:29 -0700 C: 05:33:29 -0700
C: Date: Thu, 21 May 1998 05:33:22 -0700 C: Date: Thu, 21 May 1998 05:33:22 -0700
C: From: John Q. Public <JQP@bar.com> C: From: John Q. Public <JQP@bar.com>
C: Subject: The Next Meeting of the Board C: Subject: The Next Meeting of the Board
C: To: Jones@xyz.com C: To: Jones@xyz.com
C: C:
C: Bill: C: Bill:
C: The next meeting of the board of directors will be C: The next meeting of the board of directors will be
C: on Tuesday. C: on Tuesday.
C: John. C: John.
C: . C: .
S: 250 OK S: 250 OK
C: QUIT C: QUIT
S: 221 foo.com Service closing transmission channel S: 221 foo.com Service closing transmission channel
D.4 Verifying and Sending Scenario D.4. Verifying and Sending Scenario
S: 220 foo.com Simple Mail Transfer Service Ready S: 220 foo.com Simple Mail Transfer Service Ready
C: EHLO bar.com C: EHLO bar.com
S: 250-foo.com greets bar.com S: 250-foo.com greets bar.com
S: 250-8BITMIME S: 250-8BITMIME
S: 250-SIZE S: 250-SIZE
S: 250-DSN S: 250-DSN
S: 250-VRFY S: 250-VRFY
S: 250 HELP S: 250 HELP
C: VRFY Crispin C: VRFY Crispin
S: 250 Mark Crispin <Admin.MRC@foo.com> S: 250 Mark Crispin <Admin.MRC@foo.com>
C: SEND FROM:<EAK@bar.com> C: MAIL FROM:<EAK@bar.com>
S: 250 OK S: 250 OK
C: RCPT TO:<Admin.MRC@foo.com> C: RCPT TO:<Admin.MRC@foo.com>
S: 250 OK S: 250 OK
C: DATA C: DATA
S: 354 Start mail input; end with <CRLF>.<CRLF> S: 354 Start mail input; end with <CRLF>.<CRLF>
C: Blah blah blah... C: Blah blah blah...
C: ...etc. etc. etc. C: ...etc. etc. etc.
C: . C: .
S: 250 OK S: 250 OK
C: QUIT C: QUIT
S: 221 foo.com Service closing transmission channel S: 221 foo.com Service closing transmission channel
E. Other Gateway Issues Appendix E. Other Gateway Issues
In general, gateways between the Internet and other mail systems In general, gateways between the Internet and other mail systems
SHOULD attempt to preserve any layering semantics across the SHOULD attempt to preserve any layering semantics across the
boundaries between the two mail systems involved. Gateway- boundaries between the two mail systems involved. Gateway-
translation approaches that attempt to take shortcuts by mapping, translation approaches that attempt to take shortcuts by mapping
(such as envelope information from one system to the message headers (such as mapping envelope information from one system to the message
or body of another) have generally proven to be inadequate in header section or body of another) have generally proven to be
important ways. Systems translating between environments that do not inadequate in important ways. Systems translating between
support both envelopes and headers and Internet mail must be written environments that do not support both envelopes and a header section
with the understanding that some information loss is almost and Internet mail must be written with the understanding that some
inevitable. information loss is almost inevitable.
F. Deprecated Features of RFC 821 Appendix F. Deprecated Features of RFC 821
A few features of RFC 821 have proven to be problematic and SHOULD A few features of RFC 821 have proven to be problematic and SHOULD
NOT be used in Internet mail. NOT be used in Internet mail.
F.1 TURN F.1. TURN
This command, described in RFC 821, raises important security issues This command, described in RFC 821, raises important security issues
since, in the absence of strong authentication of the host requesting since, in the absence of strong authentication of the host requesting
that the client and server switch roles, it can easily be used to that the client and server switch roles, it can easily be used to
divert mail from its correct destination. Its use is deprecated; divert mail from its correct destination. Its use is deprecated;
SMTP systems SHOULD NOT use it unless the server can authenticate the SMTP systems SHOULD NOT use it unless the server can authenticate the
client. client.
F.2 Source Routing F.2. Source Routing
RFC 821 utilized the concept of explicit source routing to get mail RFC 821 utilized the concept of explicit source routing to get mail
from one host to another via a series of relays. The requirement to from one host to another via a series of relays. The requirement to
utilize source routes in regular mail traffic was eliminated by the utilize source routes in regular mail traffic was eliminated by the
introduction of the domain name system "MX" record and the last introduction of the domain name system "MX" record and the last
significant justification for them was eliminated by the significant justification for them was eliminated by the
introduction, in RFC 1123, of a clear requirement that addresses introduction, in RFC 1123, of a clear requirement that addresses
following an "@" must all be fully-qualified domain names. following an "@" must all be fully-qualified domain names.
Consequently, the only remaining justifications for the use of source Consequently, the only remaining justifications for the use of source
routes are support for very old SMTP clients or MUAs and in mail routes are support for very old SMTP clients or MUAs and in mail
skipping to change at page 77, line 31 skipping to change at page 92, line 13
in the main body of this document and in RFC 1123. They MAY, if in the main body of this document and in RFC 1123. They MAY, if
necessary, ignore the routes and utilize only the target domain in necessary, ignore the routes and utilize only the target domain in
the address. If they do utilize the source route, the message MUST the address. If they do utilize the source route, the message MUST
be sent to the first domain shown in the address. In particular, a be sent to the first domain shown in the address. In particular, a
server MUST NOT guess at shortcuts within the source route. server MUST NOT guess at shortcuts within the source route.
Clients SHOULD NOT utilize explicit source routing except under Clients SHOULD NOT utilize explicit source routing except under
unusual circumstances, such as debugging or potentially relaying unusual circumstances, such as debugging or potentially relaying
around firewall or mail system configuration errors. around firewall or mail system configuration errors.
F.3 HELO F.3. HELO
As discussed in sections 3.1 and 4.1.1, EHLO is strongly preferred to As discussed in Section 3.1 and Section 4.1.1, EHLO SHOULD be used
HELO when the server will accept the former. Servers must continue rather than HELO when the server will accept the former. Servers
to accept and process HELO in order to support older clients. MUST continue to accept and process HELO in order to support older
clients.
F.4 #-literals F.4. #-literals
RFC 821 provided for specifying an Internet address as a decimal RFC 821 provided for specifying an Internet address as a decimal
integer host number prefixed by a pound sign, "#". In practice, that integer host number prefixed by a pound sign, "#". In practice, that
form has been obsolete since the introduction of TCP/IP. It is form has been obsolete since the introduction of TCP/IP. It is
deprecated and MUST NOT be used. deprecated and MUST NOT be used.
F.5 Dates and Years F.5. Dates and Years
When dates are inserted into messages by SMTP clients or servers When dates are inserted into messages by SMTP clients or servers
(e.g., in trace fields), four-digit years MUST BE used. Two-digit (e.g., in trace header fields), four-digit years MUST BE used. Two-
years are deprecated; three-digit years were never permitted in the digit years are deprecated; three-digit years were never permitted in
Internet mail system. the Internet mail system.
F.6 Sending versus Mailing F.6. Sending versus Mailing
In addition to specifying a mechanism for delivering messages to In addition to specifying a mechanism for delivering messages to
user's mailboxes, RFC 821 provided additional, optional, commands to user's mailboxes, RFC 821 provided additional, optional, commands to
deliver messages directly to the user's terminal screen. These deliver messages directly to the user's terminal screen. These
commands (SEND, SAML, SOML) were rarely implemented, and changes in commands (SEND, SAML, SOML) were rarely implemented, and changes in
workstation technology and the introduction of other protocols may workstation technology and the introduction of other protocols may
have rendered them obsolete even where they are implemented. have rendered them obsolete even where they are implemented.
Clients SHOULD NOT provide SEND, SAML, or SOML as services. Servers Clients SHOULD NOT provide SEND, SAML, or SOML as services. Servers
MAY implement them. If they are implemented by servers, the MAY implement them. If they are implemented by servers, the
implementation model specified in RFC 821 MUST be used and the implementation model specified in RFC 821 MUST be used and the
command names MUST be published in the response to the EHLO command. command names MUST be published in the response to the EHLO command.
Appendix G. Change log
G.1. Changes from RFC 2821 to the initial (-00) version of this draft
o bad ref in Section 3.7 and 3.8.1 (to 2.4.1) fixed
o bad ref in Section 4.1.1.1 to 2.4.1 fixed
o syntax for "domain" corrected to permit user@x.y.z. and user@tld.
references
o reference to BCP90 (RFC 3894) inserted.
o Productions for the reverse-path (in the MAIL command and the
Return-Path header) slightly revised to clarify and be sure "<>"
can appear in the latter.
o Clarified use of address literals (and optional supplemental text)
in EHLO.
o Slight clarification to "end of mail data" sequence definition.
o Clarification that a timeout may justify a server closing a
connection.
o Made editing correction to text describing HELO syntax.
o New discussion of situations in which bounce messages may be
treated in special ways or not sent at all (see especially the new
Section 6.2)
o Clarified that commands that were optional in 821 and 1123 (and
are optional here) must appear in EHLO responses.
o Post-DATA replay code discussion fixed
G.2. Changes from version -00 to -01
1. Several references updated to refer to newer versions of relevant
documents.
2. Syntax for, and discussion of, domains changed to permit single-
label domain names, but only (with a SHOULD) if the trailing
period is specified.
3. A note was added to clarify that "Postmaster" is treated in a
case-insensitive fashion.
4. New material added about the implications of extensions.
5. Many small editorial, formatting, and organizational changes.
G.3. Changes from version -01 to -02
This version incorporates changes corresponding to "issues"
identified on the mailing list.
1. Changed section Section 4.5.3 to use subsections, not a list
(part of Issue 9) and forced these sections into the TOC.
2. Started process of adapting to IPv6 by changing "A RR" to
"address RR", putting in surrounding text, and adding some more
general comments.
3. Slightly improved the discussion of message submission
protocols.
4. Eliminated the remaining text that suggested trailing periods
for domain references to TLDs and added corresponding text
prohibiting anything but a submission server from completing
aliases in domain names.
5. Changed the syntax of "ID" in trace (Received) fields to "atom"
from "string".
6. Changed syntax to permit multiple-line Greeting (220) messages.
Clarified multiline responses to require that all of the codes
in a given response be the same.
7. Clarified the applicability of 1yz codes: they are part of the
model, but prohibited without extensions.
8. Specified that "xtext" should be used when email addresses are
used as extension parameter values. This has been done by
reference to avoid yet more duplication of syntax rules that can
later get out of synch. It is not a problem here since RFC3461
is already at Draft Standard, but this will need monitoring in
the future.
9. Added provision for new text about mail rerouting based on 251
and 551 codes (Section 7.4) and about VRFY/EXPN responses (in
xref target='meaning_vrfy_expn_success'/>).
10. Clarified the rules about continuation lines to more clearly
prohibit mixed codes.
11. Prohibited the use of 1yz codes without extensions and added a
brief explanation about the relationship to FTP.
12. Added some references.
13. General editorial improvements.
G.4. Changes from version -02 to -03
This version, and the subsequent ones, incorporate additional changes
corresponding to "issues" identified on the mailing list.
1. Informal text that used terms such as "discouraged",
"encouraged", "permitted", or "prohibited" to express protocol
requirements has been changed to "SHOULD", "MUST", or "MAY" where
appropriate.
2. Rewrote Appendix C to better reflect the source route environment
and appropriate actions in an environment in which use of source
routes has been deprecated since RFC 1123 in 1989.
3. Some text added to clarify, non-normatively, the relationship of
SMTP to Message Submission functions.
4. Changed informal use of the term "header" to the more precise
"header section" and "header field" and introduced the term
"Received clause".
5. More editorial and related changes to improve clarity and
consistency.
G.5. Changes from version -02 to -03
1. Modified descriptive text for 450 code to reflect policy
refusals.
2. New text about sender verification and generation of NDNs
3. Tuned 1yz and FTP text
4. More corrections of minor typos, etc.
G.6. Changes from version -03 to -04
1. Removed "explained-literal" syntax and rewrote the explanation
(issue 19).
2. Revised text for responsibility handoff (issue 32b).
3. Slightly further revised the "FTP relationship" text introduced
in -02 and -03.
4. Revised example text in appendix D to remove source routes and
bring closer to MX context (issue 35).
5. Editorial revisions, including rearranging some sections.
G.7. Changes from version -04 to -05
1. Added registry pointers to Section 8 (issue 36).
2. "for" clause in Received header reduced to a single mailbox,
since this seems to reflect list consensus (issue 37). An
"additional registered clauses" entry was made to allow for
future extension (also issue 37).
3. Corrected some I-D references to point to now-published RFCs.
G.8. Changes from version -05 to -06
1. Checked and verified additional uses of "field", inserting
"header" or substituting "clause" as needed.
2. Made small adjustments in several references.
3. Added text to clarify (and more clearly prohibit) rewriting null
reverse-paths into something else.
G.9. Changes from version -06 to -07
These changes were made after -06 was posted and, in general, during
and subsequent to IETF last Call.
1. Clarified sentence that described the syntax of the domain part
of an address. Syntax was ok.
2. Truncated the "Context and Notes" section from the prior drafts.
(That section is to be removed entirely by the RFC Editor, as
noted.)
3. Incorporated a large number of Last Call comments, per note from
Tony Hansen to the mailing list.
4. Made some syntax corrections to better align the document with
normal uses of ABNF. The ABNF in the document remains
descriptive rather than normative.
5. Revised the description of trace and FOR clauses to be consistent
with the decision to permit only one path in them.
6. Removed unreferenced documents from references sections.
7. Tuned some text to better align with other recommendations, e.g.,
explicitly indicated that the Message Submission protocol was
preferred over the use of SMTP for that purpose.
G.10. Changes from version -07 to -08
This version was created to capture the remaining Last Call comments
and as the basis for a final check in a second Last Call. Changes
were made to the rules about quoted strings and a number of
formatting issues were resolved.
G.11. Changes from version -08 to -09
Changes resulting from second last call, including some minor
editorial adjustments, a change in terminology about mail sessions,
and elimination of an example that used the SEND command. This
version was prepared as a clean copy for IESG final review and, it is
hoped, forwarding to the RFC Editor.
G.12. Changes from version -09 to -10
1. Changed uses of "character length" to "octet length" and wrote a
brief introduction
2. Modified text in Appendix A to permit extensions that would
permit non-ASCII characters in command arguments or replies.
3. Moved reference to RFC 1870 to Normative, since it is referenced
in a SHOULD.
4. Changed the description of MX handling using Glenn Anderson's
text. No substantive change, just clarity.
Author's Address
John C. Klensin
1770 Massachusetts Ave, Suite 322
Cambridge, MA 02140
USA
Email: john+smtp@jck.com
Full Copyright Statement Full Copyright Statement
Copyright (C) The Internet Society (2001). All Rights Reserved. Copyright (C) The IETF Trust (2008).
This document and translations of it may be copied and furnished to This document is subject to the rights, licenses and restrictions
others, and derivative works that comment on or otherwise explain it contained in BCP 78, and except as set forth therein, the authors
or assist in its implementation may be prepared, copied, published retain all their rights.
and distributed, in whole or in part, without restriction of any
kind, provided that the above copyright notice and this paragraph are
included on all such copies and derivative works. However, this
document itself may not be modified in any way, such as by removing
the copyright notice or references to the Internet Society or other
Internet organizations, except as needed for the purpose of
developing Internet standards in which case the procedures for
copyrights defined in the Internet Standards process must be
followed, or as required to translate it into languages other than
English.
The limited permissions granted above are perpetual and will not be This document and the information contained herein are provided on an
revoked by the Internet Society or its successors or assigns. "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
This document and the information contained herein is provided on an Intellectual Property
"AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
Acknowledgement The IETF takes no position regarding the validity or scope of any
Intellectual Property Rights or other rights that might be claimed to
pertain to the implementation or use of the technology described in
this document or the extent to which any license under such rights
might or might not be available; nor does it represent that it has
made any independent effort to identify any such rights. Information
on the procedures with respect to rights in RFC documents can be
found in BCP 78 and BCP 79.
Funding for the RFC Editor function is currently provided by the Copies of IPR disclosures made to the IETF Secretariat and any
Internet Society. assurances of licenses to be made available, or the result of an
attempt made to obtain a general license or permission for the use of
such proprietary rights by implementers or users of this
specification can be obtained from the IETF on-line IPR repository at
http://www.ietf.org/ipr.
The IETF invites any interested party to bring to its attention any
copyrights, patents or patent applications, or other proprietary
rights that may cover technology that may be required to implement
this standard. Please address the information to the IETF at
ietf-ipr@ietf.org.
 End of changes. 543 change blocks. 
1381 lines changed or deleted 2261 lines changed or added

This html diff was produced by rfcdiff 1.32. The latest version is available from http://www.levkowetz.com/ietf/tools/rfcdiff/