idnits 2.17.1 draft-klensin-rfc2821bis-11.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** It looks like you're using RFC 3978 boilerplate. You should update this to the boilerplate described in the IETF Trust License Policy document (see https://trustee.ietf.org/license-info), which is required now. -- Found old boilerplate from RFC 3978, Section 5.1 on line 17. -- Found old boilerplate from RFC 3978, Section 5.5, updated by RFC 4748 on line 4600. -- Found old boilerplate from RFC 3979, Section 5, paragraph 1 on line 4611. -- Found old boilerplate from RFC 3979, Section 5, paragraph 2 on line 4618. -- Found old boilerplate from RFC 3979, Section 5, paragraph 3 on line 4624. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- == There are 2 instances of lines with non-RFC2606-compliant FQDNs in the document. -- The draft header indicates that this document obsoletes RFC2821, but the abstract doesn't seem to mention this, which it should. -- The draft header indicates that this document updates RFC1123, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust Copyright Line does not match the current year == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: When an SMTP server returns a permanent error status (5yz) code after the DATA command is completed with ., it MUST NOT make any subsequent attempt to deliver the message. As with temporary error status codes, the SMTP client retains responsibility for the message, but SHOULD not again attempt delivery to the same server without user review of the message and response and appropriate intervention. (Using the creation date from RFC1123, updated by this document, for RFC5378 checks: 1989-10-01) -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (July 11, 2008) is 5767 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Obsolete normative reference: RFC 821 (ref. '2') (Obsoleted by RFC 2821) -- Possible downref: Non-RFC (?) normative reference: ref. '6' -- Obsolete informational reference (is this intentional?): RFC 974 (ref. '12') (Obsoleted by RFC 2821) -- Obsolete informational reference (is this intentional?): RFC 1869 (ref. '13') (Obsoleted by RFC 2821) -- Obsolete informational reference (is this intentional?): RFC 2821 (ref. '14') (Obsoleted by RFC 5321) -- Obsolete informational reference (is this intentional?): RFC 3501 (ref. '17') (Obsoleted by RFC 9051) -- Obsolete informational reference (is this intentional?): RFC 4409 (ref. '18') (Obsoleted by RFC 6409) -- Obsolete informational reference (is this intentional?): RFC 1652 (ref. '22') (Obsoleted by RFC 6152) -- Obsolete informational reference (is this intentional?): RFC 822 (ref. '28') (Obsoleted by RFC 2822) -- Obsolete informational reference (is this intentional?): RFC 4408 (ref. '29') (Obsoleted by RFC 7208) -- Obsolete informational reference (is this intentional?): RFC 4871 (ref. '31') (Obsoleted by RFC 6376) -- Obsolete informational reference (is this intentional?): RFC 3798 (ref. '37') (Obsoleted by RFC 8098) -- Obsolete informational reference (is this intentional?): RFC 3851 (ref. '45') (Obsoleted by RFC 5751) Summary: 2 errors (**), 0 flaws (~~), 3 warnings (==), 21 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group J. Klensin 3 Internet-Draft July 11, 2008 4 Obsoletes: 2821 (if approved) 5 Updates: 1123 (if approved) 6 Intended status: Standards Track 7 Expires: January 12, 2009 9 Simple Mail Transfer Protocol 10 draft-klensin-rfc2821bis-11.txt 12 Status of this Memo 14 By submitting this Internet-Draft, each author represents that any 15 applicable patent or other IPR claims of which he or she is aware 16 have been or will be disclosed, and any of which he or she becomes 17 aware will be disclosed, in accordance with Section 6 of BCP 79. 19 Internet-Drafts are working documents of the Internet Engineering 20 Task Force (IETF), its areas, and its working groups. Note that 21 other groups may also distribute working documents as Internet- 22 Drafts. 24 Internet-Drafts are draft documents valid for a maximum of six months 25 and may be updated, replaced, or obsoleted by other documents at any 26 time. It is inappropriate to use Internet-Drafts as reference 27 material or to cite them other than as "work in progress." 29 The list of current Internet-Drafts can be accessed at 30 http://www.ietf.org/ietf/1id-abstracts.txt. 32 The list of Internet-Draft Shadow Directories can be accessed at 33 http://www.ietf.org/shadow.html. 35 This Internet-Draft will expire on January 12, 2009. 37 Abstract 39 This document is a specification of the basic protocol for Internet 40 electronic mail transport. It consolidates, updates, and clarifies 41 several previous documents, making all or parts of most of them 42 obsolete. It covers the SMTP extension mechanisms and best practices 43 for the contemporary Internet, but does not provide details about 44 particular extensions. Although SMTP was designed as a mail 45 transport and delivery protocol, this specification also contains 46 information that is important to its use as a "mail submission" 47 protocol for "split-UA" mail reading systems and mobile environments. 49 Table of Contents 51 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 6 52 1.1. Context and Notes for this Draft . . . . . . . . . . . . . 6 53 1.2. Mailing List . . . . . . . . . . . . . . . . . . . . . . . 6 54 1.3. Transport of electronic mail . . . . . . . . . . . . . . . 6 55 1.4. History and context for this document . . . . . . . . . . 6 56 2. The SMTP Model . . . . . . . . . . . . . . . . . . . . . . . . 8 57 2.1. Basic Structure . . . . . . . . . . . . . . . . . . . . . 8 58 2.2. The Extension Model . . . . . . . . . . . . . . . . . . . 10 59 2.2.1. Background . . . . . . . . . . . . . . . . . . . . . . 10 60 2.2.2. Definition and Registration of Extensions . . . . . . 11 61 2.2.3. Special Issues with Extensions . . . . . . . . . . . . 12 62 2.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 12 63 2.3.1. Mail Objects . . . . . . . . . . . . . . . . . . . . . 12 64 2.3.2. Senders and Receivers . . . . . . . . . . . . . . . . 13 65 2.3.3. Mail Agents and Message Stores . . . . . . . . . . . . 13 66 2.3.4. Host . . . . . . . . . . . . . . . . . . . . . . . . . 14 67 2.3.5. Domain Names . . . . . . . . . . . . . . . . . . . . . 14 68 2.3.6. Buffer and State Table . . . . . . . . . . . . . . . . 15 69 2.3.7. Commands and Replies . . . . . . . . . . . . . . . . . 15 70 2.3.8. Lines . . . . . . . . . . . . . . . . . . . . . . . . 15 71 2.3.9. Message Content and Mail Data . . . . . . . . . . . . 16 72 2.3.10. Originator, Delivery, Relay, and Gateway Systems . . . 16 73 2.3.11. Mailbox and Address . . . . . . . . . . . . . . . . . 16 74 2.4. General Syntax Principles and Transaction Model . . . . . 17 75 3. The SMTP Procedures: An Overview . . . . . . . . . . . . . . . 18 76 3.1. Session Initiation . . . . . . . . . . . . . . . . . . . . 19 77 3.2. Client Initiation . . . . . . . . . . . . . . . . . . . . 19 78 3.3. Mail Transactions . . . . . . . . . . . . . . . . . . . . 20 79 3.4. Forwarding for Address Correction or Updating . . . . . . 22 80 3.5. Commands for Debugging Addresses . . . . . . . . . . . . . 23 81 3.5.1. Overview . . . . . . . . . . . . . . . . . . . . . . . 23 82 3.5.2. VRFY Normal Response . . . . . . . . . . . . . . . . . 25 83 3.5.3. Meaning of VRFY or EXPN Success Response . . . . . . . 26 84 3.5.4. Semantics and Applications of EXPN . . . . . . . . . . 26 85 3.6. Relaying and Mail Routing . . . . . . . . . . . . . . . . 27 86 3.6.1. Source Routes and Relaying . . . . . . . . . . . . . . 27 87 3.6.2. Mail eXchange Records and Relaying . . . . . . . . . . 27 88 3.6.3. Message Submission Servers as Relays . . . . . . . . . 28 89 3.7. Mail Gatewaying . . . . . . . . . . . . . . . . . . . . . 29 90 3.7.1. Header Fields in Gatewaying . . . . . . . . . . . . . 29 91 3.7.2. Received Lines in Gatewaying . . . . . . . . . . . . . 29 92 3.7.3. Addresses in Gatewaying . . . . . . . . . . . . . . . 30 93 3.7.4. Other Header Fields in Gatewaying . . . . . . . . . . 30 94 3.7.5. Envelopes in Gatewaying . . . . . . . . . . . . . . . 30 95 3.8. Terminating Sessions and Connections . . . . . . . . . . . 31 96 3.9. Mailing Lists and Aliases . . . . . . . . . . . . . . . . 31 97 3.9.1. Alias . . . . . . . . . . . . . . . . . . . . . . . . 32 98 3.9.2. List . . . . . . . . . . . . . . . . . . . . . . . . . 32 99 4. The SMTP Specifications . . . . . . . . . . . . . . . . . . . 32 100 4.1. SMTP Commands . . . . . . . . . . . . . . . . . . . . . . 33 101 4.1.1. Command Semantics and Syntax . . . . . . . . . . . . . 33 102 4.1.2. Command Argument Syntax . . . . . . . . . . . . . . . 41 103 4.1.3. Address Literals . . . . . . . . . . . . . . . . . . . 43 104 4.1.4. Order of Commands . . . . . . . . . . . . . . . . . . 44 105 4.1.5. Private-use Commands . . . . . . . . . . . . . . . . . 46 106 4.2. SMTP Replies . . . . . . . . . . . . . . . . . . . . . . . 46 107 4.2.1. Reply Code Severities and Theory . . . . . . . . . . . 48 108 4.2.2. Reply Codes by Function Groups . . . . . . . . . . . . 50 109 4.2.3. Reply Codes in Numeric Order . . . . . . . . . . . . . 52 110 4.2.4. Reply Code 502 . . . . . . . . . . . . . . . . . . . . 53 111 4.2.5. Reply Codes After DATA and the Subsequent 112 . . . . . . . . . . . . . . . . . . . . . 53 113 4.3. Sequencing of Commands and Replies . . . . . . . . . . . . 54 114 4.3.1. Sequencing Overview . . . . . . . . . . . . . . . . . 54 115 4.3.2. Command-Reply Sequences . . . . . . . . . . . . . . . 55 116 4.4. Trace Information . . . . . . . . . . . . . . . . . . . . 57 117 4.5. Additional Implementation Issues . . . . . . . . . . . . . 61 118 4.5.1. Minimum Implementation . . . . . . . . . . . . . . . . 61 119 4.5.2. Transparency . . . . . . . . . . . . . . . . . . . . . 62 120 4.5.3. Sizes and Timeouts . . . . . . . . . . . . . . . . . . 62 121 4.5.3.1. Size limits and minimums . . . . . . . . . . . . . 62 122 4.5.3.1.1. local-part . . . . . . . . . . . . . . . . . . 63 123 4.5.3.1.2. domain . . . . . . . . . . . . . . . . . . . . 63 124 4.5.3.1.3. path . . . . . . . . . . . . . . . . . . . . . 63 125 4.5.3.1.4. command line . . . . . . . . . . . . . . . . . 63 126 4.5.3.1.5. reply line . . . . . . . . . . . . . . . . . . 63 127 4.5.3.1.6. text line . . . . . . . . . . . . . . . . . . 63 128 4.5.3.1.7. message content . . . . . . . . . . . . . . . 63 129 4.5.3.1.8. recipients buffer . . . . . . . . . . . . . . 64 130 4.5.3.1.9. Treatment When Limits Exceeded . . . . . . . . 64 131 4.5.3.1.10. Too Many Recipients code . . . . . . . . . . . 64 132 4.5.3.2. Timeouts . . . . . . . . . . . . . . . . . . . . . 65 133 4.5.3.2.1. Initial 220 Message: 5 minutes . . . . . . . . 65 134 4.5.3.2.2. MAIL Command: 5 minutes . . . . . . . . . . . 66 135 4.5.3.2.3. RCPT Command: 5 minutes . . . . . . . . . . . 66 136 4.5.3.2.4. DATA Initiation: 2 minutes . . . . . . . . . . 66 137 4.5.3.2.5. Data Block: 3 minutes . . . . . . . . . . . . 66 138 4.5.3.2.6. DATA Termination: 10 minutes. . . . . . . . . 66 139 4.5.3.2.7. Server Timeout: 5 minutes. . . . . . . . . . . 66 140 4.5.4. Retry Strategies . . . . . . . . . . . . . . . . . . . 66 141 4.5.5. Messages with a null reverse-path . . . . . . . . . . 68 142 5. Address Resolution and Mail Handling . . . . . . . . . . . . . 69 143 5.1. Locating the Target Host . . . . . . . . . . . . . . . . . 69 144 5.2. IPv6 and MX Records . . . . . . . . . . . . . . . . . . . 71 146 6. Problem Detection and Handling . . . . . . . . . . . . . . . . 71 147 6.1. Reliable Delivery and Replies by Email . . . . . . . . . . 72 148 6.2. Unwanted, unsolicited, and "attack" messages . . . . . . . 73 149 6.3. Loop Detection . . . . . . . . . . . . . . . . . . . . . . 73 150 6.4. Compensating for Irregularities . . . . . . . . . . . . . 74 151 7. Security Considerations . . . . . . . . . . . . . . . . . . . 75 152 7.1. Mail Security and Spoofing . . . . . . . . . . . . . . . . 75 153 7.2. "Blind" Copies . . . . . . . . . . . . . . . . . . . . . . 76 154 7.3. VRFY, EXPN, and Security . . . . . . . . . . . . . . . . . 77 155 7.4. Mail Rerouting Based on the 251 and 551 Response Codes . . 77 156 7.5. Information Disclosure in Announcements . . . . . . . . . 78 157 7.6. Information Disclosure in Trace Fields . . . . . . . . . . 78 158 7.7. Information Disclosure in Message Forwarding . . . . . . . 78 159 7.8. Resistance to Attacks . . . . . . . . . . . . . . . . . . 78 160 7.9. Scope of Operation of SMTP Servers . . . . . . . . . . . . 79 161 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 79 162 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 80 163 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 81 164 10.1. Normative References . . . . . . . . . . . . . . . . . . . 81 165 10.2. Informative References . . . . . . . . . . . . . . . . . . 82 166 Appendix A. TCP Transport Service . . . . . . . . . . . . . . . . 85 167 Appendix B. Generating SMTP Commands from RFC 822 Header 168 Fields . . . . . . . . . . . . . . . . . . . . . . . 85 169 Appendix C. Source Routes . . . . . . . . . . . . . . . . . . . . 86 170 Appendix D. Scenarios . . . . . . . . . . . . . . . . . . . . . . 87 171 D.1. A Typical SMTP Transaction Scenario . . . . . . . . . . . 87 172 D.2. Aborted SMTP Transaction Scenario . . . . . . . . . . . . 88 173 D.3. Relayed Mail Scenario . . . . . . . . . . . . . . . . . . 89 174 D.4. Verifying and Sending Scenario . . . . . . . . . . . . . . 90 175 Appendix E. Other Gateway Issues . . . . . . . . . . . . . . . . 91 176 Appendix F. Deprecated Features of RFC 821 . . . . . . . . . . . 91 177 F.1. TURN . . . . . . . . . . . . . . . . . . . . . . . . . . . 91 178 F.2. Source Routing . . . . . . . . . . . . . . . . . . . . . . 91 179 F.3. HELO . . . . . . . . . . . . . . . . . . . . . . . . . . . 92 180 F.4. #-literals . . . . . . . . . . . . . . . . . . . . . . . . 92 181 F.5. Dates and Years . . . . . . . . . . . . . . . . . . . . . 92 182 F.6. Sending versus Mailing . . . . . . . . . . . . . . . . . . 92 183 Appendix G. Change log . . . . . . . . . . . . . . . . . . . . . 92 184 G.1. Changes from RFC 2821 to the initial (-00) version of 185 this draft . . . . . . . . . . . . . . . . . . . . . . . . 93 186 G.2. Changes from version -00 to -01 . . . . . . . . . . . . . 93 187 G.3. Changes from version -01 to -02 . . . . . . . . . . . . . 94 188 G.4. Changes from version -02 to -03 . . . . . . . . . . . . . 95 189 G.5. Changes from version -02 to -03 . . . . . . . . . . . . . 95 190 G.6. Changes from version -03 to -04 . . . . . . . . . . . . . 95 191 G.7. Changes from version -04 to -05 . . . . . . . . . . . . . 96 192 G.8. Changes from version -05 to -06 . . . . . . . . . . . . . 96 193 G.9. Changes from version -06 to -07 . . . . . . . . . . . . . 96 194 G.10. Changes from version -07 to -08 . . . . . . . . . . . . . 97 195 G.11. Changes from version -08 to -09 . . . . . . . . . . . . . 97 196 G.12. Changes from version -09 to -10 . . . . . . . . . . . . . 97 197 G.13. Changes from version -10 to -11 . . . . . . . . . . . . . 97 198 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 98 199 Intellectual Property and Copyright Statements . . . . . . . . . . 99 201 1. Introduction 203 [[RFC Editor: Please remove the next two subsections, i.e., 204 Section 1.1 and Section 1.2]] 206 1.1. Context and Notes for this Draft 208 This version of the I-D is generated after the second IETF Last Call 209 (on the changes in draft-klensin-rfc2821bis-08) and additional small 210 changes to provide the IESG and RFC Editor a clean copy for final 211 evaluation (-09 and -10), editing and publication. 213 1.2. Mailing List 215 This document is being discussed on the historical SMTP mailing list, 216 ietf-smtp, maintained at imc.org. 218 1.3. Transport of electronic mail 220 The objective of the Simple Mail Transfer Protocol (SMTP) is to 221 transfer mail reliably and efficiently. 223 SMTP is independent of the particular transmission subsystem and 224 requires only a reliable ordered data stream channel. While this 225 document specifically discusses transport over TCP, other transports 226 are possible. Appendices to RFC 821 describe some of them. 228 An important feature of SMTP is its capability to transport mail 229 across multiple networks, usually referred to as "SMTP mail relaying" 230 (see Section 3.6). A network consists of the mutually-TCP-accessible 231 hosts on the public Internet, the mutually-TCP-accessible hosts on a 232 firewall-isolated TCP/IP Intranet, or hosts in some other LAN or WAN 233 environment utilizing a non-TCP transport-level protocol. Using 234 SMTP, a process can transfer mail to another process on the same 235 network or to some other network via a relay or gateway process 236 accessible to both networks. 238 In this way, a mail message may pass through a number of intermediate 239 relay or gateway hosts on its path from sender to ultimate recipient. 240 The Mail eXchanger mechanisms of the domain name system (RFC 1035 241 [1], RFC 974 [12], and Section 5 of this document) are used to 242 identify the appropriate next-hop destination for a message being 243 transported. 245 1.4. History and context for this document 247 This document is a specification of the basic protocol for the 248 Internet electronic mail transport. It consolidates, updates and 249 clarifies, but doesn't add new or change existing functionality of 250 the following: 252 o the original SMTP (Simple Mail Transfer Protocol) specification of 253 RFC 821 [2], 255 o domain name system requirements and implications for mail 256 transport from RFC 1035 [1] and RFC 974 [12], 258 o the clarifications and applicability statements in RFC 1123 [3], 259 and 261 o material drawn from the SMTP Extension mechanisms in RFC 1869 262 [13]. 264 o Editorial and clarification changes to RFC 2821 [14] to bring that 265 specification to Draft Standard. 267 It obsoletes RFC 821, RFC 974, RFC 1869, and RFC 2821 and updates RFC 268 1123 (replacing the mail transport materials of RFC 1123). However, 269 RFC 821 specifies some features that were not in significant use in 270 the Internet by the mid-1990s and (in appendices) some additional 271 transport models. Those sections are omitted here in the interest of 272 clarity and brevity; readers needing them should refer to RFC 821. 274 It also includes some additional material from RFC 1123 that required 275 amplification. This material has been identified in multiple ways, 276 mostly by tracking flaming on various lists and newsgroups and 277 problems of unusual readings or interpretations that have appeared as 278 the SMTP extensions have been deployed. Where this specification 279 moves beyond consolidation and actually differs from earlier 280 documents, it supersedes them technically as well as textually. 282 Although SMTP was designed as a mail transport and delivery protocol, 283 this specification also contains information that is important to its 284 use as a "mail submission" protocol, as recommended for POP (RFC 937 285 [15], RFC 1939 [16]) and IMAP (RFC 3501 [17]). In general, the 286 separate mail submission protocol specified in RFC 4409 [18] is now 287 preferred to direct use of SMTP; more discussion of that subject 288 appears in that document. 290 Section 2.3 provides definitions of terms specific to this document. 291 Except when the historical terminology is necessary for clarity, this 292 document uses the current 'client' and 'server' terminology to 293 identify the sending and receiving SMTP processes, respectively. 295 A companion document RFC 2822 [4] discusses message header sections 296 and bodies and specifies formats and structures for them. 298 2. The SMTP Model 300 2.1. Basic Structure 302 The SMTP design can be pictured as: 304 +----------+ +----------+ 305 +------+ | | | | 306 | User |<-->| | SMTP | | 307 +------+ | Client- |Commands/Replies| Server- | 308 +------+ | SMTP |<-------------->| SMTP | +------+ 309 | File |<-->| | and Mail | |<-->| File | 310 |System| | | | | |System| 311 +------+ +----------+ +----------+ +------+ 312 SMTP client SMTP server 314 When an SMTP client has a message to transmit, it establishes a two- 315 way transmission channel to an SMTP server. The responsibility of an 316 SMTP client is to transfer mail messages to one or more SMTP servers, 317 or report its failure to do so. 319 The means by which a mail message is presented to an SMTP client, and 320 how that client determines the identifier(s) ("names") of the 321 domain(s) to which mail messages are to be transferred is a local 322 matter, and is not addressed by this document. In some cases, the 323 designated domain(s), or those determined by an SMTP client, will 324 identify the final destination(s) of the mail message. In other 325 cases, common with SMTP clients associated with implementations of 326 the POP (RFC 937 [15], RFC 1939 [16]) or IMAP (RFC 3501 [17]) 327 protocols, or when the SMTP client is inside an isolated transport 328 service environment, the domain determined will identify an 329 intermediate destination through which all mail messages are to be 330 relayed. SMTP clients that transfer all traffic regardless of the 331 target domains associated with the individual messages, or that do 332 not maintain queues for retrying message transmissions that initially 333 cannot be completed, may otherwise conform to this specification but 334 are not considered fully-capable. Fully-capable SMTP 335 implementations, including the relays used by these less capable 336 ones, and their destinations, are expected to support all of the 337 queuing, retrying, and alternate address functions discussed in this 338 specification. In many situations and configurations, the less- 339 capable clients discussed above SHOULD be using the message 340 submission protocol (RFC 4409 [18]) rather than SMTP. 342 The means by which an SMTP client, once it has determined a target 343 domain, determines the identity of an SMTP server to which a copy of 344 a message is to be transferred, and then performs that transfer, is 345 covered by this document. To effect a mail transfer to an SMTP 346 server, an SMTP client establishes a two-way transmission channel to 347 that SMTP server. An SMTP client determines the address of an 348 appropriate host running an SMTP server by resolving a destination 349 domain name to either an intermediate Mail eXchanger host or a final 350 target host. 352 An SMTP server may be either the ultimate destination or an 353 intermediate "relay" (that is, it may assume the role of an SMTP 354 client after receiving the message) or "gateway" (that is, it may 355 transport the message further using some protocol other than SMTP). 356 SMTP commands are generated by the SMTP client and sent to the SMTP 357 server. SMTP replies are sent from the SMTP server to the SMTP 358 client in response to the commands. 360 In other words, message transfer can occur in a single connection 361 between the original SMTP-sender and the final SMTP-recipient, or can 362 occur in a series of hops through intermediary systems. In either 363 case, once the server has issued a success response at the end of the 364 mail data, a formal handoff of responsibility for the message occurs: 365 the protocol requires that a server MUST accept responsibility for 366 either delivering the message or properly reporting the failure to do 367 so (see Section 6.1, Section 6.2, Section 7.8, below). 369 Once the transmission channel is established and initial handshaking 370 completed, the SMTP client normally initiates a mail transaction. 371 Such a transaction consists of a series of commands to specify the 372 originator and destination of the mail and transmission of the 373 message content (including any lines in the header section or other 374 structure) itself. When the same message is sent to multiple 375 recipients, this protocol encourages the transmission of only one 376 copy of the data for all recipients at the same destination (or 377 intermediate relay) host. 379 The server responds to each command with a reply; replies may 380 indicate that the command was accepted, that additional commands are 381 expected, or that a temporary or permanent error condition exists. 382 Commands specifying the sender or recipients may include server- 383 permitted SMTP service extension requests as discussed in 384 Section 2.2. The dialog is purposely lock-step, one-at-a-time, 385 although this can be modified by mutually-agreed extension requests 386 such as command pipelining (RFC 2920 [19]). 388 Once a given mail message has been transmitted, the client may either 389 request that the connection be shut down or may initiate other mail 390 transactions. In addition, an SMTP client may use a connection to an 391 SMTP server for ancillary services such as verification of email 392 addresses or retrieval of mailing list subscriber addresses. 394 As suggested above, this protocol provides mechanisms for the 395 transmission of mail. Historically, this transmission normally 396 occurred directly from the sending user's host to the receiving 397 user's host when the two hosts are connected to the same transport 398 service. When they are not connected to the same transport service, 399 transmission occurs via one or more relay SMTP servers. A very 400 common case in the Internet today involves submission of the original 401 message to an intermediate, "message submission" server, which is 402 similar to a relay but has some additional properties; such servers 403 are discussed in Section 2.3.10 and at some length in RFC 4409 [18] . 404 An intermediate host that acts as either an SMTP relay or as a 405 gateway into some other transmission environment is usually selected 406 through the use of the domain name service (DNS) Mail eXchanger 407 mechanism. 409 Usually, intermediate hosts are determined via the DNS MX record, not 410 by explicit "source" routing (see Section 5 and Appendix C and 411 Appendix F.2). 413 2.2. The Extension Model 415 2.2.1. Background 417 In an effort that started in 1990, approximately a decade after RFC 418 821 was completed, the protocol was modified with a "service 419 extensions" model that permits the client and server to agree to 420 utilize shared functionality beyond the original SMTP requirements. 421 The SMTP extension mechanism defines a means whereby an extended SMTP 422 client and server may recognize each other, and the server can inform 423 the client as to the service extensions that it supports. 425 Contemporary SMTP implementations MUST support the basic extension 426 mechanisms. For instance, servers MUST support the EHLO command even 427 if they do not implement any specific extensions and clients SHOULD 428 preferentially utilize EHLO rather than HELO. (However, for 429 compatibility with older conforming implementations, SMTP clients and 430 servers MUST support the original HELO mechanisms as a fallback.) 431 Unless the different characteristics of HELO must be identified for 432 interoperability purposes, this document discusses only EHLO. 434 SMTP is widely deployed and high-quality implementations have proven 435 to be very robust. However, the Internet community now considers 436 some services to be important that were not anticipated when the 437 protocol was first designed. If support for those services is to be 438 added, it must be done in a way that permits older implementations to 439 continue working acceptably. The extension framework consists of: 441 o The SMTP command EHLO, superseding the earlier HELO, 443 o a registry of SMTP service extensions, 445 o additional parameters to the SMTP MAIL and RCPT commands, and 447 o optional replacements for commands defined in this protocol, such 448 as for DATA in non-ASCII transmissions (RFC 3030 [20]). 450 SMTP's strength comes primarily from its simplicity. Experience with 451 many protocols has shown that protocols with few options tend towards 452 ubiquity, whereas protocols with many options tend towards obscurity. 454 Each and every extension, regardless of its benefits, must be 455 carefully scrutinized with respect to its implementation, deployment, 456 and interoperability costs. In many cases, the cost of extending the 457 SMTP service will likely outweigh the benefit. 459 2.2.2. Definition and Registration of Extensions 461 The IANA maintains a registry of SMTP service extensions. A 462 corresponding EHLO keyword value is associated with each extension. 463 Each service extension registered with the IANA must be defined in a 464 formal standards-track or IESG-approved experimental protocol 465 document. The definition must include: 467 o the textual name of the SMTP service extension; 469 o the EHLO keyword value associated with the extension; 471 o the syntax and possible values of parameters associated with the 472 EHLO keyword value; 474 o any additional SMTP verbs associated with the extension 475 (additional verbs will usually be, but are not required to be, the 476 same as the EHLO keyword value); 478 o any new parameters the extension associates with the MAIL or RCPT 479 verbs; 481 o a description of how support for the extension affects the 482 behavior of a server and client SMTP; and, 484 o the increment by which the extension is increasing the maximum 485 length of the commands MAIL and/or RCPT, over that specified in 486 this standard. 488 In addition, any EHLO keyword value starting with an upper or lower 489 case "X" refers to a local SMTP service extension used exclusively 490 through bilateral agreement. Keywords beginning with "X" MUST NOT be 491 used in a registered service extension. Conversely, keyword values 492 presented in the EHLO response that do not begin with "X" MUST 493 correspond to a standard, standards-track, or IESG-approved 494 experimental SMTP service extension registered with IANA. A 495 conforming server MUST NOT offer non-"X"-prefixed keyword values that 496 are not described in a registered extension. 498 Additional verbs and parameter names are bound by the same rules as 499 EHLO keywords; specifically, verbs beginning with "X" are local 500 extensions that may not be registered or standardized. Conversely, 501 verbs not beginning with "X" must always be registered. 503 2.2.3. Special Issues with Extensions 505 Extensions that change fairly basic properties of SMTP operation are 506 permitted. The text in other sections of this document must be 507 understood in that context. In particular, extensions can change the 508 minimum limits specified in Section 4.5.3, can change the ASCII 509 character set requirement as mentioned above, or can introduce some 510 optional modes of message handling. 512 In particular, if an extension implies that the delivery path 513 normally supports special features of that extension, and an 514 intermediate SMTP system finds a next hop that does not support the 515 required extension, it MAY choose, based on the specific extension 516 and circumstances, to requeue the message and try later and/or try an 517 alternate MX host. If this strategy is employed, the timeout to fall 518 back to an unextended format (if one is available) SHOULD be less 519 than the normal timeout for bouncing as undeliverable (e.g., if 520 normal timeout is three days, the requeue timeout before attempting 521 to transmit the mail without the extension might be one day). 523 2.3. Terminology 525 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 526 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 527 document are to be interpreted as described in RFC 2119 [5]. As each 528 of these terms was intentionally and carefully chosen to improve the 529 interoperability of email, each use of these terms is to be treated 530 as a conformance requirement. 532 2.3.1. Mail Objects 534 SMTP transports a mail object. A mail object contains an envelope 535 and content. 537 The SMTP envelope is sent as a series of SMTP protocol units 538 (described in Section 3). It consists of an originator address (to 539 which error reports should be directed); one or more recipient 540 addresses; and optional protocol extension material. Historically, 541 variations on the reverse path (originator) address specification 542 command (MAIL) could be used to specify alternate delivery modes, 543 such as immediate display; those variations have now been deprecated 544 (see Appendix F and Appendix F.6). 546 The SMTP content is sent in the SMTP DATA protocol unit and has two 547 parts: the header section and the body. If the content conforms to 548 other contemporary standards, the header section consists of a 549 collection of header fields, each consisting of a header name, a 550 colon, and data, structured as in the message format specification 551 (RFC 2822 [4]); the body, if structured, is defined according to MIME 552 (RFC 2045 [21]). The content is textual in nature, expressed using 553 the US-ASCII repertoire [6]. Although SMTP extensions (such as 554 "8BITMIME", RFC 1652 [22]) may relax this restriction for the content 555 body, the content header fields are always encoded using the US-ASCII 556 repertoire. Two MIME extensions (RFC 2047 [23] and RFC 2231 [24]) 557 define an algorithm for representing header values outside the US- 558 ASCII repertoire, while still encoding them using the US-ASCII 559 repertoire. 561 2.3.2. Senders and Receivers 563 In RFC 821, the two hosts participating in an SMTP transaction were 564 described as the "SMTP-sender" and "SMTP-receiver". This document 565 has been changed to reflect current industry terminology and hence 566 refers to them as the "SMTP client" (or sometimes just "the client") 567 and "SMTP server" (or just "the server"), respectively. Since a 568 given host may act both as server and client in a relay situation, 569 "receiver" and "sender" terminology is still used where needed for 570 clarity. 572 2.3.3. Mail Agents and Message Stores 574 Additional mail system terminology became common after RFC 821 was 575 published and, where convenient, is used in this specification. In 576 particular, SMTP servers and clients provide a mail transport service 577 and therefore act as "Mail Transfer Agents" (MTAs). "Mail User 578 Agents" (MUAs or UAs) are normally thought of as the sources and 579 targets of mail. At the source, an MUA might collect mail to be 580 transmitted from a user and hand it off to an MTA; the final 581 ("delivery") MTA would be thought of as handing the mail off to an 582 MUA (or at least transferring responsibility to it, e.g., by 583 depositing the message in a "message store"). However, while these 584 terms are used with at least the appearance of great precision in 585 other environments, the implied boundaries between MUAs and MTAs 586 often do not accurately match common, and conforming, practices with 587 Internet mail. Hence, the reader should be cautious about inferring 588 the strong relationships and responsibilities that might be implied 589 if these terms were used elsewhere. 591 2.3.4. Host 593 For the purposes of this specification, a host is a computer system 594 attached to the Internet (or, in some cases, to a private TCP/IP 595 network) and supporting the SMTP protocol. Hosts are known by names 596 (see the next section); they SHOULD NOT be identified by numerical 597 addresses, i.e., by address literals as described in Section 4.1.2. 599 2.3.5. Domain Names 601 A domain name (or often just a "domain") consists of one or more 602 components, separated by dots if more than one appears. In the case 603 of a top-level domain used by itself in an email address, a single 604 string is used without any dots. This makes the requirement, 605 described in more detail below, that only fully-qualified domain 606 names appear in SMTP transactions on the public Internet, 607 particularly important where top-level domains are involved. These 608 components ("labels" in DNS terminology, RFC 1035 [1]) are restricted 609 for SMTP purposes to consist of a sequence of letters, digits, and 610 hyphens drawn from the ASCII character set [6]. Domain names are 611 used as names of hosts and of other entities in the domain name 612 hierarchy. For example, a domain may refer to an alias (label of a 613 CNAME RR) or the label of Mail eXchanger records to be used to 614 deliver mail instead of representing a host name. See RFC 1035 [1] 615 and Section 5 of this specification. 617 The domain name, as described in this document and in RFC 1035 [1], 618 is the entire, fully-qualified name (often referred to as an "FQDN"). 619 A domain name that is not in FQDN form is no more than a local alias. 620 Local aliases MUST NOT appear in any SMTP transaction. 622 Only resolvable, fully-qualified, domain names (FQDNs) are permitted 623 when domain names are used in SMTP. In other words, names that can 624 be resolved to MX RRs or address (i.e. A or AAAA) RRs (as discussed 625 in Section 5) are permitted, as are CNAME RRs whose targets can be 626 resolved, in turn, to MX or address RRs. Local nicknames or 627 unqualified names MUST NOT be used. There are two exceptions to the 628 rule requiring FQDNs: 630 o The domain name given in the EHLO command MUST be either a primary 631 host name (a domain name that resolves to an address RR) or, if 632 the host has no name, an address literal as described in 633 Section 4.1.3 and discussed further in the EHLO discussion of 634 Section 4.1.4. 636 o The reserved mailbox name "postmaster" may be used in a RCPT 637 command without domain qualification (see Section 4.1.1.3) and 638 MUST be accepted if so used. 640 2.3.6. Buffer and State Table 642 SMTP sessions are stateful, with both parties carefully maintaining a 643 common view of the current state. In this document we model this 644 state by a virtual "buffer" and a "state table" on the server which 645 may be used by the client to, for example, "clear the buffer" or 646 "reset the state table," causing the information in the buffer to be 647 discarded and the state to be returned to some previous state. 649 2.3.7. Commands and Replies 651 SMTP commands and, unless altered by a service extension, message 652 data, are transmitted from the sender to the receiver via the 653 transmission channel in "lines". 655 An SMTP reply is an acknowledgment (positive or negative) sent in 656 "lines" from receiver to sender via the transmission channel in 657 response to a command. The general form of a reply is a numeric 658 completion code (indicating failure or success) usually followed by a 659 text string. The codes are for use by programs and the text is 660 usually intended for human users. RFC 3463 [25], specifies further 661 structuring of the reply strings, including the use of supplemental 662 and more specific completion codes (See also RFC 5248 [26]). 664 2.3.8. Lines 666 Lines consist of zero or more data characters terminated by the 667 sequence ASCII character "CR" (hex value 0D) followed immediately by 668 ASCII character "LF" (hex value 0A). This termination sequence is 669 denoted as in this document. Conforming implementations MUST 670 NOT recognize or generate any other character or character sequence 671 as a line terminator. Limits MAY be imposed on line lengths by 672 servers (see Section 4). 674 In addition, the appearance of "bare" "CR" or "LF" characters in text 675 (i.e., either without the other) has a long history of causing 676 problems in mail implementations and applications that use the mail 677 system as a tool. SMTP client implementations MUST NOT transmit 678 these characters except when they are intended as line terminators 679 and then MUST, as indicated above, transmit them only as a 680 sequence. 682 2.3.9. Message Content and Mail Data 684 The terms "message content" and "mail data" are used interchangeably 685 in this document to describe the material transmitted after the DATA 686 command is accepted and before the end of data indication is 687 transmitted. Message content includes the message header section and 688 the possibly-structured message body. The MIME specification (RFC 689 2045 [21]) provides the standard mechanisms for structured message 690 bodies. 692 2.3.10. Originator, Delivery, Relay, and Gateway Systems 694 This specification makes a distinction among four types of SMTP 695 systems, based on the role those systems play in transmitting 696 electronic mail. An "originating" system (sometimes called an SMTP 697 originator) introduces mail into the Internet or, more generally, 698 into a transport service environment. A "delivery" SMTP system is 699 one that receives mail from a transport service environment and 700 passes it to a mail user agent or deposits it in a message store 701 which a mail user agent is expected to subsequently access. A 702 "relay" SMTP system (usually referred to just as a "relay") receives 703 mail from an SMTP client and transmits it, without modification to 704 the message data other than adding trace information, to another SMTP 705 server for further relaying or for delivery. 707 A "gateway" SMTP system (usually referred to just as a "gateway") 708 receives mail from a client system in one transport environment and 709 transmits it to a server system in another transport environment. 710 Differences in protocols or message semantics between the transport 711 environments on either side of a gateway may require that the gateway 712 system perform transformations to the message that are not permitted 713 to SMTP relay systems. For the purposes of this specification, 714 firewalls that rewrite addresses should be considered as gateways, 715 even if SMTP is used on both sides of them (see RFC 2979 [27]). 717 2.3.11. Mailbox and Address 719 As used in this specification, an "address" is a character string 720 that identifies a user to whom mail will be sent or a location into 721 which mail will be deposited. The term "mailbox" refers to that 722 depository. The two terms are typically used interchangeably unless 723 the distinction between the location in which mail is placed (the 724 mailbox) and a reference to it (the address) is important. An 725 address normally consists of user and domain specifications. The 726 standard mailbox naming convention is defined to be 727 "local-part@domain"; contemporary usage permits a much broader set of 728 applications than simple "user names". Consequently, and due to a 729 long history of problems when intermediate hosts have attempted to 730 optimize transport by modifying them, the local-part MUST be 731 interpreted and assigned semantics only by the host specified in the 732 domain part of the address. 734 2.4. General Syntax Principles and Transaction Model 736 SMTP commands and replies have a rigid syntax. All commands begin 737 with a command verb. All replies begin with a three digit numeric 738 code. In some commands and replies, arguments are required following 739 the verb or reply code. Some commands do not accept arguments (after 740 the verb), and some reply codes are followed, sometimes optionally, 741 by free form text. In both cases, where text appears, it is 742 separated from the verb or reply code by a space character. Complete 743 definitions of commands and replies appear in Section 4. 745 Verbs and argument values (e.g., "TO:" or "to:" in the RCPT command 746 and extension name keywords) are not case sensitive, with the sole 747 exception in this specification of a mailbox local-part (SMTP 748 Extensions may explicitly specify case-sensitive elements). That is, 749 a command verb, an argument value other than a mailbox local-part, 750 and free form text MAY be encoded in upper case, lower case, or any 751 mixture of upper and lower case with no impact on its meaning. The 752 local-part of a mailbox MUST BE treated as case sensitive. 753 Therefore, SMTP implementations MUST take care to preserve the case 754 of mailbox local-parts. In particular, for some hosts the user 755 "smith" is different from the user "Smith". However, exploiting the 756 case sensitivity of mailbox local-parts impedes interoperability and 757 is discouraged. Mailbox domains follow normal DNS rules and are 758 hence not case sensitive. 760 A few SMTP servers, in violation of this specification (and RFC 821) 761 require that command verbs be encoded by clients in upper case. 762 Implementations MAY wish to employ this encoding to accommodate those 763 servers. 765 The argument clause consists of a variable length character string 766 ending with the end of the line, i.e., with the character sequence 767 . The receiver will take no action until this sequence is 768 received. 770 The syntax for each command is shown with the discussion of that 771 command. Common elements and parameters are shown in Section 4.1.2. 773 Commands and replies are composed of characters from the ASCII 774 character set [6]. When the transport service provides an 8-bit byte 775 (octet) transmission channel, each 7-bit character is transmitted 776 right justified in an octet with the high order bit cleared to zero. 777 More specifically, the unextended SMTP service provides seven bit 778 transport only. An originating SMTP client that has not successfully 779 negotiated an appropriate extension with a particular server (see the 780 next paragraph) MUST NOT transmit messages with information in the 781 high-order bit of octets. If such messages are transmitted in 782 violation of this rule, receiving SMTP servers MAY clear the high- 783 order bit or reject the message as invalid. In general, a relay SMTP 784 SHOULD assume that the message content it has received is valid and, 785 assuming that the envelope permits doing so, relay it without 786 inspecting that content. Of course, if the content is mislabeled and 787 the data path cannot accept the actual content, this may result in 788 ultimate delivery of a severely garbled message to the recipient. 789 Delivery SMTP systems MAY reject such messages, or return them as 790 undeliverable, rather than deliver them. In the absence of a server- 791 offered extension explicitly permitting it, a sending SMTP system is 792 not permitted to send envelope commands in any character set other 793 than US-ASCII. Receiving systems SHOULD reject such commands, 794 normally using "500 syntax error - invalid character" replies. 796 Eight-bit message content transmission MAY be requested of the server 797 by a client using extended SMTP facilities, notably the "8BITMIME" 798 extension, RFC 1652 [22]. 8BITMIME SHOULD be supported by SMTP 799 servers. However, it MUST NOT be construed as authorization to 800 transmit unrestricted eight bit material, nor does 8BITMIME authorize 801 transmission of any envelope material in other than ASCII. 8BITMIME 802 MUST NOT be requested by senders for material with the high bit on 803 that is not in MIME format with an appropriate content-transfer 804 encoding; servers MAY reject such messages. 806 The metalinguistic notation used in this document corresponds to the 807 "Augmented BNF" used in other Internet mail system documents. The 808 reader who is not familiar with that syntax should consult the ABNF 809 specification in RFC 5234 [7]. Metalanguage terms used in running 810 text are surrounded by pointed brackets (e.g., ) for clarity. 811 The reader is cautioned that the grammar expressed in the 812 metalanguage is not comprehensive. There are many instances in which 813 provisions in the text constrain or otherwise modify the syntax or 814 semantics implied by the grammar. 816 3. The SMTP Procedures: An Overview 818 This section contains descriptions of the procedures used in SMTP: 819 session initiation, the mail transaction, forwarding mail, verifying 820 mailbox names and expanding mailing lists, and the opening and 821 closing exchanges. Comments on relaying, a note on mail domains, and 822 a discussion of changing roles are included at the end of this 823 section. Several complete scenarios are presented in Appendix D. 825 3.1. Session Initiation 827 An SMTP session is initiated when a client opens a connection to a 828 server and the server responds with an opening message. 830 SMTP server implementations MAY include identification of their 831 software and version information in the connection greeting reply 832 after the 220 code, a practice that permits more efficient isolation 833 and repair of any problems. Implementations MAY make provision for 834 SMTP servers to disable the software and version announcement where 835 it causes security concerns. While some systems also identify their 836 contact point for mail problems, this is not a substitute for 837 maintaining the required "postmaster" address (see Section 4). 839 The SMTP protocol allows a server to formally reject a mail session 840 while still allowing the initial connection as follows: a 554 841 response MAY be given in the initial connection opening message 842 instead of the 220. A server taking this approach MUST still wait 843 for the client to send a QUIT (see Section 4.1.1.10) before closing 844 the connection and SHOULD respond to any intervening commands with 845 "503 bad sequence of commands". Since an attempt to make an SMTP 846 connection to such a system is probably in error, a server returning 847 a 554 response on connection opening SHOULD provide enough 848 information in the reply text to facilitate debugging of the sending 849 system. 851 3.2. Client Initiation 853 Once the server has sent the greeting (welcoming) message and the 854 client has received it, the client normally sends the EHLO command to 855 the server, indicating the client's identity. In addition to opening 856 the session, use of EHLO indicates that the client is able to process 857 service extensions and requests that the server provide a list of the 858 extensions it supports. Older SMTP systems that are unable to 859 support service extensions, and contemporary clients that do not 860 require service extensions in the mail session being initiated, MAY 861 use HELO instead of EHLO. Servers MUST NOT return the extended EHLO- 862 style response to a HELO command. For a particular connection 863 attempt, if the server returns a "command not recognized" response to 864 EHLO, the client SHOULD be able to fall back and send HELO. 866 In the EHLO command the host sending the command identifies itself; 867 the command may be interpreted as saying "Hello, I am " (and, 868 in the case of EHLO, "and I support service extension requests"). 870 3.3. Mail Transactions 872 There are three steps to SMTP mail transactions. The transaction 873 starts with a MAIL command which gives the sender identification. 874 (In general, the MAIL command may be sent only when no mail 875 transaction is in progress; see Section 4.1.4.) A series of one or 876 more RCPT commands follows giving the receiver information. Then a 877 DATA command initiates transfer of the mail data and is terminated by 878 the "end of mail" data indicator, which also confirms the 879 transaction. 881 The first step in the procedure is the MAIL command. 883 MAIL FROM: [SP ] 885 This command tells the SMTP-receiver that a new mail transaction is 886 starting and to reset all its state tables and buffers, including any 887 recipients or mail data. The portion of the first or 888 only argument contains the source mailbox (between "<" and ">" 889 brackets), which can be used to report errors (see Section 4.2 for a 890 discussion of error reporting). If accepted, the SMTP server returns 891 a 250 OK reply. If the mailbox specification is not acceptable for 892 some reason, the server MUST return a reply indicating whether the 893 failure is permanent (i.e., will occur again if the client tries to 894 send the same address again) or temporary (i.e., the address might be 895 accepted if the client tries again later). Despite the apparent 896 scope of this requirement, there are circumstances in which the 897 acceptability of the reverse-path may not be determined until one or 898 more forward-paths (in RCPT commands) can be examined. In those 899 cases, the server MAY reasonably accept the reverse-path (with a 250 900 reply) and then report problems after the forward-paths are received 901 and examined. Normally, failures produce 550 or 553 replies. 903 Historically, the was permitted to contain more than 904 just a mailbox, however, contemporary systems SHOULD NOT use source 905 routing (see Appendix C). 907 The optional are associated with negotiated SMTP 908 service extensions (see Section 2.2). 910 The second step in the procedure is the RCPT command. This step of 911 the procedure can be repeated any number of times. 913 RCPT TO: [ SP ] 915 The first or only argument to this command includes a forward-path 916 (normally a mailbox and domain, always surrounded by "<" and ">" 917 brackets) identifying one recipient. If accepted, the SMTP server 918 returns a 250 OK reply and stores the forward-path. If the recipient 919 is known not to be a deliverable address, the SMTP server returns a 920 550 reply, typically with a string such as "no such user - " and the 921 mailbox name (other circumstances and reply codes are possible). 923 The can contain more than just a mailbox. 924 Historically, the was permitted to contain a source 925 routing list of hosts and the destination mailbox, however, 926 contemporary SMTP clients SHOULD NOT utilize source routes (see 927 Appendix C). Servers MUST be prepared to encounter a list of source 928 routes in the forward-path, but SHOULD ignore the routes or MAY 929 decline to support the relaying they imply. Similarly, servers MAY 930 decline to accept mail that is destined for other hosts or systems. 931 These restrictions make a server useless as a relay for clients that 932 do not support full SMTP functionality. Consequently, restricted- 933 capability clients MUST NOT assume that any SMTP server on the 934 Internet can be used as their mail processing (relaying) site. If a 935 RCPT command appears without a previous MAIL command, the server MUST 936 return a 503 "Bad sequence of commands" response. The optional 937 are associated with negotiated SMTP service 938 extensions (see Section 2.2). 940 Since it has been a common source of errors, it is worth noting that 941 spaces are not permitted on either side of the colon following FROM 942 in the MAIL command or TO in the RCPT command. The syntax is exactly 943 as given above. 945 The third step in the procedure is the DATA command (or some 946 alternative specified in a service extension). 948 DATA 950 If accepted, the SMTP server returns a 354 Intermediate reply and 951 considers all succeeding lines up to but not including the end of 952 mail data indicator to be the message text. When the end of text is 953 successfully received and stored, the SMTP-receiver sends a 250 OK 954 reply. 956 Since the mail data is sent on the transmission channel, the end of 957 mail data must be indicated so that the command and reply dialog can 958 be resumed. SMTP indicates the end of the mail data by sending a 959 line containing only a "." (period or full stop). A transparency 960 procedure is used to prevent this from interfering with the user's 961 text (see Section 4.5.2). 963 The end of mail data indicator also confirms the mail transaction and 964 tells the SMTP server to now process the stored recipients and mail 965 data. If accepted, the SMTP server returns a 250 OK reply. The DATA 966 command can fail at only two points in the protocol exchange: 968 If there was no MAIL, or no RCPT, command, or all such commands were 969 rejected, the server MAY return a "command out of sequence" (503) or 970 "no valid recipients" (554) reply in response to the DATA command. 971 If one of those replies (or any other 5yz reply) is received, the 972 client MUST NOT send the message data; more generally, message data 973 MUST NOT be sent unless a 354 reply is received. 975 If the verb is initially accepted and the 354 reply issued, the DATA 976 command should fail only if the mail transaction was incomplete (for 977 example, no recipients), or if resources were unavailable (including, 978 of course, the server unexpectedly becoming unavailable), or if the 979 server determines that the message should be rejected for policy or 980 other reasons. 982 However, in practice, some servers do not perform recipient 983 verification until after the message text is received. These servers 984 SHOULD treat a failure for one or more recipients as a "subsequent 985 failure" and return a mail message as discussed in Section 6 and, in 986 particular, in Section 6.1. Using a "550 mailbox not found" (or 987 equivalent) reply code after the data are accepted makes it difficult 988 or impossible for the client to determine which recipients failed. 990 When RFC 822 format ([28], [4]) is being used, the mail data include 991 the header fields such as those named Date, Subject, To, Cc, From. 992 Server SMTP systems SHOULD NOT reject messages based on perceived 993 defects in the RFC 822 or MIME (RFC 2045 [21]) message header section 994 or message body. In particular, they MUST NOT reject messages in 995 which the numbers of Resent- header fields do not match or Resent-to 996 appears without Resent-from and/or Resent-date. 998 Mail transaction commands MUST be used in the order discussed above. 1000 3.4. Forwarding for Address Correction or Updating 1002 Forwarding support is most often required to consolidate and simplify 1003 addresses within, or relative to, some enterprise and less frequently 1004 to establish addresses to link a person's prior address with a 1005 current one. Silent forwarding of messages (without server 1006 notification to the sender), for security or non-disclosure purposes, 1007 is common in the contemporary Internet. 1009 In both the enterprise and the "new address" cases, information 1010 hiding (and sometimes security) considerations argue against exposure 1011 of the "final" address through the SMTP protocol as a side-effect of 1012 the forwarding activity. This may be especially important when the 1013 final address may not even be reachable by the sender. Consequently, 1014 the "forwarding" mechanisms described in section 3.2 of RFC 821, and 1015 especially the 251 (corrected destination) and 551 reply codes from 1016 RCPT must be evaluated carefully by implementers and, when they are 1017 available, by those configuring systems (see also Section 7.4). 1019 In particular: 1021 o Servers MAY forward messages when they are aware of an address 1022 change. When they do so, they MAY either provide address-updating 1023 information with a 251 code, or may forward "silently" and return 1024 a 250 code. However, if a 251 code is used, they MUST NOT assume 1025 that the client will actually update address information or even 1026 return that information to the user. 1028 Alternately, 1030 o Servers MAY reject messages or return them as nondeliverable when 1031 they cannot be delivered precisely as addressed. When they do so, 1032 they MAY either provide address-updating information with a 551 1033 code, or may reject the message as undeliverable with a 550 code 1034 and no address-specific information. However, if a 551 code is 1035 used, they MUST NOT assume that the client will actually update 1036 address information or even return that information to the user. 1038 SMTP server implementations that support the 251 and/or 551 reply 1039 codes SHOULD provide configuration mechanisms so that sites which 1040 conclude that they would undesirably disclose information can disable 1041 or restrict their use. 1043 3.5. Commands for Debugging Addresses 1045 3.5.1. Overview 1047 SMTP provides commands to verify a user name or obtain the content of 1048 a mailing list. This is done with the VRFY and EXPN commands, which 1049 have character string arguments. Implementations SHOULD support VRFY 1050 and EXPN (however, see Section 3.5.2 and Section 7.3). 1052 For the VRFY command, the string is a user name or a user name and 1053 domain (see below). If a normal (i.e., 250) response is returned, 1054 the response MAY include the full name of the user and MUST include 1055 the mailbox of the user. It MUST be in either of the following 1056 forms: 1058 User Name 1059 local-part@domain 1061 When a name that is the argument to VRFY could identify more than one 1062 mailbox, the server MAY either note the ambiguity or identify the 1063 alternatives. In other words, any of the following are legitimate 1064 responses to VRFY: 1066 553 User ambiguous 1068 or 1070 553- Ambiguous; Possibilities are 1071 553-Joe Smith 1072 553-Harry Smith 1073 553 Melvin Smith 1075 or 1077 553-Ambiguous; Possibilities 1078 553- 1079 553- 1080 553 1082 Under normal circumstances, a client receiving a 553 reply would be 1083 expected to expose the result to the user. Use of exactly the forms 1084 given, and the "user ambiguous" or "ambiguous" keywords, possibly 1085 supplemented by extended reply codes such as those described in RFC 1086 3463 [25], will facilitate automated translation into other languages 1087 as needed. Of course, a client that was highly automated or that was 1088 operating in another language than English, might choose to try to 1089 translate the response, to return some other indication to the user 1090 than the literal text of the reply, or to take some automated action 1091 such as consulting a directory service for additional information 1092 before reporting to the user. 1094 For the EXPN command, the string identifies a mailing list, and the 1095 successful (i.e., 250) multiline response MAY include the full name 1096 of the users and MUST give the mailboxes on the mailing list. 1098 In some hosts the distinction between a mailing list and an alias for 1099 a single mailbox is a bit fuzzy, since a common data structure may 1100 hold both types of entries, and it is possible to have mailing lists 1101 containing only one mailbox. If a request is made to apply VRFY to a 1102 mailing list, a positive response MAY be given if a message so 1103 addressed would be delivered to everyone on the list, otherwise an 1104 error SHOULD be reported (e.g., "550 That is a mailing list, not a 1105 user" or "252 Unable to verify members of mailing list"). If a 1106 request is made to expand a user name, the server MAY return a 1107 positive response consisting of a list containing one name, or an 1108 error MAY be reported (e.g., "550 That is a user name, not a mailing 1109 list"). 1111 In the case of a successful multiline reply (normal for EXPN) exactly 1112 one mailbox is to be specified on each line of the reply. The case 1113 of an ambiguous request is discussed above. 1115 "User name" is a fuzzy term and has been used deliberately. An 1116 implementation of the VRFY or EXPN commands MUST include at least 1117 recognition of local mailboxes as "user names". However, since 1118 current Internet practice often results in a single host handling 1119 mail for multiple domains, hosts, especially hosts that provide this 1120 functionality, SHOULD accept the "local-part@domain" form as a "user 1121 name"; hosts MAY also choose to recognize other strings as "user 1122 names". 1124 The case of expanding a mailbox list requires a multiline reply, such 1125 as: 1127 C: EXPN Example-People 1128 S: 250-Jon Postel 1129 S: 250-Fred Fonebone 1130 S: 250 Sam Q. Smith 1132 or 1134 C: EXPN Executive-Washroom-List 1135 S: 550 Access Denied to You. 1137 The character string arguments of the VRFY and EXPN commands cannot 1138 be further restricted due to the variety of implementations of the 1139 user name and mailbox list concepts. On some systems it may be 1140 appropriate for the argument of the EXPN command to be a file name 1141 for a file containing a mailing list, but again there are a variety 1142 of file naming conventions in the Internet. Similarly, historical 1143 variations in what is returned by these commands are such that the 1144 response SHOULD be interpreted very carefully, if at all, and SHOULD 1145 generally only be used for diagnostic purposes. 1147 3.5.2. VRFY Normal Response 1149 When normal (2yz or 551) responses are returned from a VRFY or EXPN 1150 request, the reply MUST include the name using a 1151 "" construction, where "domain" is a fully 1152 qualified domain name. In circumstances exceptional enough to 1153 justify violating the intent of this specification, free-form text 1154 MAY be returned. In order to facilitate parsing by both computers 1155 and people, addresses SHOULD appear in pointed brackets. When 1156 addresses, rather than free-form debugging information, are returned, 1157 EXPN and VRFY MUST return only valid domain addresses that are usable 1158 in SMTP RCPT commands. Consequently, if an address implies delivery 1159 to a program or other system, the mailbox name used to reach that 1160 target MUST be given. Paths (explicit source routes) MUST NOT be 1161 returned by VRFY or EXPN. 1163 Server implementations SHOULD support both VRFY and EXPN. For 1164 security reasons, implementations MAY provide local installations a 1165 way to disable either or both of these commands through configuration 1166 options or the equivalent (see Section 7.3). When these commands are 1167 supported, they are not required to work across relays when relaying 1168 is supported. Since they were both optional in RFC 821, but VRFY was 1169 made mandatory in RFC 1123 [3], if EXPN is supported, it MUST be 1170 listed as a service extension in an EHLO response. VRFY MAY be 1171 listed as a convenience but, since support for it is required, SMTP 1172 clients are not required to check for its presence on the extension 1173 list before using it. 1175 3.5.3. Meaning of VRFY or EXPN Success Response 1177 A server MUST NOT return a 250 code in response to a VRFY or EXPN 1178 command unless it has actually verified the address. In particular, 1179 a server MUST NOT return 250 if all it has done is to verify that the 1180 syntax given is valid. In that case, 502 (Command not implemented) 1181 or 500 (Syntax error, command unrecognized) SHOULD be returned. As 1182 stated elsewhere, implementation (in the sense of actually validating 1183 addresses and returning information) of VRFY and EXPN are strongly 1184 recommended. Hence, implementations that return 500 or 502 for VRFY 1185 are not in full compliance with this specification. 1187 There may be circumstances where an address appears to be valid but 1188 cannot reasonably be verified in real time, particularly when a 1189 server is acting as a mail exchanger for another server or domain. 1190 "Apparent validity" in this case would normally involve at least 1191 syntax checking and might involve verification that any domains 1192 specified were ones to which the host expected to be able to relay 1193 mail. In these situations, reply code 252 SHOULD be returned. These 1194 cases parallel the discussion of RCPT verification discussed in 1195 Section 2.1. Similarly, the discussion in Section 3.4 applies to the 1196 use of reply codes 251 and 551 with VRFY (and EXPN) to indicate 1197 addresses that are recognized but that would be forwarded or rejected 1198 were mail received for them. Implementations generally SHOULD be 1199 more aggressive about address verification in the case of VRFY than 1200 in the case of RCPT, even if it takes a little longer to do so. 1202 3.5.4. Semantics and Applications of EXPN 1204 EXPN is often very useful in debugging and understanding problems 1205 with mailing lists and multiple-target-address aliases. Some systems 1206 have attempted to use source expansion of mailing lists as a means of 1207 eliminating duplicates. The propagation of aliasing systems with 1208 mail on the Internet, for hosts (typically with MX and CNAME DNS 1209 records), for mailboxes (various types of local host aliases), and in 1210 various proxying arrangements, has made it nearly impossible for 1211 these strategies to work consistently, and mail systems SHOULD NOT 1212 attempt them. 1214 3.6. Relaying and Mail Routing 1216 3.6.1. Source Routes and Relaying 1218 In general, the availability of Mail eXchanger records in the domain 1219 name system (RFC 1035 [1], RFC 974 [12]) makes the use of explicit 1220 source routes in the Internet mail system unnecessary. Many 1221 historical problems with the interpretation of explicit source routes 1222 have made their use undesirable. SMTP clients SHOULD NOT generate 1223 explicit source routes except under unusual circumstances. SMTP 1224 servers MAY decline to act as mail relays or to accept addresses that 1225 specify source routes. When route information is encountered, SMTP 1226 servers MAY ignore the route information and simply send to the final 1227 destination specified as the last element in the route and SHOULD do 1228 so. There has been an invalid practice of using names that do not 1229 appear in the DNS as destination names, with the senders counting on 1230 the intermediate hosts specified in source routing to resolve any 1231 problems. If source routes are stripped, this practice will cause 1232 failures. This is one of several reasons why SMTP clients MUST NOT 1233 generate invalid source routes or depend on serial resolution of 1234 names. 1236 When source routes are not used, the process described in RFC 821 for 1237 constructing a reverse-path from the forward-path is not applicable 1238 and the reverse-path at the time of delivery will simply be the 1239 address that appeared in the MAIL command. 1241 3.6.2. Mail eXchange Records and Relaying 1243 A relay SMTP server is usually the target of a DNS MX record that 1244 designates it, rather than the final delivery system. The relay 1245 server may accept or reject the task of relaying the mail in the same 1246 way it accepts or rejects mail for a local user. If it accepts the 1247 task, it then becomes an SMTP client, establishes a transmission 1248 channel to the next SMTP server specified in the DNS (according to 1249 the rules in Section 5), and sends it the mail. If it declines to 1250 relay mail to a particular address for policy reasons, a 550 response 1251 SHOULD be returned. 1253 This specification does not deal with the verification of return 1254 paths for use in delivery notifications. Recent work, such as that 1255 on SPF [29] and DKIM [30] [31], has been done to provide ways to 1256 ascertain that an address is valid or belongs to the person who 1257 actually sent the message. A server MAY attempt to verify the return 1258 path before using its address for delivery notifications, but methods 1259 of doing so are not defined here nor is any particular method 1260 recommended at this time. 1262 3.6.3. Message Submission Servers as Relays 1264 Many mail-sending clients exist, especially in conjunction with 1265 facilities that receive mail via POP3 or IMAP, that have limited 1266 capability to support some of the requirements of this specification, 1267 such as the ability to queue messages for subsequent delivery 1268 attempts. For these clients, it is common practice to make private 1269 arrangements to send all messages to a single server for processing 1270 and subsequent distribution. SMTP, as specified here, is not ideally 1271 suited for this role. A standardized mail submission protocol has 1272 been developed that is gradually superseding practices based on SMTP 1273 (see RFC 4409 [18]). In any event, because these arrangements are 1274 private and fall outside the scope of this specification, they are 1275 not described here. 1277 It is important to note that MX records can point to SMTP servers 1278 which act as gateways into other environments, not just SMTP relays 1279 and final delivery systems; see sections Section 3.7 and Section 5. 1281 If an SMTP server has accepted the task of relaying the mail and 1282 later finds that the destination is incorrect or that the mail cannot 1283 be delivered for some other reason, then it MUST construct an 1284 "undeliverable mail" notification message and send it to the 1285 originator of the undeliverable mail (as indicated by the reverse- 1286 path). Formats specified for non-delivery reports by other standards 1287 (see, for example, RFC 3461 [32] and RFC 3464 [33]) SHOULD be used if 1288 possible. 1290 This notification message must be from the SMTP server at the relay 1291 host or the host that first determines that delivery cannot be 1292 accomplished. Of course, SMTP servers MUST NOT send notification 1293 messages about problems transporting notification messages. One way 1294 to prevent loops in error reporting is to specify a null reverse-path 1295 in the MAIL command of a notification message. When such a message 1296 is transmitted the reverse-path MUST be set to null (see 1297 Section 4.5.5 for additional discussion). A MAIL command with a null 1298 reverse-path appears as follows: 1300 MAIL FROM:<> 1302 As discussed in Section 6.4, a relay SMTP has no need to inspect or 1303 act upon the header section or body of the message data and MUST NOT 1304 do so except to add its own "Received:" header field (Section 4.4) 1305 and, optionally, to attempt to detect looping in the mail system (see 1306 Section 6.3). Of course this prohibition also applies to any 1307 modifications of these header fields or text (see also Section 7.9). 1309 3.7. Mail Gatewaying 1311 While the relay function discussed above operates within the Internet 1312 SMTP transport service environment, MX records or various forms of 1313 explicit routing may require that an intermediate SMTP server perform 1314 a translation function between one transport service and another. As 1315 discussed in Section 2.3.10, when such a system is at the boundary 1316 between two transport service environments, we refer to it as a 1317 "gateway" or "gateway SMTP". 1319 Gatewaying mail between different mail environments, such as 1320 different mail formats and protocols, is complex and does not easily 1321 yield to standardization. However, some general requirements may be 1322 given for a gateway between the Internet and another mail 1323 environment. 1325 3.7.1. Header Fields in Gatewaying 1327 Header fields MAY be rewritten when necessary as messages are 1328 gatewayed across mail environment boundaries. This may involve 1329 inspecting the message body or interpreting the local-part of the 1330 destination address in spite of the prohibitions in Section 6.4. 1332 Other mail systems gatewayed to the Internet often use a subset of 1333 the RFC 822 header section or provide similar functionality with a 1334 different syntax, but some of these mail systems do not have an 1335 equivalent to the SMTP envelope. Therefore, when a message leaves 1336 the Internet environment, it may be necessary to fold the SMTP 1337 envelope information into the message header section. A possible 1338 solution would be to create new header fields to carry the envelope 1339 information (e.g., "X-SMTP-MAIL:" and "X-SMTP-RCPT:"); however, this 1340 would require changes in mail programs in foreign environments and 1341 might risk disclosure of private information (see Section 7.2). 1343 3.7.2. Received Lines in Gatewaying 1345 When forwarding a message into or out of the Internet environment, a 1346 gateway MUST prepend a Received: line, but it MUST NOT alter in any 1347 way a Received: line that is already in the header section. 1349 "Received:" header fields of messages originating from other 1350 environments may not conform exactly to this specification. However, 1351 the most important use of Received: lines is for debugging mail 1352 faults, and this debugging can be severely hampered by well-meaning 1353 gateways that try to "fix" a Received: line. As another consequence 1354 of trace header fields arising in non-SMTP environments, receiving 1355 systems MUST NOT reject mail based on the format of a trace header 1356 field and SHOULD be extremely robust in the light of unexpected 1357 information or formats in those header fields. 1359 The gateway SHOULD indicate the environment and protocol in the "via" 1360 clauses of Received header field(s) that it supplies. 1362 3.7.3. Addresses in Gatewaying 1364 From the Internet side, the gateway SHOULD accept all valid address 1365 formats in SMTP commands and in the RFC 822 header section, and all 1366 valid RFC 822 messages. Addresses and header fields generated by 1367 gateways MUST conform to applicable Internet standards (including 1368 this one and RFC 822). Gateways are, of course, subject to the same 1369 rules for handling source routes as those described for other SMTP 1370 systems in Section 3.3. 1372 3.7.4. Other Header Fields in Gatewaying 1374 The gateway MUST ensure that all header fields of a message that it 1375 forwards into the Internet mail environment meet the requirements for 1376 Internet mail. In particular, all addresses in "From:", "To:", 1377 "Cc:", etc., header fields MUST be transformed (if necessary) to 1378 satisfy the standard header syntax of RFC 2822 [4], MUST reference 1379 only fully-qualified domain names, and MUST be effective and useful 1380 for sending replies. The translation algorithm used to convert mail 1381 from the Internet protocols to another environment's protocol SHOULD 1382 ensure that error messages from the foreign mail environment are 1383 delivered to the reverse path from the SMTP envelope, not to an 1384 address in the "From:", "Sender:", or similar header fields of the 1385 message. 1387 3.7.5. Envelopes in Gatewaying 1389 Similarly, when forwarding a message from another environment into 1390 the Internet, the gateway SHOULD set the envelope return path in 1391 accordance with an error message return address, if supplied by the 1392 foreign environment. If the foreign environment has no equivalent 1393 concept, the gateway must select and use a best approximation, with 1394 the message originator's address as the default of last resort. 1396 3.8. Terminating Sessions and Connections 1398 An SMTP connection is terminated when the client sends a QUIT 1399 command. The server responds with a positive reply code, after which 1400 it closes the connection. 1402 An SMTP server MUST NOT intentionally close the connection under 1403 normal operational circumstances (see Section 7.8) except: 1405 o After receiving a QUIT command and responding with a 221 reply. 1407 o After detecting the need to shut down the SMTP service and 1408 returning a 421 response code. This response code can be issued 1409 after the server receives any command or, if necessary, 1410 asynchronously from command receipt (on the assumption that the 1411 client will receive it after the next command is issued). 1413 o After a timeout, as specified in Section 4.5.3.2, occurs waiting 1414 for the client to send a command or data. 1416 In particular, a server that closes connections in response to 1417 commands that are not understood is in violation of this 1418 specification. Servers are expected to be tolerant of unknown 1419 commands, issuing a 500 reply and awaiting further instructions from 1420 the client. 1422 An SMTP server which is forcibly shut down via external means SHOULD 1423 attempt to send a line containing a 421 response code to the SMTP 1424 client before exiting. The SMTP client will normally read the 421 1425 response code after sending its next command. 1427 SMTP clients that experience a connection close, reset, or other 1428 communications failure due to circumstances not under their control 1429 (in violation of the intent of this specification but sometimes 1430 unavoidable) SHOULD, to maintain the robustness of the mail system, 1431 treat the mail transaction as if a 451 response had been received and 1432 act accordingly. 1434 3.9. Mailing Lists and Aliases 1436 An SMTP-capable host SHOULD support both the alias and the list 1437 models of address expansion for multiple delivery. When a message is 1438 delivered or forwarded to each address of an expanded list form, the 1439 return address in the envelope ("MAIL FROM:") MUST be changed to be 1440 the address of a person or other entity who administers the list. 1441 However, in this case, the message header section (RFC 2822 [4]) MUST 1442 be left unchanged; in particular, the "From" field of the header 1443 section is unaffected. 1445 An important mail facility is a mechanism for multi-destination 1446 delivery of a single message, by transforming (or "expanding" or 1447 "exploding") a pseudo-mailbox address into a list of destination 1448 mailbox addresses. When a message is sent to such a pseudo-mailbox 1449 (sometimes called an "exploder"), copies are forwarded or 1450 redistributed to each mailbox in the expanded list. Servers SHOULD 1451 simply utilize the addresses on the list; application of heuristics 1452 or other matching rules to eliminate some addresses, such as that of 1453 the originator, is strongly discouraged. We classify such a pseudo- 1454 mailbox as an "alias" or a "list", depending upon the expansion 1455 rules. 1457 3.9.1. Alias 1459 To expand an alias, the recipient mailer simply replaces the pseudo- 1460 mailbox address in the envelope with each of the expanded addresses 1461 in turn; the rest of the envelope and the message body are left 1462 unchanged. The message is then delivered or forwarded to each 1463 expanded address. 1465 3.9.2. List 1467 A mailing list may be said to operate by "redistribution" rather than 1468 by "forwarding". To expand a list, the recipient mailer replaces the 1469 pseudo-mailbox address in the envelope with each of the expanded 1470 addresses in turn. The return (backward-pointing) address in the 1471 envelope is changed so that all error messages generated by the final 1472 deliveries will be returned to a list administrator, not to the 1473 message originator, who generally has no control over the contents of 1474 the list and will typically find error messages annoying. Note that 1475 the key difference between handling aliases (Section 3.9.1) and 1476 forwarding (this subsection) is the change to the backward-pointing 1477 address in this case. When a list constrains its processing to the 1478 very limited set of modifications and actions described here, it is 1479 attempting to emulate an MTA; such lists can be treated as a 1480 continuation in email transit. 1482 There exist mailing lists that perform additional, sometimes 1483 extensive, modifications to a message and its envelope. Such mailing 1484 lists need to be viewed as full MUAs, which accept a delivery and 1485 post a new message. 1487 4. The SMTP Specifications 1488 4.1. SMTP Commands 1490 4.1.1. Command Semantics and Syntax 1492 The SMTP commands define the mail transfer or the mail system 1493 function requested by the user. SMTP commands are character strings 1494 terminated by . The commands themselves are alphabetic 1495 characters terminated by if parameters follow and 1496 otherwise. (In the interest of improved interoperability, SMTP 1497 receivers are SHOULD tolerate trailing white space before the 1498 terminating .) The syntax of the local part of a mailbox MUST 1499 conform to receiver site conventions and the syntax specified in 1500 Section 4.1.2. The SMTP commands are discussed below. The SMTP 1501 replies are discussed in Section 4.2. 1503 A mail transaction involves several data objects which are 1504 communicated as arguments to different commands. The reverse-path is 1505 the argument of the MAIL command, the forward-path is the argument of 1506 the RCPT command, and the mail data is the argument of the DATA 1507 command. These arguments or data objects must be transmitted and 1508 held pending the confirmation communicated by the end of mail data 1509 indication which finalizes the transaction. The model for this is 1510 that distinct buffers are provided to hold the types of data objects, 1511 that is, there is a reverse-path buffer, a forward-path buffer, and a 1512 mail data buffer. Specific commands cause information to be appended 1513 to a specific buffer, or cause one or more buffers to be cleared. 1515 Several commands (RSET, DATA, QUIT) are specified as not permitting 1516 parameters. In the absence of specific extensions offered by the 1517 server and accepted by the client, clients MUST NOT send such 1518 parameters and servers SHOULD reject commands containing them as 1519 having invalid syntax. 1521 4.1.1.1. Extended HELLO (EHLO) or HELLO (HELO) 1523 These commands are used to identify the SMTP client to the SMTP 1524 server. The argument clause contains the fully-qualified domain name 1525 of the SMTP client if one is available. In situations in which the 1526 SMTP client system does not have a meaningful domain name (e.g., when 1527 its address is dynamically allocated and no reverse mapping record is 1528 available), the client SHOULD send an address literal (see 1529 Section 4.1.3). 1531 RFC 2821, and some earlier informal practices, encouraged following 1532 the literal by information that would help to identify the client 1533 system. That convention was not widely supported and many SMTP 1534 servers considered it an error. In the interest of interoperability, 1535 it is probably wise for servers to be prepared for this string to 1536 occur, but SMTP clients SHOULD NOT send it. 1538 The SMTP server identifies itself to the SMTP client in the 1539 connection greeting reply and in the response to this command. 1541 A client SMTP SHOULD start an SMTP session by issuing the EHLO 1542 command. If the SMTP server supports the SMTP service extensions it 1543 will give a successful response, a failure response, or an error 1544 response. If the SMTP server, in violation of this specification, 1545 does not support any SMTP service extensions it will generate an 1546 error response. Older client SMTP systems MAY, as discussed above, 1547 use HELO (as specified in RFC 821) instead of EHLO, and servers MUST 1548 support the HELO command and reply properly to it. In any event, a 1549 client MUST issue HELO or EHLO before starting a mail transaction. 1551 These commands, and a "250 OK" reply to one of them, confirm that 1552 both the SMTP client and the SMTP server are in the initial state, 1553 that is, there is no transaction in progress and all state tables and 1554 buffers are cleared. 1556 Syntax: 1558 ehlo = "EHLO" SP ( Domain / address-literal ) CRLF 1560 helo = "HELO" SP Domain CRLF 1562 Normally, the response to EHLO will be a multiline reply. Each line 1563 of the response contains a keyword and, optionally, one or more 1564 parameters. Following the normal syntax for multiline replies, these 1565 keywords follow the code (250) and a hyphen for all but the last 1566 line, and the code and a space for the last line. The syntax for a 1567 positive response, using the ABNF notation and terminal symbols of 1568 RFC 5234 [7], is: 1570 ehlo-ok-rsp = ( "250" SP Domain [ SP ehlo-greet ] CRLF ) 1571 / ( "250-" Domain [ SP ehlo-greet ] CRLF 1572 *( "250-" ehlo-line CRLF ) 1573 "250" SP ehlo-line CRLF ) 1575 ehlo-greet = 1*(%d0-9 / %d11-12 / %d14-127) 1576 ; string of any characters other than CR or LF 1578 ehlo-line = ehlo-keyword *( SP ehlo-param ) 1580 ehlo-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-") 1581 ; additional syntax of ehlo-params depends on 1582 ; ehlo-keyword 1584 ehlo-param = 1*(%d33-126) 1585 ; any CHAR excluding and all 1586 ; control characters (US-ASCII 0-31 and 127 1587 ; inclusive) 1589 Although EHLO keywords may be specified in upper, lower, or mixed 1590 case, they MUST always be recognized and processed in a case- 1591 insensitive manner. This is simply an extension of practices 1592 specified in RFC 821 and Section 2.4. 1594 The EHLO response MUST contain keywords (and associated parameters if 1595 required) for all commands not listed as "required" in Section 4.5.1 1596 excepting only private-use commands as described in Section 4.1.5. 1597 Private-use commands MAY be listed. 1599 4.1.1.2. MAIL (MAIL) 1601 This command is used to initiate a mail transaction in which the mail 1602 data is delivered to an SMTP server which may, in turn, deliver it to 1603 one or more mailboxes or pass it on to another system (possibly using 1604 SMTP). The argument clause contains a reverse-path and may contain 1605 optional parameters. In general, the MAIL command may be sent only 1606 when no mail transaction is in progress, see Section 4.1.4. 1608 The reverse-path consists of the sender mailbox. Historically, that 1609 mailbox might optionally have been preceded by a list of hosts, but 1610 that behavior is now deprecated (see Appendix C). In some types of 1611 reporting messages for which a reply is likely to cause a mail loop 1612 (for example, mail delivery and nondelivery notifications), the 1613 reverse-path may be null (see Section 3.6). 1615 This command clears the reverse-path buffer, the forward-path buffer, 1616 and the mail data buffer; and inserts the reverse-path information 1617 from this command into the reverse-path buffer. 1619 If service extensions were negotiated, the MAIL command may also 1620 carry parameters associated with a particular service extension. 1622 Syntax: 1624 mail = "MAIL FROM:" Reverse-path 1625 [SP Mail-parameters] CRLF 1627 4.1.1.3. RECIPIENT (RCPT) 1629 This command is used to identify an individual recipient of the mail 1630 data; multiple recipients are specified by multiple use of this 1631 command. The argument clause contains a forward-path and may contain 1632 optional parameters. 1634 The forward-path normally consists of the required destination 1635 mailbox. Sending systems SHOULD NOT generate the optional list of 1636 hosts known as a source route. Receiving systems MUST recognize 1637 source route syntax but SHOULD strip off the source route 1638 specification and utilize the domain name associated with the mailbox 1639 as if the source route had not been provided. 1641 Similarly, relay hosts SHOULD strip or ignore source routes, and 1642 names MUST NOT be copied into the reverse-path. When mail reaches 1643 its ultimate destination (the forward-path contains only a 1644 destination mailbox), the SMTP server inserts it into the destination 1645 mailbox in accordance with its host mail conventions. 1647 This command appends its forward-path argument to the forward-path 1648 buffer; it does not change the reverse-path buffer nor the mail data 1649 buffer. 1651 For example, mail received at relay host xyz.com with envelope 1652 commands 1654 MAIL FROM: 1655 RCPT TO:<@hosta.int,@jkl.org:userc@d.bar.org> 1657 will normally be sent directly on to host d.bar.org with envelope 1658 commands 1660 MAIL FROM: 1661 RCPT TO: 1663 As provided in Appendix C, xyz.com MAY also choose to relay the 1664 message to hosta.int, using the envelope commands 1666 MAIL FROM: 1667 RCPT TO:<@hosta.int,@jkl.org:userc@d.bar.org> 1669 or to jkl.org, using the envelope commands 1671 MAIL FROM: 1672 RCPT TO:<@jkl.org:userc@d.bar.org> 1674 Attempting to use relaying this way is now strongly discouraged. 1675 Since hosts are not required to relay mail at all, xyz.com MAY also 1676 reject the message entirely when the RCPT command is received, using 1677 a 550 code (since this is a "policy reason"). 1679 If service extensions were negotiated, the RCPT command may also 1680 carry parameters associated with a particular service extension 1681 offered by the server. The client MUST NOT transmit parameters other 1682 than those associated with a service extension offered by the server 1683 in its EHLO response. 1685 Syntax: 1687 rcpt = "RCPT TO:" ( "" / "" / 1688 Forward-path ) [SP Rcpt-parameters] CRLF 1690 Note that, in a departure from the usual rules for 1691 local-parts, the "Postmaster" string shown above is 1692 treated as case-insensitive. 1694 4.1.1.4. DATA (DATA) 1696 The receiver normally sends a 354 response to DATA, and then treats 1697 the lines (strings ending in sequences, as described in 1698 Section 2.3.7) following the command as mail data from the sender. 1699 This command causes the mail data to be appended to the mail data 1700 buffer. The mail data may contain any of the 128 ASCII character 1701 codes, although experience has indicated that use of control 1702 characters other than SP, HT, CR, and LF may cause problems and 1703 SHOULD be avoided when possible. 1705 The mail data are terminated by a line containing only a period, that 1706 is, the character sequence ".", where the first is 1707 actually the terminator of the previous line (see Section 4.5.2). 1708 This is the end of mail data indication. The first of this 1709 terminating sequence is also the that ends the final line of 1710 the data (message text) or, if there was no mail data, ends the DATA 1711 command itself (the "no mail data" case does not conform to this 1712 specification since it would require that neither the trace header 1713 fields required by this specification nor the message header section 1714 required by RFC 2822 [4] be transmitted). An extra MUST NOT 1715 be added, as that would cause an empty line to be added to the 1716 message. The only exception to this rule would arise if the message 1717 body were passed to the originating SMTP-sender with a final "line" 1718 that did not end in ; in that case, the originating SMTP system 1719 MUST either reject the message as invalid or add in order to 1720 have the receiving SMTP server recognize the "end of data" condition. 1722 The custom of accepting lines ending only in , as a concession to 1723 non-conforming behavior on the part of some UNIX systems, has proven 1724 to cause more interoperability problems than it solves, and SMTP 1725 server systems MUST NOT do this, even in the name of improved 1726 robustness. In particular, the sequence "." (bare line 1727 feeds, without carriage returns) MUST NOT be treated as equivalent to 1728 . as the end of mail data indication. 1730 Receipt of the end of mail data indication requires the server to 1731 process the stored mail transaction information. This processing 1732 consumes the information in the reverse-path buffer, the forward-path 1733 buffer, and the mail data buffer, and on the completion of this 1734 command these buffers are cleared. If the processing is successful, 1735 the receiver MUST send an OK reply. If the processing fails the 1736 receiver MUST send a failure reply. The SMTP model does not allow 1737 for partial failures at this point: either the message is accepted by 1738 the server for delivery and a positive response is returned or it is 1739 not accepted and a failure reply is returned. In sending a positive 1740 "250 OK" completion reply to the end of data indication, the receiver 1741 takes full responsibility for the message (see Section 6.1). Errors 1742 that are diagnosed subsequently MUST be reported in a mail message, 1743 as discussed in Section 4.4. 1745 When the SMTP server accepts a message either for relaying or for 1746 final delivery, it inserts a trace record (also referred to 1747 interchangeably as a "time stamp line" or "Received" line) at the top 1748 of the mail data. This trace record indicates the identity of the 1749 host that sent the message, the identity of the host that received 1750 the message (and is inserting this time stamp), and the date and time 1751 the message was received. Relayed messages will have multiple time 1752 stamp lines. Details for formation of these lines, including their 1753 syntax, is specified in Section 4.4. 1755 Additional discussion about the operation of the DATA command appears 1756 in Section 3.3. 1758 Syntax: 1760 data = "DATA" CRLF 1762 4.1.1.5. RESET (RSET) 1764 This command specifies that the current mail transaction will be 1765 aborted. Any stored sender, recipients, and mail data MUST be 1766 discarded, and all buffers and state tables cleared. The receiver 1767 MUST send a "250 OK" reply to a RSET command with no arguments. A 1768 reset command may be issued by the client at any time. It is 1769 effectively equivalent to a NOOP (i.e., it has no effect) if issued 1770 immediately after EHLO, before EHLO is issued in the session, after 1771 an end-of-data indicator has been sent and acknowledged, or 1772 immediately before a QUIT. An SMTP server MUST NOT close the 1773 connection as the result of receiving a RSET; that action is reserved 1774 for QUIT (see Section 4.1.1.10). 1776 Since EHLO implies some additional processing and response by the 1777 server, RSET will normally be more efficient than reissuing that 1778 command, even though the formal semantics are the same. 1780 There are circumstances, contrary to the intent of this 1781 specification, in which an SMTP server may receive an indication that 1782 the underlying TCP connection has been closed or reset. To preserve 1783 the robustness of the mail system, SMTP servers SHOULD be prepared 1784 for this condition and SHOULD treat it as if a QUIT had been received 1785 before the connection disappeared. 1787 Syntax: 1789 rset = "RSET" CRLF 1791 4.1.1.6. VERIFY (VRFY) 1793 This command asks the receiver to confirm that the argument 1794 identifies a user or mailbox. If it is a user name, information is 1795 returned as specified in Section 3.5. 1797 This command has no effect on the reverse-path buffer, the forward- 1798 path buffer, or the mail data buffer. 1800 Syntax: 1802 vrfy = "VRFY" SP String CRLF 1804 4.1.1.7. EXPAND (EXPN) 1806 This command asks the receiver to confirm that the argument 1807 identifies a mailing list, and if so, to return the membership of 1808 that list. If the command is successful, a reply is returned 1809 containing information as described in Section 3.5. This reply will 1810 have multiple lines except in the trivial case of a one-member list. 1812 This command has no effect on the reverse-path buffer, the forward- 1813 path buffer, or the mail data buffer and may be issued at any time. 1815 Syntax: 1817 expn = "EXPN" SP String CRLF 1819 4.1.1.8. HELP (HELP) 1821 This command causes the server to send helpful information to the 1822 client. The command MAY take an argument (e.g., any command name) 1823 and return more specific information as a response. 1825 This command has no effect on the reverse-path buffer, the forward- 1826 path buffer, or the mail data buffer and may be issued at any time. 1828 SMTP servers SHOULD support HELP without arguments and MAY support it 1829 with arguments. 1831 Syntax: 1833 help = "HELP" [ SP String ] CRLF 1835 4.1.1.9. NOOP (NOOP) 1837 This command does not affect any parameters or previously entered 1838 commands. It specifies no action other than that the receiver send a 1839 "250 OK" reply. 1841 This command has no effect on the reverse-path buffer, the forward- 1842 path buffer, or the mail data buffer and may be issued at any time. 1843 If a parameter string is specified, servers SHOULD ignore it. 1845 Syntax: 1847 noop = "NOOP" [ SP String ] CRLF 1849 4.1.1.10. QUIT (QUIT) 1851 This command specifies that the receiver MUST send a "221 OK" reply, 1852 and then close the transmission channel. 1854 The receiver MUST NOT intentionally close the transmission channel 1855 until it receives and replies to a QUIT command (even if there was an 1856 error). The sender MUST NOT intentionally close the transmission 1857 channel until it sends a QUIT command and SHOULD wait until it 1858 receives the reply (even if there was an error response to a previous 1859 command). If the connection is closed prematurely due to violations 1860 of the above or system or network failure, the server MUST cancel any 1861 pending transaction, but not undo any previously completed 1862 transaction, and generally MUST act as if the command or transaction 1863 in progress had received a temporary error (i.e., a 4yz response). 1865 The QUIT command may be issued at any time. Any current uncompleted 1866 mail transaction will be aborted. 1868 Syntax: 1870 quit = "QUIT" CRLF 1872 4.1.1.11. Mail-parameter and Rcpt-parameter Error Responses 1874 If the server SMTP does not recognize or cannot implement one or more 1875 of the parameters associated with a particular MAIL FROM or RCPT TO 1876 command, it will return code 555. 1878 If for some reason the server is temporarily unable to accommodate 1879 one or more of the parameters associated with a MAIL FROM or RCPT TO 1880 command, and if the definition of the specific parameter does not 1881 mandate the use of another code, it should return code 455. 1883 Errors specific to particular parameters and their values will be 1884 specified in the parameter's defining RFC. 1886 4.1.2. Command Argument Syntax 1888 The syntax of the argument clauses of the above commands (using the 1889 syntax specified in RFC 5234 [7] where applicable) is given below. 1890 Some of the productions given below are used only in conjunction with 1891 source routes as described in Appendix C. Terminals not defined in 1892 this document, such as ALPHA, DIGIT, SP, CR, LF, CRLF, are as defined 1893 in the "core" syntax in RFC 5234 [7] (section 6)] or in the message 1894 format syntax in RFC 2822 [4]. 1896 Reverse-path = Path / "<>" 1898 Forward-path = Path 1900 Path = "<" [ A-d-l ":" ] Mailbox ">" 1902 A-d-l = At-domain *( "," At-domain ) 1903 ; Note that this form, the so-called "source 1904 ; route", MUST BE accepted, SHOULD NOT be 1905 ; generated, and SHOULD be ignored. 1907 At-domain = "@" Domain 1909 Mail-parameters = esmtp-param *(SP esmtp-param) 1911 Rcpt-parameters = esmtp-param *(SP esmtp-param) 1913 esmtp-param = esmtp-keyword ["=" esmtp-value] 1915 esmtp-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-") 1916 esmtp-value = 1*(%d33-60 / %d62-126) 1917 ; any CHAR excluding "=", SP, and control 1918 ; characters. If this string is an email address, 1919 ; i.e., a Mailbox, then the "xtext" syntax [32] 1920 ; SHOULD be used. 1922 Keyword = Ldh-str 1924 Argument = Atom 1926 Domain = sub-domain *("." sub-domain) 1928 sub-domain = Let-dig [Ldh-str] 1930 Let-dig = ALPHA / DIGIT 1932 Ldh-str = *( ALPHA / DIGIT / "-" ) Let-dig 1934 address-literal = "[" ( IPv4-address-literal / 1935 IPv6-address-literal / 1936 General-address-literal ) "]" 1937 ; See Section 4.1.3 1939 Mailbox = Local-part "@" ( Domain / address-literal ) 1941 Local-part = Dot-string / Quoted-string 1942 ; MAY be case-sensitive 1944 Dot-string = Atom *("." Atom) 1946 Atom = 1*atext 1948 Quoted-string = DQUOTE *QcontentSMTP DQUOTE 1950 QcontentSMTP = qtextSMTP / quoted-pairSMTP 1952 quoted-pairSMTP = %d92 %d32-126 1953 ; i.e., backslash followed by any ASCII 1954 ; graphic (including itself) or SPace 1956 qtextSMTP = %d32-33 / %d35-91 / %d93-126 1957 ; i.e., within a quoted string, any 1958 ; ASCII graphic or space is permitted 1959 ; without blackslash-quoting except 1960 ; double-quote and the backslash itself. 1962 String = Atom / Quoted-string 1964 While the above definition for Local-part is relatively permissive, 1965 for maximum interoperability, a host that expects to receive mail 1966 SHOULD avoid defining mailboxes where the Local-part requires (or 1967 uses) the Quoted-string form or where the Local-part is case- 1968 sensitive. For any purposes that require generating or comparing 1969 Local-parts (e.g., to specific mailbox names), all quoted forms MUST 1970 be treated as equivalent and the sending system SHOULD transmit the 1971 form that uses the minimum quoting possible. 1973 Systems MUST NOT define mailboxes in such a way as to require the use 1974 in SMTP of non-ASCII characters (octets with the high order bit set 1975 to one) or ASCII "control characters" (decimal value 0-31 and 127). 1976 These characters MUST NOT be used in MAIL or RCPT commands or other 1977 commands that require mailbox names. 1979 Note that the backslash, "\", is a quote character, which is used to 1980 indicate that the next character is to be used literally (instead of 1981 its normal interpretation). For example, "Joe\,Smith" indicates a 1982 single nine character user name string with the comma being the 1983 fourth character of that string. 1985 To promote interoperability and consistent with long-standing 1986 guidance about conservative use of the DNS in naming and applications 1987 (e.g., see section 2.3.1 of the base DNS document, RFC 1035 [1]), 1988 characters outside the set of alphabetic characters, digits, and 1989 hyphen MUST NOT appear in domain name labels for SMTP clients or 1990 servers. In particular, the underscore character is not permitted. 1991 SMTP servers that receive a command in which invalid character codes 1992 have been employed, and for which there are no other reasons for 1993 rejection, MUST reject that command with a 501 response (this rule, 1994 like others, could be overridden by appropriate SMTP extensions). 1996 4.1.3. Address Literals 1998 Sometimes a host is not known to the domain name system and 1999 communication (and, in particular, communication to report and repair 2000 the error) is blocked. To bypass this barrier a special literal form 2001 of the address is allowed as an alternative to a domain name. For 2002 IPv4 addresses, this form uses four small decimal integers separated 2003 by dots and enclosed by brackets such as [123.255.37.2], which 2004 indicates an (IPv4) Internet Address in sequence-of-octets form. For 2005 IPv6 and other forms of addressing that might eventually be 2006 standardized, the form consists of a standardized "tag" that 2007 identifies the address syntax, a colon, and the address itself, in a 2008 format specified as part of the IPv6 standards (RFC 4291 [8]). 2010 Specifically: 2012 IPv4-address-literal = Snum 3("." Snum) 2014 IPv6-address-literal = "IPv6:" IPv6-addr 2016 General-address-literal = Standardized-tag ":" 1*dcontent 2018 Standardized-tag = Ldh-str 2019 ; Standardized-tag MUST be specified in a 2020 ; standards-track RFC and registered with IANA 2022 dcontent = %d33-90 / ; Printable US-ASCII 2023 %d94-126 ; excl. "[", "\", "]" 2025 Snum = 1*3DIGIT 2026 ; representing a decimal integer 2027 ; value in the range 0 through 255 2029 IPv6-addr = IPv6-full / IPv6-comp / IPv6v4-full / IPv6v4-comp 2031 IPv6-hex = 1*4HEXDIG 2033 IPv6-full = IPv6-hex 7(":" IPv6-hex) 2035 IPv6-comp = [IPv6-hex *5(":" IPv6-hex)] "::" 2036 [IPv6-hex *5(":" IPv6-hex)] 2037 ; The "::" represents at least 2 16-bit groups of 2038 ; zeros. No more than 6 groups in addition to the 2039 ; "::" may be present. 2041 IPv6v4-full = IPv6-hex 5(":" IPv6-hex) ":" IPv4-address-literal 2043 IPv6v4-comp = [IPv6-hex *3(":" IPv6-hex)] "::" 2044 [IPv6-hex *3(":" IPv6-hex) ":"] 2045 IPv4-address-literal 2046 ; The "::" represents at least 2 16-bit groups of 2047 ; zeros. No more than 4 groups in addition to the 2048 ; "::" and IPv4-address-literal may be present. 2050 4.1.4. Order of Commands 2052 There are restrictions on the order in which these commands may be 2053 used. 2055 A session that will contain mail transactions MUST first be 2056 initialized by the use of the EHLO command. An SMTP server SHOULD 2057 accept commands for non-mail transactions (e.g., VRFY or EXPN) 2058 without this initialization. 2060 An EHLO command MAY be issued by a client later in the session. If 2061 it is issued after the session begins and the EHLO command is 2062 acceptable to the SMTP server, the SMTP server MUST clear all buffers 2063 and reset the state exactly as if a RSET command had been issued. In 2064 other words, the sequence of RSET followed immediately by EHLO is 2065 redundant, but not harmful other than in the performance cost of 2066 executing unnecessary commands. 2068 If the EHLO command is not acceptable to the SMTP server, 501, 500, 2069 502, or 550 failure replies MUST be returned as appropriate. The 2070 SMTP server MUST stay in the same state after transmitting these 2071 replies that it was in before the EHLO was received. 2073 The SMTP client MUST, if possible, ensure that the domain parameter 2074 to the EHLO command is a primary host name as specified for this 2075 command in Section 2.3.5. If this is not possible (e.g., when the 2076 client's address is dynamically assigned and the client does not have 2077 an obvious name), an address literal SHOULD be substituted for the 2078 domain name. 2080 An SMTP server MAY verify that the domain name argument in the EHLO 2081 command actually corresponds to the IP address of the client. 2082 However, if the verification fails the server MUST NOT refuse to 2083 accept a message on that basis. Information captured in the 2084 verification attempt is for logging and tracing purposes. Note that 2085 this prohibition applies to matching of the parameter to its IP 2086 address only; see Section 7.9 for a more extensive discussion of 2087 rejecting incoming connections or mail messages. 2089 The NOOP, HELP, EXPN, VRFY, and RSET commands can be used at any time 2090 during a session, or without previously initializing a session. SMTP 2091 servers SHOULD process these normally (that is, not return a 503 2092 code) even if no EHLO command has yet been received; clients SHOULD 2093 open a session with EHLO before sending these commands. 2095 If these rules are followed, the example in RFC 821 that shows "550 2096 access denied to you" in response to an EXPN command is incorrect 2097 unless an EHLO command precedes the EXPN or the denial of access is 2098 based on the client's IP address or other authentication or 2099 authorization-determining mechanisms. 2101 The MAIL command (or the obsolete SEND, SOML, or SAML commands) 2102 begins a mail transaction. Once started, a mail transaction consists 2103 of a transaction beginning command, one or more RCPT commands, and a 2104 DATA command, in that order. A mail transaction may be aborted by 2105 the RSET, a new EHLO, or the QUIT command. There may be zero or more 2106 transactions in a session. MAIL (or SEND, SOML, or SAML) MUST NOT be 2107 sent if a mail transaction is already open, i.e., it should be sent 2108 only if no mail transaction had been started in the session, or if 2109 the previous one successfully concluded with a successful DATA 2110 command, or if the previous one was aborted, e.g., with a RSET or new 2111 EHLO. 2113 If the transaction beginning command argument is not acceptable, a 2114 501 failure reply MUST be returned and the SMTP server MUST stay in 2115 the same state. If the commands in a transaction are out of order to 2116 the degree that they cannot be processed by the server, a 503 failure 2117 reply MUST be returned and the SMTP server MUST stay in the same 2118 state. 2120 The last command in a session MUST be the QUIT command. The QUIT 2121 command SHOULD be used by the client SMTP to request connection 2122 closure, even when no session opening command was sent and accepted. 2124 4.1.5. Private-use Commands 2126 As specified in Section 2.2.2, commands starting in "X" may be used 2127 by bilateral agreement between the client (sending) and server 2128 (receiving) SMTP agents. An SMTP server that does not recognize such 2129 a command is expected to reply with "500 Command not recognized". An 2130 extended SMTP server MAY list the feature names associated with these 2131 private commands in the response to the EHLO command. 2133 Commands sent or accepted by SMTP systems that do not start with "X" 2134 MUST conform to the requirements of Section 2.2.2. 2136 4.2. SMTP Replies 2138 Replies to SMTP commands serve to ensure the synchronization of 2139 requests and actions in the process of mail transfer and to guarantee 2140 that the SMTP client always knows the state of the SMTP server. 2141 Every command MUST generate exactly one reply. 2143 The details of the command-reply sequence are described in 2144 Section 4.3. 2146 An SMTP reply consists of a three digit number (transmitted as three 2147 numeric characters) followed by some text unless specified otherwise 2148 in this document. The number is for use by automata to determine 2149 what state to enter next; the text is for the human user. The three 2150 digits contain enough encoded information that the SMTP client need 2151 not examine the text and may either discard it or pass it on to the 2152 user, as appropriate. Exceptions are as noted elsewhere in this 2153 document. In particular, the 220, 221, 251, 421, and 551 reply codes 2154 are associated with message text that must be parsed and interpreted 2155 by machines. In the general case, the text may be receiver dependent 2156 and context dependent, so there are likely to be varying texts for 2157 each reply code. A discussion of the theory of reply codes is given 2158 in Section 4.2.1. Formally, a reply is defined to be the sequence: a 2159 three-digit code, , one line of text, and , or a multiline 2160 reply (as defined in the same section). Since, in violation of this 2161 specification, the text is sometimes not sent, clients which do not 2162 receive it SHOULD be prepared to process the code alone (with or 2163 without a trailing space character). Only the EHLO, EXPN, and HELP 2164 commands are expected to result in multiline replies in normal 2165 circumstances, however, multiline replies are allowed for any 2166 command. 2168 In ABNF, server responses are: 2170 Greeting = ( "220 " (Domain / address-literal) 2171 [ SP textstring ] CRLF ) / 2172 ( "220-" (Domain / address-literal) 2173 [ SP textstring ] CRLF 2174 *( "220-" [ textstring ] CRLF ) 2175 "220" [ SP textstring ] CRLF ) 2177 textstring = 1*(%d09 / %d32-126) ; HT, SP, Printable US-ASCII 2179 Reply-line = *( Reply-code "-" [ textstring ] CRLF ) 2180 Reply-code [ SP textstring ] CRLF 2182 Reply-code = %x32-35 %x30-35 %x30-39 2184 where "Greeting" appears only in the 220 response that announces that 2185 the server is opening its part of the connection. (Other possible 2186 server responses upon connection follow the syntax of Reply-line.) 2188 An SMTP server SHOULD send only the reply codes listed in this 2189 document. An SMTP server SHOULD use the text shown in the examples 2190 whenever appropriate. 2192 An SMTP client MUST determine its actions only by the reply code, not 2193 by the text (except for the "change of address" 251 and 551 and, if 2194 necessary, 220, 221, and 421 replies); in the general case, any text, 2195 including no text at all (although senders SHOULD NOT send bare 2196 codes), MUST be acceptable. The space (blank) following the reply 2197 code is considered part of the text. Whenever possible, a receiver- 2198 SMTP SHOULD test the first digit (severity indication) of the reply 2199 code. 2201 The list of codes that appears below MUST NOT be construed as 2202 permanent. While the addition of new codes should be a rare and 2203 significant activity, with supplemental information in the textual 2204 part of the response being preferred, new codes may be added as the 2205 result of new Standards or Standards-track specifications. 2206 Consequently, a sender-SMTP MUST be prepared to handle codes not 2207 specified in this document and MUST do so by interpreting the first 2208 digit only. 2210 In the absence of extensions negotiated with the client, SMTP servers 2211 MUST NOT send reply codes whose first digits are other than 2, 3, 4, 2212 or 5. Clients that receive such out-of-range codes SHOULD normally 2213 treat them as fatal errors and terminate the mail transaction. 2215 4.2.1. Reply Code Severities and Theory 2217 The three digits of the reply each have a special significance. The 2218 first digit denotes whether the response is good, bad or incomplete. 2219 An unsophisticated SMTP client, or one that receives an unexpected 2220 code, will be able to determine its next action (proceed as planned, 2221 redo, retrench, etc.) by examining this first digit. An SMTP client 2222 that wants to know approximately what kind of error occurred (e.g., 2223 mail system error, command syntax error) may examine the second 2224 digit. The third digit and any supplemental information that may be 2225 present is reserved for the finest gradation of information. 2227 There are four values for the first digit of the reply code: 2229 2yz Positive Completion reply 2230 The requested action has been successfully completed. A new 2231 request may be initiated. 2233 3yz Positive Intermediate reply 2234 The command has been accepted, but the requested action is being 2235 held in abeyance, pending receipt of further information. The 2236 SMTP client should send another command specifying this 2237 information. This reply is used in command sequence groups (i.e., 2238 in DATA). 2240 4yz Transient Negative Completion reply 2241 The command was not accepted, and the requested action did not 2242 occur. However, the error condition is temporary and the action 2243 may be requested again. The sender should return to the beginning 2244 of the command sequence (if any). It is difficult to assign a 2245 meaning to "transient" when two different sites (receiver- and 2246 sender-SMTP agents) must agree on the interpretation. Each reply 2247 in this category might have a different time value, but the SMTP 2248 client SHOULD try again. A rule of thumb to determine whether a 2249 reply fits into the 4yz or the 5yz category (see below) is that 2250 replies are 4yz if they can be successful if repeated without any 2251 change in command form or in properties of the sender or receiver 2252 (that is, the command is repeated identically and the receiver 2253 does not put up a new implementation.) 2255 5yz Permanent Negative Completion reply 2256 The command was not accepted and the requested action did not 2257 occur. The SMTP client SHOULD NOT repeat the exact request (in 2258 the same sequence). Even some "permanent" error conditions can be 2259 corrected, so the human user may want to direct the SMTP client to 2260 reinitiate the command sequence by direct action at some point in 2261 the future (e.g., after the spelling has been changed, or the user 2262 has altered the account status). 2264 It is worth noting that the file transfer protocol (FTP [34]) uses a 2265 very similar code architecture and that the SMTP codes are based on 2266 the FTP model. However, SMTP uses a one-command, one-response model 2267 (while FTP is asynchronous) and FTP's 1yz codes are not part of the 2268 SMTP model. 2270 The second digit encodes responses in specific categories: 2272 x0z Syntax: These replies refer to syntax errors, syntactically 2273 correct commands that do not fit any functional category, and 2274 unimplemented or superfluous commands. 2276 x1z Information: These are replies to requests for information, such 2277 as status or help. 2279 x2z Connections: These are replies referring to the transmission 2280 channel. 2282 x3z Unspecified. 2284 x4z Unspecified. 2286 x5z Mail system: These replies indicate the status of the receiver 2287 mail system vis-a-vis the requested transfer or other mail system 2288 action. 2290 The third digit gives a finer gradation of meaning in each category 2291 specified by the second digit. The list of replies illustrates this. 2292 Each reply text is recommended rather than mandatory, and may even 2293 change according to the command with which it is associated. On the 2294 other hand, the reply codes must strictly follow the specifications 2295 in this section. Receiver implementations should not invent new 2296 codes for slightly different situations from the ones described here, 2297 but rather adapt codes already defined. 2299 For example, a command such as NOOP, whose successful execution does 2300 not offer the SMTP client any new information, will return a 250 2301 reply. The reply is 502 when the command requests an unimplemented 2302 non-site-specific action. A refinement of that is the 504 reply for 2303 a command that is implemented, but that requests an unimplemented 2304 parameter. 2306 The reply text may be longer than a single line; in these cases the 2307 complete text must be marked so the SMTP client knows when it can 2308 stop reading the reply. This requires a special format to indicate a 2309 multiple line reply. 2311 The format for multiline replies requires that every line, except the 2312 last, begin with the reply code, followed immediately by a hyphen, 2313 "-" (also known as minus), followed by text. The last line will 2314 begin with the reply code, followed immediately by , optionally 2315 some text, and . As noted above, servers SHOULD send the 2316 if subsequent text is not sent, but clients MUST be prepared for it 2317 to be omitted. 2319 For example: 2321 250-First line 2322 250-Second line 2323 250-234 text beginning with numbers 2324 250 The last line 2326 In a multiline reply the reply code on each of the lines MUST be the 2327 same. It is reasonable for the client to rely on this, so it can 2328 make processing decisions based on the code in any line, assuming 2329 that all others will be the same. In a few cases, there is important 2330 data for the client in the reply "text". The client will be able to 2331 identify these cases from the current context. 2333 4.2.2. Reply Codes by Function Groups 2335 500 Syntax error, command unrecognized (This may include errors such 2336 as command line too long) 2338 501 Syntax error in parameters or arguments 2340 502 Command not implemented (see Section 4.2.4) 2342 503 Bad sequence of commands 2343 504 Command parameter not implemented 2345 211 System status, or system help reply 2347 214 Help message (Information on how to use the receiver or the 2348 meaning of a particular non-standard command; this reply is useful 2349 only to the human user) 2351 220 Service ready 2353 221 Service closing transmission channel 2355 421 Service not available, closing transmission channel 2356 (This may be a reply to any command if the service knows it must 2357 shut down) 2359 250 Requested mail action okay, completed 2361 251 User not local; will forward to (See Section 3.4) 2363 252 Cannot VRFY user, but will accept message and attempt delivery 2364 (See Section 3.5.3) 2366 455 Server unable to accommodate parameters 2368 555 MAIL FROM/RCPT TO parameters not recognized or not implemented 2370 450 Requested mail action not taken: mailbox unavailable (e.g., 2371 mailbox busy or temporarily blocked for policy reasons) 2373 550 Requested action not taken: mailbox unavailable (e.g., mailbox 2374 not found, no access, or command rejected for policy reasons) 2376 451 Requested action aborted: error in processing 2378 551 User not local; please try (See Section 3.4) 2380 452 Requested action not taken: insufficient system storage 2382 552 Requested mail action aborted: exceeded storage allocation 2384 553 Requested action not taken: mailbox name not allowed (e.g., 2385 mailbox syntax incorrect) 2387 354 Start mail input; end with . 2389 554 Transaction failed (Or, in the case of a connection-opening 2390 response, "No SMTP service here") 2392 4.2.3. Reply Codes in Numeric Order 2394 211 System status, or system help reply 2396 214 Help message (Information on how to use the receiver or the 2397 meaning of a particular non-standard command; this reply is useful 2398 only to the human user) 2400 220 Service ready 2402 221 Service closing transmission channel 2404 250 Requested mail action okay, completed 2406 251 User not local; will forward to (See Section 3.4) 2408 252 Cannot VRFY user, but will accept message and attempt delivery 2409 (See Section 3.5.3) 2411 354 Start mail input; end with . 2413 421 Service not available, closing transmission channel 2414 (This may be a reply to any command if the service knows it must 2415 shut down) 2417 450 Requested mail action not taken: mailbox unavailable (e.g., 2418 mailbox busy or temporarily blocked for policy reasons)) 2420 451 Requested action aborted: local error in processing 2422 452 Requested action not taken: insufficient system storage 2424 455 Server unable to accommodate parameters 2426 500 Syntax error, command unrecognized (This may include errors such 2427 as command line too long) 2429 501 Syntax error in parameters or arguments 2431 502 Command not implemented (see Section 4.2.4) 2433 503 Bad sequence of commands 2435 504 Command parameter not implemented 2437 550 Requested action not taken: mailbox unavailable (e.g., mailbox 2438 not found, no access, or command rejected for policy reasons) 2440 551 User not local; please try (See Section 3.4) 2442 552 Requested mail action aborted: exceeded storage allocation 2444 553 Requested action not taken: mailbox name not allowed (e.g., 2445 mailbox syntax incorrect) 2447 554 Transaction failed (Or, in the case of a connection-opening 2448 response, "No SMTP service here") 2450 555 MAIL FROM/RCPT TO parameters not recognized or not implemented 2452 4.2.4. Reply Code 502 2454 Questions have been raised as to when reply code 502 (Command not 2455 implemented) SHOULD be returned in preference to other codes. 502 2456 SHOULD be used when the command is actually recognized by the SMTP 2457 server, but not implemented. If the command is not recognized, code 2458 500 SHOULD be returned. Extended SMTP systems MUST NOT list 2459 capabilities in response to EHLO for which they will return 502 (or 2460 500) replies. 2462 4.2.5. Reply Codes After DATA and the Subsequent . 2464 When an SMTP server returns a positive completion status (2yz code) 2465 after the DATA command is completed with ., it accepts 2466 responsibility for: 2468 o delivering the message (if the recipient mailbox exists), or 2470 o if attempts to deliver the message fail due to transient 2471 conditions, retrying delivery some reasonable number of times at 2472 intervals as specified in Section 4.5.4. 2474 o if attempts to deliver the message fail due to permanent 2475 conditions, or if repeated attempts to deliver the message fail 2476 due to transient conditions, returning appropriate notification to 2477 the sender of the original message (using the address in the SMTP 2478 MAIL command). 2480 When an SMTP server returns a temporary error status (4yz) code after 2481 the DATA command is completed with ., it MUST NOT make a 2482 subsequent attempt to deliver that message. The SMTP client retains 2483 responsibility for delivery of that message and may either return it 2484 to the user or requeue it for a subsequent attempt (see 2485 Section 4.5.4.1). 2487 The user who originated the message SHOULD be able to interpret the 2488 return of a transient failure status (by mail message or otherwise) 2489 as a non-delivery indication, just as a permanent failure would be 2490 interpreted. If the client SMTP successfully handles these 2491 conditions, the user will not receive such a reply. 2493 When an SMTP server returns a permanent error status (5yz) code after 2494 the DATA command is completed with ., it MUST NOT make 2495 any subsequent attempt to deliver the message. As with temporary 2496 error status codes, the SMTP client retains responsibility for the 2497 message, but SHOULD not again attempt delivery to the same server 2498 without user review of the message and response and appropriate 2499 intervention. 2501 4.3. Sequencing of Commands and Replies 2503 4.3.1. Sequencing Overview 2505 The communication between the sender and receiver is an alternating 2506 dialogue, controlled by the sender. As such, the sender issues a 2507 command and the receiver responds with a reply. Unless other 2508 arrangements are negotiated through service extensions, the sender 2509 MUST wait for this response before sending further commands. One 2510 important reply is the connection greeting. Normally, a receiver 2511 will send a 220 "Service ready" reply when the connection is 2512 completed. The sender SHOULD wait for this greeting message before 2513 sending any commands. 2515 Note: all the greeting-type replies have the official name (the 2516 fully-qualified primary domain name) of the server host as the first 2517 word following the reply code. Sometimes the host will have no 2518 meaningful name. See Section 4.1.3 for a discussion of alternatives 2519 in these situations. 2521 For example, 2522 220 ISIF.USC.EDU Service ready 2524 or 2526 220 mail.example.com SuperSMTP v 6.1.2 Service ready 2528 or 2530 220 [10.0.0.1] Clueless host service ready 2532 The table below lists alternative success and failure replies for 2533 each command. These SHOULD be strictly adhered to. A receiver MAY 2534 substitute text in the replies, but the meanings and actions implied 2535 by the code numbers and by the specific command reply sequence MUST 2536 be preserved. 2538 4.3.2. Command-Reply Sequences 2540 Each command is listed with its usual possible replies. The prefixes 2541 used before the possible replies are "I" for intermediate, "S" for 2542 success, and "E" for error. Since some servers may generate other 2543 replies under special circumstances, and to allow for future 2544 extension, SMTP clients SHOULD, when possible, interpret only the 2545 first digit of the reply and MUST be prepared to deal with 2546 unrecognized reply codes by interpreting the first digit only. 2547 Unless extended using the mechanisms described in Section 2.2, SMTP 2548 servers MUST NOT transmit reply codes to an SMTP client that are 2549 other than three digits or that do not start in a digit between 2 and 2550 5 inclusive. 2552 These sequencing rules and, in principle, the codes themselves, can 2553 be extended or modified by SMTP extensions offered by the server and 2554 accepted (requested) by the client. However, if the target is more 2555 precise granularity in the codes, rather than codes for completely 2556 new purposes, the system described in RFC 3463 [25] SHOULD be used in 2557 preference to the invention of new codes. 2559 In addition to the codes listed below, any SMTP command can return 2560 any of the following codes if the corresponding unusual circumstances 2561 are encountered: 2563 500 For the "command line too long" case or if the command name was 2564 not recognized. Note that producing a "command not recognized" 2565 error in response to the required subset of these commands is a 2566 violation of this specification. Similarly, producing a "command 2567 too long" message for a command line shorter than 512 characters 2568 would violate the provisions of Section 4.5.3.1.4. 2570 501 Syntax error in command or arguments. In order to provide for 2571 future extensions, commands that are specified in this document as 2572 not accepting arguments (DATA, RSET, QUIT) SHOULD return a 501 2573 message if arguments are supplied in the absence of EHLO- 2574 advertised extensions. 2576 421 Service shutting down and closing transmission channel 2578 Specific sequences are: 2580 CONNECTION ESTABLISHMENT 2582 S: 220 2583 E: 554 2585 EHLO or HELO 2587 S: 250 2588 E: 504 (a conforming implementation could return this code only 2589 in fairly obscure cases), 550, 502 (permitted only with an old- 2590 style server that does not support EHLO) 2592 MAIL 2594 S: 250 2595 E: 552, 451, 452, 550, 553, 503, 455, 555 2597 RCPT 2599 S: 250, 251 (but see Section 3.4 for discussion of 251 and 551) 2600 E: 550, 551, 552, 553, 450, 451, 452, 503, 455, 555 2602 DATA 2604 I: 354 -> data -> S: 250 2606 E: 552, 554, 451, 452 2608 E: 450, 550 (rejections for policy reasons) 2610 E: 503, 554 2612 RSET 2614 S: 250 2616 VRFY 2617 S: 250, 251, 252 2618 E: 550, 551, 553, 502, 504 2620 EXPN 2622 S: 250, 252 2623 E: 550, 500, 502, 504 2625 HELP 2627 S: 211, 214 2628 E: 502, 504 2630 NOOP 2632 S: 250 2634 QUIT 2636 S: 221 2638 4.4. Trace Information 2640 When an SMTP server receives a message for delivery or further 2641 processing, it MUST insert trace ("time stamp" or "Received") 2642 information at the beginning of the message content, as discussed in 2643 Section 4.1.1.4. 2645 This line MUST be structured as follows: 2647 o The FROM clause, which MUST be supplied in an SMTP environment, 2648 SHOULD contain both (1) the name of the source host as presented 2649 in the EHLO command and (2) an address literal containing the IP 2650 address of the source, determined from the TCP connection. 2652 o The ID clause MAY contain an "@" as suggested in RFC 822, but this 2653 is not required. 2655 o If the FOR clause appears, it MUST contain exactly one 2656 entry, even when multiple RCPT commands have been given. Multiple 2657 s raise some security issues and have been deprecated, see 2658 Section 7.2. 2660 An Internet mail program MUST NOT change or delete a Received: line 2661 that was previously added to the message header section. SMTP 2662 servers MUST prepend Received lines to messages; they MUST NOT change 2663 the order of existing lines or insert Received lines in any other 2664 location. 2666 As the Internet grows, comparability of Received header fields is 2667 important for detecting problems, especially slow relays. SMTP 2668 servers that create Received header fields SHOULD use explicit 2669 offsets in the dates (e.g., -0800), rather than time zone names of 2670 any type. Local time (with an offset) SHOULD be used rather than UT 2671 when feasible. This formulation allows slightly more information 2672 about local circumstances to be specified. If UT is needed, the 2673 receiver need merely do some simple arithmetic to convert the values. 2674 Use of UT loses information about the time zone-location of the 2675 server. If it is desired to supply a time zone name, it SHOULD be 2676 included in a comment. 2678 When the delivery SMTP server makes the "final delivery" of a 2679 message, it inserts a return-path line at the beginning of the mail 2680 data. This use of return-path is required; mail systems MUST support 2681 it. The return-path line preserves the information in the from the MAIL command. Here, final delivery means the message 2683 has left the SMTP environment. Normally, this would mean it had been 2684 delivered to the destination user or an associated mail drop, but in 2685 some cases it may be further processed and transmitted by another 2686 mail system. 2688 It is possible for the mailbox in the return path to be different 2689 from the actual sender's mailbox, for example, if error responses are 2690 to be delivered to a special error handling mailbox rather than to 2691 the message sender. When mailing lists are involved, this 2692 arrangement is common and useful as a means of directing errors to 2693 the list maintainer rather than the message originator. 2695 The text above implies that the final mail data will begin with a 2696 return path line, followed by one or more time stamp lines. These 2697 lines will be followed by the rest of the mail data: first the 2698 balance of the mail header section and then the body (RFC 2822 [4]). 2700 It is sometimes difficult for an SMTP server to determine whether or 2701 not it is making final delivery since forwarding or other operations 2702 may occur after the message is accepted for delivery. Consequently, 2703 any further (forwarding, gateway, or relay) systems MAY remove the 2704 return path and rebuild the MAIL command as needed to ensure that 2705 exactly one such line appears in a delivered message. 2707 A message-originating SMTP system SHOULD NOT send a message that 2708 already contains a Return-path header field. SMTP servers performing 2709 a relay function MUST NOT inspect the message data, and especially 2710 not to the extent needed to determine if Return-path header fields 2711 are present. SMTP servers making final delivery MAY remove Return- 2712 path header fields before adding their own. 2714 The primary purpose of the Return-path is to designate the address to 2715 which messages indicating non-delivery or other mail system failures 2716 are to be sent. For this to be unambiguous, exactly one return path 2717 SHOULD be present when the message is delivered. Systems using RFC 2718 822 syntax with non-SMTP transports SHOULD designate an unambiguous 2719 address, associated with the transport envelope, to which error 2720 reports (e.g., non-delivery messages) should be sent. 2722 Historical note: Text in RFC 822 that appears to contradict the use 2723 of the Return-path header field (or the envelope reverse path address 2724 from the MAIL command) as the destination for error messages is not 2725 applicable on the Internet. The reverse path address (as copied into 2726 the Return-path) MUST be used as the target of any mail containing 2727 delivery error messages. 2729 In particular: 2731 o a gateway from SMTP -> elsewhere SHOULD insert a return-path 2732 header field, unless it is known that the "elsewhere" transport 2733 also uses Internet domain addresses and maintains the envelope 2734 sender address separately. 2736 o a gateway from elsewhere -> SMTP SHOULD delete any return-path 2737 header field present in the message, and either copy that 2738 information to the SMTP envelope or combine it with information 2739 present in the envelope of the other transport system to construct 2740 the reverse path argument to the MAIL command in the SMTP 2741 envelope. 2743 The server must give special treatment to cases in which the 2744 processing following the end of mail data indication is only 2745 partially successful. This could happen if, after accepting several 2746 recipients and the mail data, the SMTP server finds that the mail 2747 data could be successfully delivered to some, but not all, of the 2748 recipients. In such cases, the response to the DATA command MUST be 2749 an OK reply. However, the SMTP server MUST compose and send an 2750 "undeliverable mail" notification message to the originator of the 2751 message. 2753 A single notification listing all of the failed recipients or 2754 separate notification messages MUST be sent for each failed 2755 recipient. For economy of processing by the sender, the former 2756 SHOULD be used when possible. Note that the key difference between 2757 handling aliases (Section 3.9.1) and forwarding (this subsection) is 2758 the change to the backward-pointing address in this case. All 2759 notification messages about undeliverable mail MUST be sent using the 2760 MAIL command (even if they result from processing the obsolete SEND, 2761 SOML, or SAML commands) and MUST use a null return path as discussed 2762 in Section 3.6. 2764 The time stamp line and the return path line are formally defined as 2765 follows (the definitions for "FWS" and "CFWS" appear in RFC 2822 2766 [4]): 2768 Return-path-line = "Return-Path:" FWS Reverse-path 2770 Time-stamp-line = "Received:" FWS Stamp 2772 Stamp = From-domain By-domain Opt-info [CFWS] ";" 2773 FWS date-time 2774 ; where "date-time" is as defined in RFC 2822 [4] 2775 ; but the "obs-" forms, especially two-digit 2776 ; years, are prohibited in SMTP and MUST NOT be used. 2778 From-domain = "FROM" FWS Extended-Domain 2780 By-domain = CFWS "BY" FWS Extended-Domain 2782 Extended-Domain = Domain / 2783 ( Domain FWS "(" TCP-info ")" ) / 2784 ( address-literal FWS "(" TCP-info ")" ) 2786 TCP-info = address-literal / ( Domain FWS address-literal ) 2787 ; Information derived by server from TCP connection 2788 ; not client EHLO. 2790 Opt-info = [Via] [With] [ID] [For] 2791 [Additional-Registered-Clauses] 2793 Via = CFWS "VIA" FWS Link 2795 With = CFWS "WITH" FWS Protocol 2797 ID = CFWS "ID" FWS ( Atom / msg-id ) 2798 ; msg-id is defined in RFC 2822 [4] 2800 For = CFWS "FOR" FWS ( Path / Mailbox ) 2802 Additional-Registered-Clauses = CFWS Atom FWS String 2803 ; Additional standard clauses may be added in this 2804 ; location by future standards and registration with 2805 ; IANA. SMTP servers SHOULD NOT use unregistered 2806 ; names. See Section 8. 2808 Link = "TCP" / Addtl-Link 2810 Addtl-Link = Atom 2811 ; Additional standard names for links are 2812 ; registered with the Internet Assigned Numbers 2813 ; Authority (IANA). "Via" is primarily of value 2814 ; with non-Internet transports. SMTP servers 2815 ; SHOULD NOT use unregistered names. 2817 Protocol = "ESMTP" / "SMTP" / Attdl-Protocol 2819 Attdl-Protocol = Atom 2820 ; Additional standard names for protocols are 2821 ; registered with the Internet Assigned Numbers 2822 ; Authority (IANA) in the "mail parameters" 2823 ; registry [9]. SMTP servers SHOULD NOT 2824 ; use unregistered names. 2826 4.5. Additional Implementation Issues 2828 4.5.1. Minimum Implementation 2830 In order to make SMTP workable, the following minimum implementation 2831 MUST be provided by all receivers. The following commands MUST be 2832 supported to conform to this specification: 2834 EHLO 2835 HELO 2836 MAIL 2837 RCPT 2838 DATA 2839 RSET 2840 NOOP 2841 QUIT 2842 VRFY 2844 Any system that includes an SMTP server supporting mail relaying or 2845 delivery MUST support the reserved mailbox "postmaster" as a case- 2846 insensitive local name. This postmaster address is not strictly 2847 necessary if the server always returns 554 on connection opening (as 2848 described in Section 3.1). The requirement to accept mail for 2849 postmaster implies that RCPT commands which specify a mailbox for 2850 postmaster at any of the domains for which the SMTP server provides 2851 mail service, as well as the special case of "RCPT TO:" 2852 (with no domain specification), MUST be supported. 2854 SMTP systems are expected to make every reasonable effort to accept 2855 mail directed to Postmaster from any other system on the Internet. 2857 In extreme cases --such as to contain a denial of service attack or 2858 other breach of security-- an SMTP server may block mail directed to 2859 Postmaster. However, such arrangements SHOULD be narrowly tailored 2860 so as to avoid blocking messages which are not part of such attacks. 2862 4.5.2. Transparency 2864 Without some provision for data transparency, the character sequence 2865 "." ends the mail text and cannot be sent by the user. 2866 In general, users are not aware of such "forbidden" sequences. To 2867 allow all user composed text to be transmitted transparently, the 2868 following procedures are used: 2870 o Before sending a line of mail text, the SMTP client checks the 2871 first character of the line. If it is a period, one additional 2872 period is inserted at the beginning of the line. 2874 o When a line of mail text is received by the SMTP server, it checks 2875 the line. If the line is composed of a single period, it is 2876 treated as the end of mail indicator. If the first character is a 2877 period and there are other characters on the line, the first 2878 character is deleted. 2880 The mail data may contain any of the 128 ASCII characters. All 2881 characters are to be delivered to the recipient's mailbox, including 2882 spaces, vertical and horizontal tabs, and other control characters. 2883 If the transmission channel provides an 8-bit byte (octet) data 2884 stream, the 7-bit ASCII codes are transmitted right justified in the 2885 octets, with the high order bits cleared to zero. See Section 3.6 2886 for special treatment of these conditions in SMTP systems serving a 2887 relay function. 2889 In some systems it may be necessary to transform the data as it is 2890 received and stored. This may be necessary for hosts that use a 2891 different character set than ASCII as their local character set, that 2892 store data in records rather than strings, or which use special 2893 character sequences as delimiters inside mailboxes. If such 2894 transformations are necessary, they MUST be reversible, especially if 2895 they are applied to mail being relayed. 2897 4.5.3. Sizes and Timeouts 2899 4.5.3.1. Size limits and minimums 2901 There are several objects that have required minimum/maximum sizes. 2902 Every implementation MUST be able to receive objects of at least 2903 these sizes. Objects larger than these sizes SHOULD be avoided when 2904 possible. However, some Internet mail constructs such as encoded 2905 X.400 addresses (RFC 2156 [35]) will often require larger objects. 2906 Clients MAY attempt to transmit these, but MUST be prepared for a 2907 server to reject them if they cannot be handled by it. To the 2908 maximum extent possible, implementation techniques which impose no 2909 limits on the length of these objects should be used. 2911 Extensions to SMTP may involve the use of characters that occupy more 2912 than a single octet each. This section therefore specifies lengths 2913 in octets where absolute lengths, rather than character counts, are 2914 intended. 2916 4.5.3.1.1. local-part 2918 The maximum total length of a user name or other local-part is 64 2919 octets. 2921 4.5.3.1.2. domain 2923 The maximum total length of a domain name or number is 255 octets. 2925 4.5.3.1.3. path 2927 The maximum total length of a reverse-path or forward-path is 256 2928 octets (including the punctuation and element separators). 2930 4.5.3.1.4. command line 2932 The maximum total length of a command line including the command word 2933 and the is 512 octets. SMTP extensions may be used to 2934 increase this limit. 2936 4.5.3.1.5. reply line 2938 The maximum total length of a reply line including the reply code and 2939 the is 512 octets. More information may be conveyed through 2940 multiple-line replies. 2942 4.5.3.1.6. text line 2944 The maximum total length of a text line including the is 1000 2945 octets (not counting the leading dot duplicated for transparency). 2946 This number may be increased by the use of SMTP Service Extensions. 2948 4.5.3.1.7. message content 2950 The maximum total length of a message content (including any message 2951 header section as well as the message body) MUST BE at least 64K 2952 octets. Since the introduction of Internet standards for multimedia 2953 mail (RFC 2045 [21]), message lengths on the Internet have grown 2954 dramatically, and message size restrictions should be avoided if at 2955 all possible. SMTP server systems that must impose restrictions 2956 SHOULD implement the "SIZE" service extension of RFC 1870 [10], and 2957 SMTP client systems that will send large messages SHOULD utilize it 2958 when possible. 2960 4.5.3.1.8. recipients buffer 2962 The minimum total number of recipients that MUST be buffered is 100 2963 recipients. Rejection of messages (for excessive recipients) with 2964 fewer than 100 RCPT commands is a violation of this specification. 2965 The general principle that relaying SMTP server MUST NOT, and 2966 delivery SMTP servers SHOULD NOT, perform validation tests on message 2967 header fields suggests that messages SHOULD NOT be rejected based on 2968 the total number of recipients shown in header fields. A server that 2969 imposes a limit on the number of recipients MUST behave in an orderly 2970 fashion, such as rejecting additional addresses over its limit rather 2971 than silently discarding addresses previously accepted. A client 2972 that needs to deliver a message containing over 100 RCPT commands 2973 SHOULD be prepared to transmit in 100-recipient "chunks" if the 2974 server declines to accept more than 100 recipients in a single 2975 message. 2977 4.5.3.1.9. Treatment When Limits Exceeded 2979 Errors due to exceeding these limits may be reported by using the 2980 reply codes. Some examples of reply codes are: 2982 500 Line too long. 2984 or 2986 501 Path too long 2988 or 2990 452 Too many recipients (see below) 2992 or 2994 552 Too much mail data. 2996 4.5.3.1.10. Too Many Recipients code 2998 RFC 821 [2] incorrectly listed the error where an SMTP server 2999 exhausts its implementation limit on the number of RCPT commands 3000 ("too many recipients") as having reply code 552. The correct reply 3001 code for this condition is 452. Clients SHOULD treat a 552 code in 3002 this case as a temporary, rather than permanent, failure so the logic 3003 below works. 3005 When a conforming SMTP server encounters this condition, it has at 3006 least 100 successful RCPT commands in its recipients buffer. If the 3007 server is able to accept the message, then at least these 100 3008 addresses will be removed from the SMTP client's queue. When the 3009 client attempts retransmission of those addresses which received 452 3010 responses, at least 100 of these will be able to fit in the SMTP 3011 server's recipients buffer. Each retransmission attempt which is 3012 able to deliver anything will be able to dispose of at least 100 of 3013 these recipients. 3015 If an SMTP server has an implementation limit on the number of RCPT 3016 commands and this limit is exhausted, it MUST use a response code of 3017 452 (but the client SHOULD also be prepared for a 552, as noted 3018 above). If the server has a configured site-policy limitation on the 3019 number of RCPT commands, it MAY instead use a 5yz response code. In 3020 particular, if the intent is to prohibit messages with more than a 3021 site-specified number of recipients, rather than merely limit the 3022 number of recipients in a given mail transaction, it would be 3023 reasonable to return a 503 response to any DATA command received 3024 subsequent to the 452 (or 552) code or to simply return the 503 after 3025 DATA without returning any previous negative response. 3027 4.5.3.2. Timeouts 3029 An SMTP client MUST provide a timeout mechanism. It MUST use per- 3030 command timeouts rather than somehow trying to time the entire mail 3031 transaction. Timeouts SHOULD be easily reconfigurable, preferably 3032 without recompiling the SMTP code. To implement this, a timer is set 3033 for each SMTP command and for each buffer of the data transfer. The 3034 latter means that the overall timeout is inherently proportional to 3035 the size of the message. 3037 Based on extensive experience with busy mail-relay hosts, the minimum 3038 per-command timeout values SHOULD be as follows: 3040 4.5.3.2.1. Initial 220 Message: 5 minutes 3042 An SMTP client process needs to distinguish between a failed TCP 3043 connection and a delay in receiving the initial 220 greeting message. 3044 Many SMTP servers accept a TCP connection but delay delivery of the 3045 220 message until their system load permits more mail to be 3046 processed. 3048 4.5.3.2.2. MAIL Command: 5 minutes 3050 4.5.3.2.3. RCPT Command: 5 minutes 3052 A longer timeout is required if processing of mailing lists and 3053 aliases is not deferred until after the message was accepted. 3055 4.5.3.2.4. DATA Initiation: 2 minutes 3057 This is while awaiting the "354 Start Input" reply to a DATA command. 3059 4.5.3.2.5. Data Block: 3 minutes 3061 This is while awaiting the completion of each TCP SEND call 3062 transmitting a chunk of data. 3064 4.5.3.2.6. DATA Termination: 10 minutes. 3066 This is while awaiting the "250 OK" reply. When the receiver gets 3067 the final period terminating the message data, it typically performs 3068 processing to deliver the message to a user mailbox. A spurious 3069 timeout at this point would be very wasteful and would typically 3070 result in delivery of multiple copies of the message, since it has 3071 been successfully sent and the server has accepted responsibility for 3072 delivery. See Section 6.1 for additional discussion. 3074 4.5.3.2.7. Server Timeout: 5 minutes. 3076 An SMTP server SHOULD have a timeout of at least 5 minutes while it 3077 is awaiting the next command from the sender. 3079 4.5.4. Retry Strategies 3081 The common structure of a host SMTP implementation includes user 3082 mailboxes, one or more areas for queuing messages in transit, and one 3083 or more daemon processes for sending and receiving mail. The exact 3084 structure will vary depending on the needs of the users on the host 3085 and the number and size of mailing lists supported by the host. We 3086 describe several optimizations that have proved helpful, particularly 3087 for mailers supporting high traffic levels. 3089 Any queuing strategy MUST include timeouts on all activities on a 3090 per-command basis. A queuing strategy MUST NOT send error messages 3091 in response to error messages under any circumstances. 3093 4.5.4.1. Sending Strategy 3095 The general model for an SMTP client is one or more processes that 3096 periodically attempt to transmit outgoing mail. In a typical system, 3097 the program that composes a message has some method for requesting 3098 immediate attention for a new piece of outgoing mail, while mail that 3099 cannot be transmitted immediately MUST be queued and periodically 3100 retried by the sender. A mail queue entry will include not only the 3101 message itself but also the envelope information. 3103 The sender MUST delay retrying a particular destination after one 3104 attempt has failed. In general, the retry interval SHOULD be at 3105 least 30 minutes; however, more sophisticated and variable strategies 3106 will be beneficial when the SMTP client can determine the reason for 3107 non-delivery. 3109 Retries continue until the message is transmitted or the sender gives 3110 up; the give-up time generally needs to be at least 4-5 days. It MAY 3111 be appropriate to set a shorter maximum number of retries for non- 3112 delivery notifications and equivalent error messages than for 3113 standard messages. The parameters to the retry algorithm MUST be 3114 configurable. 3116 A client SHOULD keep a list of hosts it cannot reach and 3117 corresponding connection timeouts, rather than just retrying queued 3118 mail items. 3120 Experience suggests that failures are typically transient (the target 3121 system or its connection has crashed), favoring a policy of two 3122 connection attempts in the first hour the message is in the queue, 3123 and then backing off to one every two or three hours. 3125 The SMTP client can shorten the queuing delay in cooperation with the 3126 SMTP server. For example, if mail is received from a particular 3127 address, it is likely that mail queued for that host can now be sent. 3128 Application of this principle may, in many cases, eliminate the 3129 requirement for an explicit "send queues now" function such as ETRN, 3130 RFC 1985 [36]. 3132 The strategy may be further modified as a result of multiple 3133 addresses per host (see below) to optimize delivery time vs. resource 3134 usage. 3136 An SMTP client may have a large queue of messages for each 3137 unavailable destination host. If all of these messages were retried 3138 in every retry cycle, there would be excessive Internet overhead and 3139 the sending system would be blocked for a long period. Note that an 3140 SMTP client can generally determine that a delivery attempt has 3141 failed only after a timeout of several minutes and even a one-minute 3142 timeout per connection will result in a very large delay if retries 3143 are repeated for dozens, or even hundreds, of queued messages to the 3144 same host. 3146 At the same time, SMTP clients SHOULD use great care in caching 3147 negative responses from servers. In an extreme case, if EHLO is 3148 issued multiple times during the same SMTP connection, different 3149 answers may be returned by the server. More significantly, 5yz 3150 responses to the MAIL command MUST NOT be cached. 3152 When a mail message is to be delivered to multiple recipients, and 3153 the SMTP server to which a copy of the message is to be sent is the 3154 same for multiple recipients, then only one copy of the message 3155 SHOULD be transmitted. That is, the SMTP client SHOULD use the 3156 command sequence: MAIL, RCPT, RCPT,... RCPT, DATA instead of the 3157 sequence: MAIL, RCPT, DATA, ..., MAIL, RCPT, DATA. However, if there 3158 are very many addresses, a limit on the number of RCPT commands per 3159 MAIL command MAY be imposed. This efficiency feature SHOULD be 3160 implemented. 3162 Similarly, to achieve timely delivery, the SMTP client MAY support 3163 multiple concurrent outgoing mail transactions. However, some limit 3164 may be appropriate to protect the host from devoting all its 3165 resources to mail. 3167 4.5.4.2. Receiving Strategy 3169 The SMTP server SHOULD attempt to keep a pending listen on the SMTP 3170 port (specified by IANA as port 25) at all times. This requires the 3171 support of multiple incoming TCP connections for SMTP. Some limit 3172 MAY be imposed but servers that cannot handle more than one SMTP 3173 transaction at a time are not in conformance with the intent of this 3174 specification. 3176 As discussed above, when the SMTP server receives mail from a 3177 particular host address, it could activate its own SMTP queuing 3178 mechanisms to retry any mail pending for that host address. 3180 4.5.5. Messages with a null reverse-path 3182 There are several types of notification messages which are required 3183 by existing and proposed standards to be sent with a null reverse 3184 path, namely non-delivery notifications as discussed in Section 3.7, 3185 other kinds of Delivery Status Notifications (DSNs, RFC 3461 [32]), 3186 and also Message Disposition Notifications (MDNs, RFC 3798 [37]). 3187 All of these kinds of messages are notifications about a previous 3188 message, and they are sent to the reverse-path of the previous mail 3189 message. (If the delivery of such a notification message fails, that 3190 usually indicates a problem with the mail system of the host to which 3191 the notification message is addressed. For this reason, at some 3192 hosts the MTA is set up to forward such failed notification messages 3193 to someone who is able to fix problems with the mail system, e.g., 3194 via the postmaster alias.) 3196 All other types of messages (i.e., any message which is not required 3197 by a standards-track RFC to have a null reverse-path) SHOULD be sent 3198 with a valid, non-null reverse-path. 3200 Implementers of automated email processors should be careful to make 3201 sure that the various kinds of messages with a null reverse-path are 3202 handled correctly. In particular such systems SHOULD NOT reply to 3203 messages with a null reverse-path and they SHOULD NOT add a non-null 3204 reverse-path, or change a null reverse-path to a non-null one, to 3205 such messages when forwarding. 3207 5. Address Resolution and Mail Handling 3209 5.1. Locating the Target Host 3211 Once an SMTP client lexically identifies a domain to which mail will 3212 be delivered for processing (as described in sections Section 2.3.5 3213 and Section 3.6), a DNS lookup MUST be performed to resolve the 3214 domain name (RFC 1035 [1]). The names are expected to be fully- 3215 qualified domain names (FQDNs): mechanisms for inferring FQDNs from 3216 partial names or local aliases are outside of this specification. 3217 Due to a history of problems, SMTP servers used for initial 3218 submission of messages SHOULD NOT make such inferences (Message 3219 Submission Servers [18] have somewhat more flexibility) and 3220 intermediate (relay) SMTP servers MUST NOT make them. 3222 The lookup first attempts to locate an MX record associated with the 3223 name. If a CNAME record is found, the resulting name is processed as 3224 if it were the initial name. If a non-existent domain error is 3225 returned, this situation MUST be reported as an error. If a 3226 temporary error is returned, the message MUST be queued and retried 3227 later (See Section 4.5.4.1). If an empty list of MXs is returned, 3228 the address is treated as if it was associated with an implicit MX 3229 RR, with a preference of 0, pointing to that host. If MX records are 3230 present, but none of them are usable, or the implicit MX is unusable, 3231 this situation MUST be reported as an error. 3233 If one or more MX RRs are found for a given name, SMTP systems MUST 3234 NOT utilize any address RRs associated with that name unless they are 3235 located using the MX RRs; the "implicit MX" rule above applies only 3236 if there are no MX records present. If MX records are present, but 3237 none of them are usable, this situation MUST be reported as an error. 3239 When a domain name associated with an MX RR is looked up and the 3240 associated data field obtained, the data field of that response MUST 3241 contain a domain-name. That domain-name, when queried, MUST return 3242 at least one address record (e.g., A or AAAA RR) that gives the IP 3243 address of the SMTP server to which the message should be directed. 3244 Any other response, specifically including a value that will return a 3245 CNAME record when queried, lies outside the scope of this standard. 3246 The prohibition on labels in the data that resolve to CNAMEs is 3247 discussed in more detail in RFC 2181, Section 10.3 [38]. 3249 When the lookup succeeds, the mapping can result in a list of 3250 alternative delivery addresses rather than a single address, because 3251 of multiple MX records, multihoming, or both. To provide reliable 3252 mail transmission, the SMTP client MUST be able to try (and retry) 3253 each of the relevant addresses in this list in order, until a 3254 delivery attempt succeeds. However, there MAY also be a configurable 3255 limit on the number of alternate addresses that can be tried. In any 3256 case, the SMTP client SHOULD try at least two addresses. 3258 Two types of information are used to rank the host addresses: 3259 multiple MX records, and multihomed hosts. 3261 MX records contain a preference indication that MUST be used in 3262 sorting if more than one such record appears (see below). Lower 3263 numbers are more preferred than higher ones. If there are multiple 3264 destinations with the same preference and there is no clear reason to 3265 favor one (e.g., by recognition of an easily-reached address), then 3266 the sender-SMTP MUST randomize them to spread the load across 3267 multiple mail exchangers for a specific organization. 3269 The destination host (perhaps taken from the preferred MX record) may 3270 be multihomed, in which case the domain name resolver will return a 3271 list of alternative IP addresses. It is the responsibility of the 3272 domain name resolver interface to have ordered this list by 3273 decreasing preference if necessary, and the SMTP sender MUST try them 3274 in the order presented. 3276 Although the capability to try multiple alternative addresses is 3277 required, specific installations may want to limit or disable the use 3278 of alternative addresses. The question of whether a sender should 3279 attempt retries using the different addresses of a multihomed host 3280 has been controversial. The main argument for using the multiple 3281 addresses is that it maximizes the probability of timely delivery, 3282 and indeed sometimes the probability of any delivery; the counter- 3283 argument is that it may result in unnecessary resource use. Note 3284 that resource use is also strongly determined by the sending strategy 3285 discussed in Section 4.5.4.1. 3287 If an SMTP server receives a message with a destination for which it 3288 is a designated Mail eXchanger, it MAY relay the message (potentially 3289 after having rewritten the MAIL FROM and/or RCPT TO addresses), make 3290 final delivery of the message, or hand it off using some mechanism 3291 outside the SMTP-provided transport environment. Of course, neither 3292 of the latter require that the list of MX records be examined 3293 further. 3295 If it determines that it should relay the message without rewriting 3296 the address, it MUST sort the MX records to determine candidates for 3297 delivery. The records are first ordered by preference, with the 3298 lowest-numbered records being most preferred. The relay host MUST 3299 then inspect the list for any of the names or addresses by which it 3300 might be known in mail transactions. If a matching record is found, 3301 all records at that preference level and higher-numbered ones MUST be 3302 discarded from consideration. If there are no records left at that 3303 point, it is an error condition, and the message MUST be returned as 3304 undeliverable. If records do remain, they SHOULD be tried, best 3305 preference first, as described above. 3307 5.2. IPv6 and MX Records 3309 In the contemporary Internet, SMTP clients and servers may be hosted 3310 on IPv4 systems, IPv6 systems, or dual-stack systems that are 3311 compatible with either version of the Internet Protocol. The host 3312 domains to which MX records point may, consequently, contain "A RR"s 3313 (IPv4), "AAAA RR"s (IPv6), or any combination of them. While RFC 3314 3974 [39] discusses some operational experience in mixed 3315 environments, it was not comprehensive enough to justify 3316 standardization and some of its recommendations appear to be 3317 inconsistent with this specification. The appropriate actions to be 3318 taken will either depend on local circumstances, such as performance 3319 of the relevant networks and any conversions that might be necessary, 3320 or will be obvious (e.g., an IPv6-only client need not attempt to 3321 look up A RRs or attempt to reach IPv4-only servers). Designers of 3322 SMTP implementations that might run in IPv6 or dual stack 3323 environments should study the procedures above, especially the 3324 comments about multihomed hosts, and, preferably, provide mechanisms 3325 to facilitate operational tuning and mail interoperability between 3326 IPv4 and IPv6 systems while considering local circumstances. 3328 6. Problem Detection and Handling 3329 6.1. Reliable Delivery and Replies by Email 3331 When the receiver-SMTP accepts a piece of mail (by sending a "250 OK" 3332 message in response to DATA), it is accepting responsibility for 3333 delivering or relaying the message. It must take this responsibility 3334 seriously. It MUST NOT lose the message for frivolous reasons, such 3335 as because the host later crashes or because of a predictable 3336 resource shortage. Some reasons that are not considered frivolous 3337 are discussed in the next subsection and in Section 7.8. 3339 If there is a delivery failure after acceptance of a message, the 3340 receiver-SMTP MUST formulate and mail a notification message. This 3341 notification MUST be sent using a null ("<>") reverse path in the 3342 envelope. The recipient of this notification MUST be the address 3343 from the envelope return path (or the Return-Path: line). However, 3344 if this address is null ("<>"), the receiver-SMTP MUST NOT send a 3345 notification. Obviously, nothing in this section can or should 3346 prohibit local decisions (i.e., as part of the same system 3347 environment as the receiver-SMTP) to log or otherwise transmit 3348 information about null address events locally if that is desired. If 3349 the address is an explicit source route, it MUST be stripped down to 3350 its final hop. 3352 For example, suppose that an error notification must be sent for a 3353 message that arrived with: 3355 MAIL FROM:<@a,@b:user@d> 3357 The notification message MUST be sent using: 3359 RCPT TO: 3361 Some delivery failures after the message is accepted by SMTP will be 3362 unavoidable. For example, it may be impossible for the receiving 3363 SMTP server to validate all the delivery addresses in RCPT command(s) 3364 due to a "soft" domain system error, because the target is a mailing 3365 list (see earlier discussion of RCPT), or because the server is 3366 acting as a relay and has no immediate access to the delivering 3367 system. 3369 To avoid receiving duplicate messages as the result of timeouts, a 3370 receiver-SMTP MUST seek to minimize the time required to respond to 3371 the final . end of data indicator. See RFC 1047 [40] for 3372 a discussion of this problem. 3374 6.2. Unwanted, unsolicited, and "attack" messages 3376 Utility and predictability of the Internet mail system requires that 3377 messages that can be delivered should be delivered, regardless of any 3378 syntax or other faults associated with those messages and regardless 3379 of their content. If they cannot be delivered, and cannot be 3380 rejected by the SMTP server during the SMTP transaction, they should 3381 be "bounced" (returned with non-delivery notification messages) as 3382 described above. In today's world, in which many SMTP server 3383 operators have discovered that the quantity of undesirable bulk email 3384 vastly exceeds the quantity of desired mail and in which accepting a 3385 message may trigger additional undesirable traffic by providing 3386 verification of the address, those principles may not be practical. 3388 As discussed in Section 7.8 and Section 7.9 below, dropping mail 3389 without notification of the sender is permitted in practice. 3390 However, it is extremely dangerous and violates a long tradition and 3391 community expectations that mail is either delivered or returned. If 3392 silent message-dropping is misused, it could easily undermine 3393 confidence in the reliability of the Internet's mail systems. So 3394 silent dropping of messages should be considered only in those cases 3395 where there is very high confidence that the messages are seriously 3396 fraudulent or otherwise inappropriate. 3398 To stretch the principle of delivery if possible even further, it may 3399 be a rational policy to not deliver mail that has an invalid return 3400 address, although the history of the network is that users are 3401 typically better served by delivering any message that can be 3402 delivered. Reliably determining that a return address is invalid can 3403 be a difficult and time-consuming process, especially if the putative 3404 sending system is not directly accessible or doesn't fully and 3405 accurately support VRFY and, even if a "drop messages with invalid 3406 return addresses" policy is adopted, it SHOULD be applied only when 3407 there is near-certainty that the return addresses are, in fact, 3408 invalid. 3410 Conversely, if a message is rejected because it is found to contain 3411 hostile content (a decision that is outside the scope of an SMTP 3412 server as defined in this document), rejection ("bounce") messages 3413 SHOULD NOT be sent unless the receiving site is confident that those 3414 messages will be usefully delivered. The preference and default in 3415 these cases is to avoid sending non-delivery messages when the 3416 incoming message is determined to contain hostile content. 3418 6.3. Loop Detection 3420 Simple counting of the number of "Received:" header fields in a 3421 message has proven to be an effective, although rarely optimal, 3422 method of detecting loops in mail systems. SMTP servers using this 3423 technique SHOULD use a large rejection threshold, normally at least 3424 100 Received entries. Whatever mechanisms are used, servers MUST 3425 contain provisions for detecting and stopping trivial loops. 3427 6.4. Compensating for Irregularities 3429 Unfortunately, variations, creative interpretations, and outright 3430 violations of Internet mail protocols do occur; some would suggest 3431 that they occur quite frequently. The debate as to whether a well- 3432 behaved SMTP receiver or relay should reject a malformed message, 3433 attempt to pass it on unchanged, or attempt to repair it to increase 3434 the odds of successful delivery (or subsequent reply) began almost 3435 with the dawn of structured network mail and shows no signs of 3436 abating. Advocates of rejection claim that attempted repairs are 3437 rarely completely adequate and that rejection of bad messages is the 3438 only way to get the offending software repaired. Advocates of 3439 "repair" or "deliver no matter what" argue that users prefer that 3440 mail go through it if at all possible and that there are significant 3441 market pressures in that direction. In practice, these market 3442 pressures may be more important to particular vendors than strict 3443 conformance to the standards, regardless of the preference of the 3444 actual developers. 3446 The problems associated with ill-formed messages were exacerbated by 3447 the introduction of the split-UA mail reading protocols (Post Office 3448 Protocol (POP) version 2 [15], Post Office Protocol (POP) version 3 3449 [16], IMAP version 2 [41], and PCMAIL [42]). These protocols 3450 encouraged the use of SMTP as a posting (message submission) 3451 protocol, and SMTP servers as relay systems for these client hosts 3452 (which are often only intermittently connected to the Internet). 3453 Historically, many of those client machines lacked some of the 3454 mechanisms and information assumed by SMTP (and indeed, by the mail 3455 format protocol, RFC 822 [28]). Some could not keep adequate track 3456 of time; others had no concept of time zones; still others could not 3457 identify their own names or addresses; and, of course, none could 3458 satisfy the assumptions that underlay RFC 822's conception of 3459 authenticated addresses. 3461 In response to these weak SMTP clients, many SMTP systems now 3462 complete messages that are delivered to them in incomplete or 3463 incorrect form. This strategy is generally considered appropriate 3464 when the server can identify or authenticate the client, and there 3465 are prior agreements between them. By contrast, there is at best 3466 great concern about fixes applied by a relay or delivery SMTP server 3467 that has little or no knowledge of the user or client machine. Many 3468 of these issues are addressed by using a separate protocol, such as 3469 that defined in RFC 4409 [18], for message submission, rather than 3470 using originating SMTP servers for that purpose. 3472 The following changes to a message being processed MAY be applied 3473 when necessary by an originating SMTP server, or one used as the 3474 target of SMTP as an initial posting (message submission) protocol: 3476 o Addition of a message-id field when none appears 3478 o Addition of a date, time or time zone when none appears 3480 o Correction of addresses to proper FQDN format 3482 The less information the server has about the client, the less likely 3483 these changes are to be correct and the more caution and conservatism 3484 should be applied when considering whether or not to perform fixes 3485 and how. These changes MUST NOT be applied by an SMTP server that 3486 provides an intermediate relay function. 3488 In all cases, properly-operating clients supplying correct 3489 information are preferred to corrections by the SMTP server. In all 3490 cases, documentation SHOULD be provided in trace header fields and/or 3491 header field comments for actions performed by the servers. 3493 7. Security Considerations 3495 7.1. Mail Security and Spoofing 3497 SMTP mail is inherently insecure in that it is feasible for even 3498 fairly casual users to negotiate directly with receiving and relaying 3499 SMTP servers and create messages that will trick a naive recipient 3500 into believing that they came from somewhere else. Constructing such 3501 a message so that the "spoofed" behavior cannot be detected by an 3502 expert is somewhat more difficult, but not sufficiently so as to be a 3503 deterrent to someone who is determined and knowledgeable. 3504 Consequently, as knowledge of Internet mail increases, so does the 3505 knowledge that SMTP mail inherently cannot be authenticated, or 3506 integrity checks provided, at the transport level. Real mail 3507 security lies only in end-to-end methods involving the message 3508 bodies, such as those which use digital signatures (see RFC 1847 [43] 3509 and, e.g., PGP in RFC 4880 [44] or S/MIME in RFC 3851 [45]). 3511 Various protocol extensions and configuration options that provide 3512 authentication at the transport level (e.g., from an SMTP client to 3513 an SMTP server) improve somewhat on the traditional situation 3514 described above. However, in general they only authenticate one 3515 server to another rather than a chain of relays and servers, much 3516 less authenticating users or user machines. Consequently, unless 3517 they are accompanied by careful handoffs of responsibility in a 3518 carefully-designed trust environment, they remain inherently weaker 3519 than end-to-end mechanisms which use digitally signed messages rather 3520 than depending on the integrity of the transport system. 3522 Efforts to make it more difficult for users to set envelope return 3523 path and header "From" fields to point to valid addresses other than 3524 their own are largely misguided: they frustrate legitimate 3525 applications in which mail is sent by one user on behalf of another, 3526 in which error (or normal) replies should be directed to a special 3527 address, or in which a single message is sent to multiple recipients 3528 on different hosts. (Systems that provide convenient ways for users 3529 to alter these header fields on a per-message basis should attempt to 3530 establish a primary and permanent mailbox address for the user so 3531 that Sender header fields within the message data can be generated 3532 sensibly.) 3534 This specification does not further address the authentication issues 3535 associated with SMTP other than to advocate that useful functionality 3536 not be disabled in the hope of providing some small margin of 3537 protection against a user who is trying to fake mail. 3539 7.2. "Blind" Copies 3541 Addresses that do not appear in the message header section may appear 3542 in the RCPT commands to an SMTP server for a number of reasons. The 3543 two most common involve the use of a mailing address as a "list 3544 exploder" (a single address that resolves into multiple addresses) 3545 and the appearance of "blind copies". Especially when more than one 3546 RCPT command is present, and in order to avoid defeating some of the 3547 purpose of these mechanisms, SMTP clients and servers SHOULD NOT copy 3548 the full set of RCPT command arguments into the header section, 3549 either as part of trace header fields or as informational or private- 3550 extension header fields. Since this rule is often violated in 3551 practice, and cannot be enforced, sending SMTP systems that are aware 3552 of "bcc" use MAY find it helpful to send each blind copy as a 3553 separate message transaction containing only a single RCPT command. 3555 There is no inherent relationship between either "reverse" (from 3556 MAIL, SAML, etc., commands) or "forward" (RCPT) addresses in the SMTP 3557 transaction ("envelope") and the addresses in the header section. 3558 Receiving systems SHOULD NOT attempt to deduce such relationships and 3559 use them to alter the header section of the message for delivery. 3560 The popular "Apparently-to" header field is a violation of this 3561 principle as well as a common source of unintended information 3562 disclosure and SHOULD NOT be used. 3564 7.3. VRFY, EXPN, and Security 3566 As discussed in Section 3.5, individual sites may want to disable 3567 either or both of VRFY or EXPN for security reasons (see below). As 3568 a corollary to the above, implementations that permit this MUST NOT 3569 appear to have verified addresses that are not, in fact, verified. 3570 If a site disables these commands for security reasons, the SMTP 3571 server MUST return a 252 response, rather than a code that could be 3572 confused with successful or unsuccessful verification. 3574 Returning a 250 reply code with the address listed in the VRFY 3575 command after having checked it only for syntax violates this rule. 3576 Of course, an implementation that "supports" VRFY by always returning 3577 550 whether or not the address is valid is equally not in 3578 conformance. 3580 On the public Internet, the contents of mailing lists have become 3581 popular as an address information source for so-called "spammers." 3582 The use of EXPN to "harvest" addresses has increased as list 3583 administrators have installed protections against inappropriate uses 3584 of the lists themselves. However, VRFY and EXPN are still useful for 3585 authenticated users and within an administrative domain. For 3586 example, VRFY and EXPN are useful for performing internal audits of 3587 how email gets routed to check and to make sure no one is 3588 automatically forwarding sensitive mail outside the organization. 3589 Sites implementing SMTP authentication may choose to make VRFY and 3590 EXPN available only to authenticated requestors. Implementations 3591 SHOULD still provide support for EXPN, but sites SHOULD carefully 3592 evaluate the tradeoffs. 3594 Whether disabling VRFY provides any real marginal security depends on 3595 a series of other conditions. In many cases, RCPT commands can be 3596 used to obtain the same information about address validity. On the 3597 other hand, especially in situations where determination of address 3598 validity for RCPT commands is deferred until after the DATA command 3599 is received, RCPT may return no information at all, while VRFY is 3600 expected to make a serious attempt to determine validity before 3601 generating a response code (see discussion above). 3603 7.4. Mail Rerouting Based on the 251 and 551 Response Codes 3605 Before a client uses the 251 or 551 reply codes from a RCPT command 3606 to automatically update its future behavior (e.g., updating the 3607 user's address book), it should be certain of the server's 3608 authenticity. If it does not, it may be subject to a man in the 3609 middle attack. 3611 7.5. Information Disclosure in Announcements 3613 There has been an ongoing debate about the tradeoffs between the 3614 debugging advantages of announcing server type and version (and, 3615 sometimes, even server domain name) in the greeting response or in 3616 response to the HELP command and the disadvantages of exposing 3617 information that might be useful in a potential hostile attack. The 3618 utility of the debugging information is beyond doubt. Those who 3619 argue for making it available point out that it is far better to 3620 actually secure an SMTP server rather than hope that trying to 3621 conceal known vulnerabilities by hiding the server's precise identity 3622 will provide more protection. Sites are encouraged to evaluate the 3623 tradeoff with that issue in mind; implementations SHOULD minimally 3624 provide for making type and version information available in some way 3625 to other network hosts. 3627 7.6. Information Disclosure in Trace Fields 3629 In some circumstances, such as when mail originates from within a LAN 3630 whose hosts are not directly on the public Internet, trace 3631 ("Received") header fields produced in conformance with this 3632 specification may disclose host names and similar information that 3633 would not normally be available. This ordinarily does not pose a 3634 problem, but sites with special concerns about name disclosure should 3635 be aware of it. Also, the optional FOR clause should be supplied 3636 with caution or not at all when multiple recipients are involved lest 3637 it inadvertently disclose the identities of "blind copy" recipients 3638 to others. 3640 7.7. Information Disclosure in Message Forwarding 3642 As discussed in Section 3.4, use of the 251 or 551 reply codes to 3643 identify the replacement address associated with a mailbox may 3644 inadvertently disclose sensitive information. Sites that are 3645 concerned about those issues should ensure that they select and 3646 configure servers appropriately. 3648 7.8. Resistance to Attacks 3650 In recent years, there has been an increase of attacks on SMTP 3651 servers, either in conjunction with attempts to discover addresses 3652 for sending unsolicited messages or simply to make the servers 3653 inaccessible to others (i.e., as an application-level denial of 3654 service attack). While the means of doing so are beyond the scope of 3655 this standard, rational operational behavior requires that servers be 3656 permitted to detect such attacks and take action to defend 3657 themselves. For example, if a server determines that a large number 3658 of RCPT TO commands are being sent, most or all with invalid 3659 addresses, as part of such an attack, it would be reasonable for the 3660 server to close the connection after generating an appropriate number 3661 of 5yz (normally 550) replies. 3663 7.9. Scope of Operation of SMTP Servers 3665 It is a well-established principle that an SMTP server may refuse to 3666 accept mail for any operational or technical reason that makes sense 3667 to the site providing the server. However, cooperation among sites 3668 and installations makes the Internet possible. If sites take 3669 excessive advantage of the right to reject traffic, the ubiquity of 3670 email availability (one of the strengths of the Internet) will be 3671 threatened; considerable care should be taken and balance maintained 3672 if a site decides to be selective about the traffic it will accept 3673 and process. 3675 In recent years, use of the relay function through arbitrary sites 3676 has been used as part of hostile efforts to hide the actual origins 3677 of mail. Some sites have decided to limit the use of the relay 3678 function to known or identifiable sources, and implementations SHOULD 3679 provide the capability to perform this type of filtering. When mail 3680 is rejected for these or other policy reasons, a 550 code SHOULD be 3681 used in response to EHLO (or HELO), MAIL, or RCPT as appropriate. 3683 8. IANA Considerations 3685 IANA will maintain three registries in support of this specification, 3686 all of which were created for RFC 2821 or earlier. This document 3687 expands the third one as specified below. The registry references 3688 listed are as of the time of publication; IANA does not guarantee the 3689 locations associated with the URLs. The registries are 3691 o The first, "Simple Mail Transfer Protocol (SMTP) Service 3692 Extensions" [46], consists of SMTP service extensions with the 3693 associated keywords, and, as needed, parameters and verbs. As 3694 specified in Section 2.2.2, no entry may be made in this registry 3695 that starts in an "X". Entries may be made only for service 3696 extensions (and associated keywords, parameters, or verbs) that 3697 are defined in standards-track or experimental RFCs specifically 3698 approved by the IESG for this purpose. 3700 o The second registry [47], consists of "tags" that identify forms 3701 of domain literals other than those for IPv4 addresses (specified 3702 in RFC 821 and in this document) and IPv6 addresses (specified in 3703 this document). Additional literal types require standardization 3704 before being used; none are anticipated at this time. 3706 o The third, "Mail Transmission Types" [46], established by RFC 821 3707 and renewed by this specification, is a registry of link and 3708 protocol identifiers to be used with the "via" and "with" 3709 subclauses of the time stamp ("Received:" header field) described 3710 in Section 4.4. Link and protocol identifiers in addition to 3711 those specified in this document may be registered only by 3712 standardization or by way of an RFC-documented, IESG-approved, 3713 Experimental protocol extension. This name space is for 3714 identification and not limited in size: the IESG is encouraged to 3715 approve on the basis of clear documentation and a distinct method 3716 rather than preferences about the properties of the method itself. 3718 An additional subsection will be added to the "VIA link types" and 3719 "WITH protocol types" subsections of this registry to contain 3720 registrations of "Additional-registered-clauses" as described 3721 above. The registry will contain clause names, a description, a 3722 summary of the syntax of the associated String, and a reference. 3723 As new clauses are defined, they may, in principle, specify 3724 creation of their own registries if the Strings consist of 3725 reserved terms or keywords rather than less-restricted strings. 3726 As with link and protocol identifiers, additional clauses may be 3727 registered only by standardization or by way of an RFC-documented, 3728 IESG-approved, Experimental protocol extension. The additional 3729 clause name space is for identification and is not limited in 3730 size: the IESG is encouraged to approve on the basis of clear 3731 documentation, actual use or strong signs that the clause will be 3732 used, and a distinct requirement rather than preferences about the 3733 properties of the clause itself. 3735 In addition, if additional trace header fields (i.e., in addition to 3736 Return-path and Received) are ever created, those trace fields MUST 3737 be added to the IANA registry established by BCP 90 (RFC 3864) [11] 3738 for use with RFC 2822 [4]. 3740 9. Acknowledgments 3742 Many people contributed to the development of RFC 2821. That 3743 document should be consulted for those acknowledgments. For the 3744 present draft, the editor and the community owe thanks to Dawn Mann 3745 and Tony Hansen who assisted in the very painful process of editing 3746 and converting the internal format of the document from one system to 3747 another. 3749 Neither this document nor RFC 2821 would have been possible without 3750 the many contribution and insights of the late Jon Postel. Those 3751 contributions of course include the original specification of SMTP in 3752 RFC 821. A considerable quantity of text from RFC 821 still appears 3753 in this document as do several of Jon's original examples which have 3754 been updated only as needed to reflect other changes in the 3755 specification. 3757 Many people made comments or suggestions on the mailing list or in 3758 notes to the author. Important corrections or clarifications were 3759 suggested by several people, including Matti Aarnio, Glenn Anderson, 3760 Derek J. Balling, Alex van den Bogaerdt, Stephane Bortzmeyer, Vint 3761 Cerf, Jutta Degener, Steve Dorner, Lisa Dusseault, Frank Ellerman, 3762 Ned Freed, Randy Gellens, Sabahattin Gucukoglu, Philip Guenther, Arnt 3763 Gulbrandsen, Eric Hall, Richard O. Hammer, Tony Hansen, Peter J. 3764 Holzer, Kari Hurtta, Bryon Roche Kain, Valdis Kletnieks, Mathias 3765 Koerber, John Leslie, Bruce Lilly, Jeff Macdonald, Mark E. Mallett, 3766 Mark Martinec, S. Moonesamy, Lyndon Nerenberg, Chris Newman, Douglas 3767 Otis, Pete Resnick, Robert A. Rosenberg, Vince Sabio, Hector Santos, 3768 David F. Skoll, Paul Smith, and Brett Watson. 3770 The efforts of the Area Directors -- Lisa Dusseault, Ted Hardie, and 3771 Chris Newman -- to get this effort restarted and keep it moving, and 3772 of an ad hoc committee with the same purpose, are gratefully 3773 acknowledged. The members of that committee were (in alphabetical 3774 order) Dave Crocker, Cyrus Daboo, Tony Finch, Ned Freed, Randall 3775 Gellens, Tony Hansen, the author, and Alexey Melnikov. Tony Hansen 3776 also acted as ad hoc chair on the mailing list reviewing this 3777 document; without his efforts, sense of balance and fairness, and 3778 patience, it clearly would not have been possible. 3780 10. References 3782 10.1. Normative References 3784 [1] Mockapetris, P., "Domain names - implementation and 3785 specification", STD 13, RFC 1035, November 1987. 3787 [2] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC 821, 3788 August 1982. 3790 [3] Braden, R., "Requirements for Internet Hosts - Application and 3791 Support", STD 3, RFC 1123, October 1989. 3793 [4] Resnick, P., "Internet Message Format", 3794 draft-resnick-2822upd-06 (work in progress), February 2008. 3796 [[Note in Draft: RFC Editor, please straighten this out when 3797 2822bis makes it through the system. Since this is a normative 3798 reference to an I-D, we assume you will hold publication until 3799 then.]] 3801 [5] Bradner, S., "Key words for use in RFCs to Indicate Requirement 3802 Levels", BCP 14, RFC 2119, March 1997. 3804 [6] American National Standards Institute (formerly United States 3805 of America Standards Institute), "USA Code for Information 3806 Interchange", ANSI X3.4-1968, 1968. 3808 ANSI X3.4-1968 has been replaced by newer versions with slight 3809 modifications, but the 1968 version remains definitive for the 3810 Internet. 3812 [7] Crocker, D. and P. Overell, "Augmented BNF for Syntax 3813 Specifications: ABNF", STD 68, RFC 5234, January 2008. 3815 [8] Hinden, R. and S. Deering, "IP Version 6 Addressing 3816 Architecture", RFC 4291, February 2006. 3818 [9] Newman, C., "ESMTP and LMTP Transmission Types Registration", 3819 RFC 3848, July 2004. 3821 [10] Klensin, J., Freed, N., and K. Moore, "SMTP Service Extension 3822 for Message Size Declaration", STD 10, RFC 1870, November 1995. 3824 [11] Klyne, G., Nottingham, M., and J. Mogul, "Registration 3825 Procedures for Message Header Fields", BCP 90, RFC 3864, 3826 September 2004. 3828 10.2. Informative References 3830 [12] Partridge, C., "Mail routing and the domain system", RFC 974, 3831 January 1986. 3833 [13] Klensin, J., Freed, N., Rose, M., Stefferud, E., and D. 3834 Crocker, "SMTP Service Extensions", STD 10, RFC 1869, 3835 November 1995. 3837 [14] Klensin, J., "Simple Mail Transfer Protocol", RFC 2821, 3838 April 2001. 3840 [15] Butler, M., Postel, J., Chase, D., Goldberger, J., and J. 3841 Reynolds, "Post Office Protocol: Version 2", RFC 937, 3842 February 1985. 3844 [16] Myers, J. and M. Rose, "Post Office Protocol - Version 3", 3845 STD 53, RFC 1939, May 1996. 3847 [17] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 3848 4rev1", RFC 3501, March 2003. 3850 [18] Gellens, R. and J. Klensin, "Message Submission for Mail", 3851 RFC 4409, April 2006. 3853 [19] Freed, N., "SMTP Service Extension for Command Pipelining", 3854 STD 60, RFC 2920, September 2000. 3856 [20] Vaudreuil, G., "SMTP Service Extensions for Transmission of 3857 Large and Binary MIME Messages", RFC 3030, December 2000. 3859 [21] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 3860 Extensions (MIME) Part One: Format of Internet Message Bodies", 3861 RFC 2045, November 1996. 3863 [22] Klensin, J., Freed, N., Rose, M., Stefferud, E., and D. 3864 Crocker, "SMTP Service Extension for 8bit-MIMEtransport", 3865 RFC 1652, July 1994. 3867 [23] Moore, K., "MIME (Multipurpose Internet Mail Extensions) Part 3868 Three: Message Header Extensions for Non-ASCII Text", RFC 2047, 3869 November 1996. 3871 [24] Freed, N. and K. Moore, "MIME Parameter Value and Encoded Word 3872 Extensions: Character Sets, Languages, and Continuations", 3873 RFC 2231, November 1997. 3875 [25] Vaudreuil, G., "Enhanced Mail System Status Codes", RFC 3463, 3876 January 2003. 3878 [26] Hansen, T. and J. Klensin, "A Registry for SMTP Enhanced Mail 3879 System Status Codes", BCP 138, RFC 5248, June 2008. 3881 [27] Freed, N., "Behavior of and Requirements for Internet 3882 Firewalls", RFC 2979, October 2000. 3884 [28] Crocker, D., "Standard for the format of ARPA Internet text 3885 messages", STD 11, RFC 822, August 1982. 3887 [29] Wong, M. and W. Schlitt, "Sender Policy Framework (SPF) for 3888 Authorizing Use of Domains in E-Mail, Version 1", RFC 4408, 3889 April 2006. 3891 [30] Fenton, J., "Analysis of Threats Motivating DomainKeys 3892 Identified Mail (DKIM)", RFC 4686, September 2006. 3894 [31] Allman, E., Callas, J., Delany, M., Libbey, M., Fenton, J., and 3895 M. Thomas, "DomainKeys Identified Mail (DKIM) Signatures", 3896 RFC 4871, May 2007. 3898 [32] Moore, K., "Simple Mail Transfer Protocol (SMTP) Service 3899 Extension for Delivery Status Notifications (DSNs)", RFC 3461, 3900 January 2003. 3902 [33] Moore, K. and G. Vaudreuil, "An Extensible Message Format for 3903 Delivery Status Notifications", RFC 3464, January 2003. 3905 [34] Postel, J. and J. Reynolds, "File Transfer Protocol", STD 9, 3906 RFC 959, October 1985. 3908 [35] Kille, S., "MIXER (Mime Internet X.400 Enhanced Relay): Mapping 3909 between X.400 and RFC 822/MIME", RFC 2156, January 1998. 3911 [36] De Winter, J., "SMTP Service Extension for Remote Message Queue 3912 Starting", RFC 1985, August 1996. 3914 [37] Hansen, T. and G. Vaudreuil, "Message Disposition 3915 Notification", RFC 3798, May 2004. 3917 [38] Elz, R. and R. Bush, "Clarifications to the DNS Specification", 3918 RFC 2181, July 1997. 3920 [39] Nakamura, M. and J. Hagino, "SMTP Operational Experience in 3921 Mixed IPv4/v6 Environments", RFC 3974, January 2005. 3923 [40] Partridge, C., "Duplicate messages and SMTP", RFC 1047, 3924 February 1988. 3926 [41] Crispin, M., "Interactive Mail Access Protocol: Version 2", 3927 RFC 1176, August 1990. 3929 [42] Lambert, M., "PCMAIL: A distributed mail system for personal 3930 computers", RFC 1056, June 1988. 3932 [43] Galvin, J., Murphy, S., Crocker, S., and N. Freed, "Security 3933 Multiparts for MIME: Multipart/Signed and Multipart/Encrypted", 3934 RFC 1847, October 1995. 3936 [44] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. 3937 Thayer, "OpenPGP Message Format", RFC 4880, November 2007. 3939 [45] Ramsdell, B., "Secure/Multipurpose Internet Mail Extensions 3940 (S/MIME) Version 3.1 Message Specification", RFC 3851, 3941 July 2004. 3943 [46] Internet Assigned Number Authority (IANA), "IANA Mail 3944 Parameters", 2007, 3945 . 3947 [47] Internet Assigned Number Authority (IANA), "Address Literal 3948 Tags", 2007, 3949 . 3951 Appendix A. TCP Transport Service 3953 The TCP connection supports the transmission of 8-bit bytes. The 3954 SMTP data is 7-bit ASCII characters. Each character is transmitted 3955 as an 8-bit byte with the high-order bit cleared to zero. Service 3956 extensions may modify this rule to permit transmission of full 8-bit 3957 data bytes as part of the message body, or, if specifically designed 3958 to do so, in SMTP commands or responses. 3960 Appendix B. Generating SMTP Commands from RFC 822 Header Fields 3962 Some systems use an RFC 822 header section (only) in a mail 3963 submission protocol, or otherwise generate SMTP commands from RFC 822 3964 header fields when such a message is handed to an MTA from a UA. 3965 While the MTA-UA protocol is a private matter, not covered by any 3966 Internet Standard, there are problems with this approach. For 3967 example, there have been repeated problems with proper handling of 3968 "bcc" copies and redistribution lists when information that 3969 conceptually belongs to the mail envelope is not separated early in 3970 processing from header field information (and kept separate). 3972 It is recommended that the UA provide its initial ("submission 3973 client") MTA with an envelope separate from the message itself. 3974 However, if the envelope is not supplied, SMTP commands SHOULD be 3975 generated as follows: 3977 1. Each recipient address from a TO, CC, or BCC header field SHOULD 3978 be copied to a RCPT command (generating multiple message copies 3979 if that is required for queuing or delivery). This includes any 3980 addresses listed in a RFC 822 "group". Any BCC header fields 3981 SHOULD then be removed from the header section. Once this 3982 process is completed, the remaining header fields SHOULD be 3983 checked to verify that at least one To:, Cc:, or Bcc: header 3984 field remains. If none do, then a bcc: header field with no 3985 additional information SHOULD be inserted as specified in [4]. 3987 2. The return address in the MAIL command SHOULD, if possible, be 3988 derived from the system's identity for the submitting (local) 3989 user, and the "From:" header field otherwise. If there is a 3990 system identity available, it SHOULD also be copied to the Sender 3991 header field if it is different from the address in the From 3992 header field. (Any Sender header field that was already there 3993 SHOULD be removed.) Systems may provide a way for submitters to 3994 override the envelope return address, but may want to restrict 3995 its use to privileged users. This will not prevent mail forgery, 3996 but may lessen its incidence; see Section 7.1. 3998 When an MTA is being used in this way, it bears responsibility for 3999 ensuring that the message being transmitted is valid. The mechanisms 4000 for checking that validity, and for handling (or returning) messages 4001 that are not valid at the time of arrival, are part of the MUA-MTA 4002 interface and not covered by this specification. 4004 A submission protocol based on Standard RFC 822 information alone 4005 MUST NOT be used to gateway a message from a foreign (non-SMTP) mail 4006 system into an SMTP environment. Additional information to construct 4007 an envelope must come from some source in the other environment, 4008 whether supplemental header fields or the foreign system's envelope. 4010 Attempts to gateway messages using only their header "To" and "Cc" 4011 fields have repeatedly caused mail loops and other behavior adverse 4012 to the proper functioning of the Internet mail environment. These 4013 problems have been especially common when the message originates from 4014 an Internet mailing list and is distributed into the foreign 4015 environment using envelope information. When these messages are then 4016 processed by a header-section-only remailer, loops back to the 4017 Internet environment (and the mailing list) are almost inevitable. 4019 Appendix C. Source Routes 4021 Historically, the was a reverse source routing list of 4022 hosts and a source mailbox. The first host in the was 4023 historically the host sending the MAIL command; today, source routes 4024 SHOULD NOT appear in the reverse-path. Similarly, the 4025 may be a source routing lists of hosts and a destination mailbox. 4026 However, in general, the SHOULD contain only a mailbox 4027 and domain name, relying on the domain name system to supply routing 4028 information if required. The use of source routes is deprecated (see 4029 Appendix F.2); while servers MUST be prepared to receive and handle 4030 them as discussed in Section 3.3 and Appendix F.2, clients SHOULD NOT 4031 transmit them and this section is included in the current 4032 specification only to provide context. It has been modified somewhat 4033 from the material in RFC 821 to prevent server actions that might 4034 confuse clients or subsequent servers that do not expect a full 4035 source route implementation. 4037 For relay purposes, the forward-path may be a source route of the 4038 form "@ONE,@TWO:JOE@THREE", where ONE, TWO, and THREE MUST be fully- 4039 qualified domain names. This form is used to emphasize the 4040 distinction between an address and a route. The mailbox (here, JOE@ 4041 THREE) is an absolute address, and the route is information about how 4042 to get there. The two concepts should not be confused. 4044 If source routes are used, RFC 821 and the text below should be 4045 consulted for the mechanisms for constructing and updating the 4046 forward-path. A server that is reached by means of a source route 4047 (e.g., its domain name appears first in the list in the forward-path) 4048 MUST remove its domain name from any forward-paths in which that 4049 domain name appears before forwarding the message and MAY remove all 4050 other source routing information. The reverse-path SHOULD NOT be 4051 updated by servers conforming to this specification. 4053 Notice that the forward-path and reverse-path appear in the SMTP 4054 commands and replies, but not necessarily in the message. That is, 4055 there is no need for these paths and especially this syntax to appear 4056 in the "To:" , "From:", "CC:", etc. fields of the message header 4057 section. Conversely, SMTP servers MUST NOT derive final message 4058 routing information from message header fields. 4060 When the list of hosts is present despite the recommendations above, 4061 it is a "reverse" source route and indicates that the mail was 4062 relayed through each host on the list (the first host in the list was 4063 the most recent relay). This list is used as a source route to 4064 return non-delivery notices to the sender. If, contrary to the 4065 recommendations here, a relay host adds itself to the beginning of 4066 the list, it MUST use its name as known in the transport environment 4067 to which it is relaying the mail rather than that of the transport 4068 environment from which the mail came (if they are different). Note 4069 that a situation could easily arise in which some relay hosts add 4070 their names to the reverse source route and others do not, generating 4071 discontinuities in the routing list. This is another reason why 4072 servers needing to return a message SHOULD ignore the source route 4073 entirely and simply use the domain as specified in the Mailbox. 4075 Appendix D. Scenarios 4077 This section presents complete scenarios of several types of SMTP 4078 sessions. In the examples, "C:" indicates what is said by the SMTP 4079 client, and "S:" indicates what is said by the SMTP server. 4081 D.1. A Typical SMTP Transaction Scenario 4083 This SMTP example shows mail sent by Smith at host bar.com, and to 4084 Jones, Green, and Brown at host foo.com. Here we assume that host 4085 bar.com contacts host foo.com directly. The mail is accepted for 4086 Jones and Brown. Green does not have a mailbox at host foo.com. 4088 S: 220 foo.com Simple Mail Transfer Service Ready 4089 C: EHLO bar.com 4090 S: 250-foo.com greets bar.com 4091 S: 250-8BITMIME 4092 S: 250-SIZE 4093 S: 250-DSN 4094 S: 250 HELP 4095 C: MAIL FROM: 4096 S: 250 OK 4097 C: RCPT TO: 4098 S: 250 OK 4099 C: RCPT TO: 4100 S: 550 No such user here 4101 C: RCPT TO: 4102 S: 250 OK 4103 C: DATA 4104 S: 354 Start mail input; end with . 4105 C: Blah blah blah... 4106 C: ...etc. etc. etc. 4107 C: . 4108 S: 250 OK 4109 C: QUIT 4110 S: 221 foo.com Service closing transmission channel 4112 D.2. Aborted SMTP Transaction Scenario 4114 S: 220 foo.com Simple Mail Transfer Service Ready 4115 C: EHLO bar.com 4116 S: 250-foo.com greets bar.com 4117 S: 250-8BITMIME 4118 S: 250-SIZE 4119 S: 250-DSN 4120 S: 250 HELP 4121 C: MAIL FROM: 4122 S: 250 OK 4123 C: RCPT TO: 4124 S: 250 OK 4125 C: RCPT TO: 4126 S: 550 No such user here 4127 C: RSET 4128 S: 250 OK 4129 C: QUIT 4130 S: 221 foo.com Service closing transmission channel 4132 D.3. Relayed Mail Scenario 4134 Step 1 -- Source Host to Relay Host 4136 The source host performs a DNS lookup on XYZ.COM (the destination 4137 address) and finds DNS MX records specifying xyz.com as the best 4138 preference and foo.com as a lower preference. It attempts to open a 4139 connection to xyz.com and fails. It then opens a connection to 4140 foo.com, with the following dialogue: 4142 S: 220 foo.com Simple Mail Transfer Service Ready 4143 C: EHLO bar.com 4144 S: 250-foo.com greets bar.com 4145 S: 250-8BITMIME 4146 S: 250-SIZE 4147 S: 250-DSN 4148 S: 250 HELP 4149 C: MAIL FROM: 4150 S: 250 OK 4151 C: RCPT TO: 4152 S: 250 OK 4153 C: DATA 4154 S: 354 Start mail input; end with . 4155 C: Date: Thu, 21 May 1998 05:33:29 -0700 4156 C: From: John Q. Public 4157 C: Subject: The Next Meeting of the Board 4158 C: To: Jones@xyz.com 4159 C: 4160 C: Bill: 4161 C: The next meeting of the board of directors will be 4162 C: on Tuesday. 4163 C: John. 4164 C: . 4165 S: 250 OK 4166 C: QUIT 4167 S: 221 foo.com Service closing transmission channel 4169 Step 2 -- Relay Host to Destination Host 4171 foo.com, having received the message, now does a DNS lookup on 4172 xyz.com. It finds the same set of MX records, but cannot use the one 4173 that points to itself (or to any other host as a worse preference). 4174 It tries to open a connection to xyz.com itself and succeeds. Then 4175 we have: 4177 S: 220 xyz.com Simple Mail Transfer Service Ready 4178 C: EHLO foo.com 4179 S: 250 xyz.com is on the air 4180 C: MAIL FROM: 4181 S: 250 OK 4182 C: RCPT TO: 4183 S: 250 OK 4184 C: DATA 4185 S: 354 Start mail input; end with . 4186 C: Received: from bar.com by foo.com ; Thu, 21 May 1998 4187 C: 05:33:29 -0700 4188 C: Date: Thu, 21 May 1998 05:33:22 -0700 4189 C: From: John Q. Public 4190 C: Subject: The Next Meeting of the Board 4191 C: To: Jones@xyz.com 4192 C: 4193 C: Bill: 4194 C: The next meeting of the board of directors will be 4195 C: on Tuesday. 4196 C: John. 4197 C: . 4198 S: 250 OK 4199 C: QUIT 4200 S: 221 foo.com Service closing transmission channel 4202 D.4. Verifying and Sending Scenario 4204 S: 220 foo.com Simple Mail Transfer Service Ready 4205 C: EHLO bar.com 4206 S: 250-foo.com greets bar.com 4207 S: 250-8BITMIME 4208 S: 250-SIZE 4209 S: 250-DSN 4210 S: 250-VRFY 4211 S: 250 HELP 4212 C: VRFY Crispin 4213 S: 250 Mark Crispin 4214 C: MAIL FROM: 4215 S: 250 OK 4216 C: RCPT TO: 4217 S: 250 OK 4218 C: DATA 4219 S: 354 Start mail input; end with . 4220 C: Blah blah blah... 4221 C: ...etc. etc. etc. 4222 C: . 4223 S: 250 OK 4224 C: QUIT 4225 S: 221 foo.com Service closing transmission channel 4227 Appendix E. Other Gateway Issues 4229 In general, gateways between the Internet and other mail systems 4230 SHOULD attempt to preserve any layering semantics across the 4231 boundaries between the two mail systems involved. Gateway- 4232 translation approaches that attempt to take shortcuts by mapping 4233 (such as mapping envelope information from one system to the message 4234 header section or body of another) have generally proven to be 4235 inadequate in important ways. Systems translating between 4236 environments that do not support both envelopes and a header section 4237 and Internet mail must be written with the understanding that some 4238 information loss is almost inevitable. 4240 Appendix F. Deprecated Features of RFC 821 4242 A few features of RFC 821 have proven to be problematic and SHOULD 4243 NOT be used in Internet mail. 4245 F.1. TURN 4247 This command, described in RFC 821, raises important security issues 4248 since, in the absence of strong authentication of the host requesting 4249 that the client and server switch roles, it can easily be used to 4250 divert mail from its correct destination. Its use is deprecated; 4251 SMTP systems SHOULD NOT use it unless the server can authenticate the 4252 client. 4254 F.2. Source Routing 4256 RFC 821 utilized the concept of explicit source routing to get mail 4257 from one host to another via a series of relays. The requirement to 4258 utilize source routes in regular mail traffic was eliminated by the 4259 introduction of the domain name system "MX" record and the last 4260 significant justification for them was eliminated by the 4261 introduction, in RFC 1123, of a clear requirement that addresses 4262 following an "@" must all be fully-qualified domain names. 4263 Consequently, the only remaining justifications for the use of source 4264 routes are support for very old SMTP clients or MUAs and in mail 4265 system debugging. They can, however, still be useful in the latter 4266 circumstance and for routing mail around serious, but temporary, 4267 problems such as problems with the relevant DNS records. 4269 SMTP servers MUST continue to accept source route syntax as specified 4270 in the main body of this document and in RFC 1123. They MAY, if 4271 necessary, ignore the routes and utilize only the target domain in 4272 the address. If they do utilize the source route, the message MUST 4273 be sent to the first domain shown in the address. In particular, a 4274 server MUST NOT guess at shortcuts within the source route. 4276 Clients SHOULD NOT utilize explicit source routing except under 4277 unusual circumstances, such as debugging or potentially relaying 4278 around firewall or mail system configuration errors. 4280 F.3. HELO 4282 As discussed in Section 3.1 and Section 4.1.1, EHLO SHOULD be used 4283 rather than HELO when the server will accept the former. Servers 4284 MUST continue to accept and process HELO in order to support older 4285 clients. 4287 F.4. #-literals 4289 RFC 821 provided for specifying an Internet address as a decimal 4290 integer host number prefixed by a pound sign, "#". In practice, that 4291 form has been obsolete since the introduction of TCP/IP. It is 4292 deprecated and MUST NOT be used. 4294 F.5. Dates and Years 4296 When dates are inserted into messages by SMTP clients or servers 4297 (e.g., in trace header fields), four-digit years MUST BE used. Two- 4298 digit years are deprecated; three-digit years were never permitted in 4299 the Internet mail system. 4301 F.6. Sending versus Mailing 4303 In addition to specifying a mechanism for delivering messages to 4304 user's mailboxes, RFC 821 provided additional, optional, commands to 4305 deliver messages directly to the user's terminal screen. These 4306 commands (SEND, SAML, SOML) were rarely implemented, and changes in 4307 workstation technology and the introduction of other protocols may 4308 have rendered them obsolete even where they are implemented. 4310 Clients SHOULD NOT provide SEND, SAML, or SOML as services. Servers 4311 MAY implement them. If they are implemented by servers, the 4312 implementation model specified in RFC 821 MUST be used and the 4313 command names MUST be published in the response to the EHLO command. 4315 Appendix G. Change log 4317 [[RFC Editor: Please remove this section before publication.]] 4319 G.1. Changes from RFC 2821 to the initial (-00) version of this draft 4321 o bad ref in Section 3.7 and 3.8.1 (to 2.4.1) fixed 4323 o bad ref in Section 4.1.1.1 to 2.4.1 fixed 4325 o syntax for "domain" corrected to permit user@x.y.z. and user@tld. 4326 references 4328 o reference to BCP 90 (RFC 3894) inserted. 4330 o Productions for the reverse-path (in the MAIL command and the 4331 Return-Path header) slightly revised to clarify and be sure "<>" 4332 can appear in the latter. 4334 o Clarified use of address literals (and optional supplemental text) 4335 in EHLO. 4337 o Slight clarification to "end of mail data" sequence definition. 4339 o Clarification that a timeout may justify a server closing a 4340 connection. 4342 o Made editing correction to text describing HELO syntax. 4344 o New discussion of situations in which bounce messages may be 4345 treated in special ways or not sent at all (see especially the new 4346 Section 6.2) 4348 o Clarified that commands that were optional in 821 and 1123 (and 4349 are optional here) must appear in EHLO responses. 4351 o Post-DATA replay code discussion fixed 4353 G.2. Changes from version -00 to -01 4355 1. Several references updated to refer to newer versions of relevant 4356 documents. 4358 2. Syntax for, and discussion of, domains changed to permit single- 4359 label domain names, but only (with a SHOULD) if the trailing 4360 period is specified. 4362 3. A note was added to clarify that "Postmaster" is treated in a 4363 case-insensitive fashion. 4365 4. New material added about the implications of extensions. 4367 5. Many small editorial, formatting, and organizational changes. 4369 G.3. Changes from version -01 to -02 4371 This version incorporates changes corresponding to "issues" 4372 identified on the mailing list. 4374 1. Changed section Section 4.5.3 to use subsections, not a list 4375 (part of Issue 9) and forced these sections into the TOC. 4377 2. Started process of adapting to IPv6 by changing "A RR" to 4378 "address RR", putting in surrounding text, and adding some more 4379 general comments. 4381 3. Slightly improved the discussion of message submission 4382 protocols. 4384 4. Eliminated the remaining text that suggested trailing periods 4385 for domain references to TLDs and added corresponding text 4386 prohibiting anything but a submission server from completing 4387 aliases in domain names. 4389 5. Changed the syntax of "ID" in trace (Received) fields to "atom" 4390 from "string". 4392 6. Changed syntax to permit multiple-line Greeting (220) messages. 4393 Clarified multiline responses to require that all of the codes 4394 in a given response be the same. 4396 7. Clarified the applicability of 1yz codes: they are part of the 4397 model, but prohibited without extensions. 4399 8. Specified that "xtext" should be used when email addresses are 4400 used as extension parameter values. This has been done by 4401 reference to avoid yet more duplication of syntax rules that can 4402 later get out of synch. It is not a problem here since RFC 3461 4403 is already at Draft Standard, but this will need monitoring in 4404 the future. 4406 9. Added provision for new text about mail rerouting based on 251 4407 and 551 codes (Section 7.4) and about VRFY/EXPN responses (in 4408 xref target='meaning_vrfy_expn_success'/>). 4410 10. Clarified the rules about continuation lines to more clearly 4411 prohibit mixed codes. 4413 11. Prohibited the use of 1yz codes without extensions and added a 4414 brief explanation about the relationship to FTP. 4416 12. Added some references. 4418 13. General editorial improvements. 4420 G.4. Changes from version -02 to -03 4422 This version, and the subsequent ones, incorporate additional changes 4423 corresponding to "issues" identified on the mailing list. 4425 1. Informal text that used terms such as "discouraged", 4426 "encouraged", "permitted", or "prohibited" to express protocol 4427 requirements has been changed to "SHOULD", "MUST", or "MAY" where 4428 appropriate. 4430 2. Rewrote Appendix C to better reflect the source route environment 4431 and appropriate actions in an environment in which use of source 4432 routes has been deprecated since RFC 1123 in 1989. 4434 3. Some text added to clarify, non-normatively, the relationship of 4435 SMTP to Message Submission functions. 4437 4. Changed informal use of the term "header" to the more precise 4438 "header section" and "header field" and introduced the term 4439 "Received clause". 4441 5. More editorial and related changes to improve clarity and 4442 consistency. 4444 G.5. Changes from version -02 to -03 4446 1. Modified descriptive text for 450 code to reflect policy 4447 refusals. 4449 2. New text about sender verification and generation of NDNs 4451 3. Tuned 1yz and FTP text 4453 4. More corrections of minor typos, etc. 4455 G.6. Changes from version -03 to -04 4457 1. Removed "explained-literal" syntax and rewrote the explanation 4458 (issue 19). 4460 2. Revised text for responsibility handoff (issue 32b). 4462 3. Slightly further revised the "FTP relationship" text introduced 4463 in -02 and -03. 4465 4. Revised example text in appendix D to remove source routes and 4466 bring closer to MX context (issue 35). 4468 5. Editorial revisions, including rearranging some sections. 4470 G.7. Changes from version -04 to -05 4472 1. Added registry pointers to Section 8 (issue 36). 4474 2. "for" clause in Received header reduced to a single mailbox, 4475 since this seems to reflect list consensus (issue 37). An 4476 "additional registered clauses" entry was made to allow for 4477 future extension (also issue 37). 4479 3. Corrected some I-D references to point to now-published RFCs. 4481 G.8. Changes from version -05 to -06 4483 1. Checked and verified additional uses of "field", inserting 4484 "header" or substituting "clause" as needed. 4486 2. Made small adjustments in several references. 4488 3. Added text to clarify (and more clearly prohibit) rewriting null 4489 reverse-paths into something else. 4491 G.9. Changes from version -06 to -07 4493 These changes were made after -06 was posted and, in general, during 4494 and subsequent to IETF last Call. 4496 1. Clarified sentence that described the syntax of the domain part 4497 of an address. Syntax was ok. 4499 2. Truncated the "Context and Notes" section from the prior drafts. 4500 (That section is to be removed entirely by the RFC Editor, as 4501 noted.) 4503 3. Incorporated a large number of Last Call comments, per note from 4504 Tony Hansen to the mailing list. 4506 4. Made some syntax corrections to better align the document with 4507 normal uses of ABNF. The ABNF in the document remains 4508 descriptive rather than normative. 4510 5. Revised the description of trace and FOR clauses to be consistent 4511 with the decision to permit only one path in them. 4513 6. Removed unreferenced documents from references sections. 4515 7. Tuned some text to better align with other recommendations, e.g., 4516 explicitly indicated that the Message Submission protocol was 4517 preferred over the use of SMTP for that purpose. 4519 G.10. Changes from version -07 to -08 4521 This version was created to capture the remaining Last Call comments 4522 and as the basis for a final check in a second Last Call. Changes 4523 were made to the rules about quoted strings and a number of 4524 formatting issues were resolved. 4526 G.11. Changes from version -08 to -09 4528 Changes resulting from second last call, including some minor 4529 editorial adjustments, a change in terminology about mail sessions, 4530 and elimination of an example that used the SEND command. This 4531 version was prepared as a clean copy for IESG final review and, it is 4532 hoped, forwarding to the RFC Editor. 4534 G.12. Changes from version -09 to -10 4536 1. Changed uses of "character length" to "octet length" and wrote a 4537 brief introduction 4539 2. Modified text in Appendix A to permit extensions that would 4540 permit non-ASCII characters in command arguments or replies. 4542 3. Moved reference to RFC 1870 to Normative, since it is referenced 4543 in a SHOULD. 4545 4. Changed the description of MX handling using Glenn Anderson's 4546 text. No substantive change, just clarity. 4548 G.13. Changes from version -10 to -11 4550 This version incorporates changes developed during IESG evaluation 4551 and associated notes. 4553 1. Removed "in in" in Appendix A 4555 2. Added definition for dcontent 4557 3. Production for Standardized-tag restored to 2821 form. 4559 4. Changed 'text' in productions for Greeting and Reply-line to 4560 'textstring' and added production for the latter. 4562 5. Added RFC 1123 to the "updates" header. 4564 6. Editorial changes to make the spellings (capitalization) of 4565 Forward-path, address-literal, and QcontentSMTP internally 4566 consistent. 4568 7. Added a reference to RFC 5248 (the desire to reference that 4569 document from here was part of the reason for producing it) and 4570 noted explicitly that this section should be removed before final 4571 publication. 4573 8. Editorial cleanups: removal of excess blank spaces, changing 4574 "RFCnnnn" forms to "RFC nnnn" ones (previous versions used both 4575 with no consistency). 4577 Author's Address 4579 John C. Klensin 4580 1770 Massachusetts Ave, Suite 322 4581 Cambridge, MA 02140 4582 USA 4584 Email: john+smtp@jck.com 4586 Full Copyright Statement 4588 Copyright (C) The IETF Trust (2008). 4590 This document is subject to the rights, licenses and restrictions 4591 contained in BCP 78, and except as set forth therein, the authors 4592 retain all their rights. 4594 This document and the information contained herein are provided on an 4595 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS 4596 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND 4597 THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS 4598 OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 4599 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 4600 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 4602 Intellectual Property 4604 The IETF takes no position regarding the validity or scope of any 4605 Intellectual Property Rights or other rights that might be claimed to 4606 pertain to the implementation or use of the technology described in 4607 this document or the extent to which any license under such rights 4608 might or might not be available; nor does it represent that it has 4609 made any independent effort to identify any such rights. Information 4610 on the procedures with respect to rights in RFC documents can be 4611 found in BCP 78 and BCP 79. 4613 Copies of IPR disclosures made to the IETF Secretariat and any 4614 assurances of licenses to be made available, or the result of an 4615 attempt made to obtain a general license or permission for the use of 4616 such proprietary rights by implementers or users of this 4617 specification can be obtained from the IETF on-line IPR repository at 4618 http://www.ietf.org/ipr. 4620 The IETF invites any interested party to bring to its attention any 4621 copyrights, patents or patent applications, or other proprietary 4622 rights that may cover technology that may be required to implement 4623 this standard. Please address the information to the IETF at 4624 ietf-ipr@ietf.org.