idnits 2.17.00 (12 Aug 2021) /tmp/idnits20416/draft-ietf-emailcore-rfc5321bis-10.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. 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 RFC7504, but the abstract doesn't seem to mention this, which it should. -- The draft header indicates that this document obsoletes RFC7505, but the abstract doesn't seem to mention this, which it should. -- The draft header indicates that this document obsoletes RFC1846, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == Line 2075 has weird spacing: '...ivalent and...' -- The document date (7 March 2022) is 68 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '5321bis' on line 2984 -- Looks like a reference, but probably isn't: 'JcK 20210904' on line 2635 -- Possible downref: Non-RFC (?) normative reference: ref. '2' ** Obsolete normative reference: RFC 821 (ref. '3') (Obsoleted by RFC 2821) -- Obsolete informational reference (is this intentional?): RFC 822 (ref. '13') (Obsoleted by RFC 2822) -- Obsolete informational reference (is this intentional?): RFC 974 (ref. '16') (Obsoleted by RFC 2821) -- Obsolete informational reference (is this intentional?): RFC 1869 (ref. '22') (Obsoleted by RFC 2821) -- Obsolete informational reference (is this intentional?): RFC 2821 (ref. '30') (Obsoleted by RFC 5321) -- Obsolete informational reference (is this intentional?): RFC 3501 (ref. '36') (Obsoleted by RFC 9051) -- Duplicate reference: RFC5321, mentioned in '51', was also mentioned in '47'. Summary: 1 error (**), 0 flaws (~~), 2 warnings (==), 14 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 EMAILCORE J. Klensin 3 Internet-Draft 7 March 2022 4 Obsoletes: 5321, 1846, 7504, 7505 (if approved) 5 Intended status: Standards Track 6 Expires: 8 September 2022 8 Simple Mail Transfer Protocol 9 draft-ietf-emailcore-rfc5321bis-10 11 Abstract 13 This document is a specification of the basic protocol for Internet 14 electronic mail transport. It (including text carried forward from 15 RFC 5321) consolidates, updates, and clarifies several previous 16 documents, making all or parts of most of them obsolete. It covers 17 the SMTP extension mechanisms and best practices for the contemporary 18 Internet, but does not provide details about particular extensions. 19 The document also provides information about use of SMTP for other 20 than strict mail transport and delivery. This document replaces RFC 21 5321, the earlier version with the same title. 23 Notes on Reading This Working Draft 25 Early versions of this working draft were extensively annotated with 26 information, primarily in about changes made over the decade since 27 RFC 5321 appeared, especially when those changes might be 28 controversial or should get careful review. Most of those 29 annotations and associated questions are marked in CREF comments 30 ("//" in the text form). Starting with version -09 of the draft, 31 annotations and notes that were no longer relevant are being pruned 32 to improve readability In general, any annotations or comments not 33 marked with "[[Note in Draft", in the contents of an "Editor's note", 34 or are in the "Errata Summary" appendix (Appendix H.1, they are just 35 notes on changes that have already been made and where those changes 36 originated. As one can tell from the dates (when they are given), 37 this document has been periodically updated over a very long period 38 of time. 40 As people review or try to use this document, it may be worth paying 41 special attention to the historical discussion in Section 1.2. 43 This evolving draft should be discussed on the emailcore@ietf.org 44 list. 46 Status of This Memo 48 This Internet-Draft is submitted in full conformance with the 49 provisions of BCP 78 and BCP 79. 51 Internet-Drafts are working documents of the Internet Engineering 52 Task Force (IETF). Note that other groups may also distribute 53 working documents as Internet-Drafts. The list of current Internet- 54 Drafts is at https://datatracker.ietf.org/drafts/current/. 56 Internet-Drafts are draft documents valid for a maximum of six months 57 and may be updated, replaced, or obsoleted by other documents at any 58 time. It is inappropriate to use Internet-Drafts as reference 59 material or to cite them other than as "work in progress." 61 This Internet-Draft will expire on 8 September 2022. 63 Copyright Notice 65 Copyright (c) 2022 IETF Trust and the persons identified as the 66 document authors. All rights reserved. 68 This document is subject to BCP 78 and the IETF Trust's Legal 69 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 70 license-info) in effect on the date of publication of this document. 71 Please review these documents carefully, as they describe your rights 72 and restrictions with respect to this document. Code Components 73 extracted from this document must include Revised BSD License text as 74 described in Section 4.e of the Trust Legal Provisions and are 75 provided without warranty as described in the Revised BSD License. 77 Table of Contents 79 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7 80 1.1. Transport of Electronic Mail . . . . . . . . . . . . . . 7 81 1.2. History and Context for This Document . . . . . . . . . . 8 82 1.3. Document Conventions . . . . . . . . . . . . . . . . . . 9 83 2. The SMTP Model . . . . . . . . . . . . . . . . . . . . . . . 9 84 2.1. Basic Structure . . . . . . . . . . . . . . . . . . . . . 9 85 2.2. The Extension Model . . . . . . . . . . . . . . . . . . . 12 86 2.2.1. Background . . . . . . . . . . . . . . . . . . . . . 12 87 2.2.2. Definition and Registration of Extensions . . . . . . 13 88 2.2.3. Special Issues with Extensions . . . . . . . . . . . 13 89 2.3. SMTP Terminology . . . . . . . . . . . . . . . . . . . . 14 90 2.3.1. Mail Objects . . . . . . . . . . . . . . . . . . . . 14 91 2.3.2. Senders and Receivers . . . . . . . . . . . . . . . . 14 92 2.3.3. Mail Agents and Message Stores . . . . . . . . . . . 15 93 2.3.4. Host . . . . . . . . . . . . . . . . . . . . . . . . 15 94 2.3.5. Domain Names . . . . . . . . . . . . . . . . . . . . 15 95 2.3.6. Buffer and State Table . . . . . . . . . . . . . . . 16 96 2.3.7. Commands and Replies . . . . . . . . . . . . . . . . 16 97 2.3.8. Lines . . . . . . . . . . . . . . . . . . . . . . . . 17 98 2.3.9. Message Content and Mail Data . . . . . . . . . . . . 17 99 2.3.10. Originator, Delivery, Relay, and Gateway Systems . . 17 100 2.3.11. Mailbox and Address . . . . . . . . . . . . . . . . . 18 101 2.4. General Syntax Principles and Transaction Model . . . . . 18 102 3. The SMTP Procedures: An Overview . . . . . . . . . . . . . . 20 103 3.1. Session Initiation . . . . . . . . . . . . . . . . . . . 20 104 3.2. Client Initiation . . . . . . . . . . . . . . . . . . . . 21 105 3.3. Mail Transactions . . . . . . . . . . . . . . . . . . . . 21 106 3.4. Address Modification and Expansion . . . . . . . . . . . 24 107 3.4.1. Forwarding for Address Correction or Updating . . . . 24 108 3.4.2. Aliases and Mailing Lists . . . . . . . . . . . . . . 25 109 3.4.2.1. Simple Aliases . . . . . . . . . . . . . . . . . 26 110 3.4.2.2. Mailing Lists . . . . . . . . . . . . . . . . . . 26 111 3.5. Commands for Debugging Addresses . . . . . . . . . . . . 26 112 3.5.1. Overview . . . . . . . . . . . . . . . . . . . . . . 26 113 3.5.2. VRFY Normal Response . . . . . . . . . . . . . . . . 29 114 3.5.3. Meaning of VRFY or EXPN Success Response . . . . . . 29 115 3.5.4. Semantics and Applications of EXPN . . . . . . . . . 30 116 3.6. Relaying and Mail Routing . . . . . . . . . . . . . . . . 30 117 3.6.1. Mail eXchange Records and Relaying . . . . . . . . . 30 118 3.6.2. Message Submission Servers as Relays . . . . . . . . 30 119 3.7. Mail Gatewaying . . . . . . . . . . . . . . . . . . . . . 31 120 3.7.1. Header Fields in Gatewaying . . . . . . . . . . . . . 32 121 3.7.2. Received Lines in Gatewaying . . . . . . . . . . . . 32 122 3.7.3. Addresses in Gatewaying . . . . . . . . . . . . . . . 33 123 3.7.4. Other Header Fields in Gatewaying . . . . . . . . . . 33 124 3.7.5. Envelopes in Gatewaying . . . . . . . . . . . . . . . 33 125 3.8. Terminating Sessions and Connections . . . . . . . . . . 33 126 4. The SMTP Specifications . . . . . . . . . . . . . . . . . . . 34 127 4.1. SMTP Commands . . . . . . . . . . . . . . . . . . . . . . 34 128 4.1.1. Command Semantics and Syntax . . . . . . . . . . . . 34 129 4.1.1.1. Extended HELLO (EHLO) or HELLO (HELO) . . . . . . 35 130 4.1.1.2. MAIL (MAIL) . . . . . . . . . . . . . . . . . . . 37 131 4.1.1.3. RECIPIENT (RCPT) . . . . . . . . . . . . . . . . 37 132 4.1.1.4. DATA (DATA) . . . . . . . . . . . . . . . . . . . 39 133 4.1.1.5. RESET (RSET) . . . . . . . . . . . . . . . . . . 40 134 4.1.1.6. VERIFY (VRFY) . . . . . . . . . . . . . . . . . . 41 135 4.1.1.7. EXPAND (EXPN) . . . . . . . . . . . . . . . . . . 41 136 4.1.1.8. HELP (HELP) . . . . . . . . . . . . . . . . . . . 41 137 4.1.1.9. NOOP (NOOP) . . . . . . . . . . . . . . . . . . . 42 138 4.1.1.10. QUIT (QUIT) . . . . . . . . . . . . . . . . . . . 42 139 4.1.2. Command Argument Syntax . . . . . . . . . . . . . . . 43 140 4.1.3. Address Literals . . . . . . . . . . . . . . . . . . 45 141 4.1.4. Order of Commands . . . . . . . . . . . . . . . . . . 47 143 4.2. SMTP Replies . . . . . . . . . . . . . . . . . . . . . . 49 144 4.2.1. Reply Code Severities and Theory . . . . . . . . . . 50 145 4.2.2. Reply Codes by Function Groups . . . . . . . . . . . 53 146 4.2.3. Reply Codes in Numeric Order . . . . . . . . . . . . 54 147 4.2.4. Some specific code situations and relationships . . . 56 148 4.2.4.2. "No mail accepted" situations and the 521, 554, and 149 556 codes . . . . . . . . . . . . . . . . . . . . . 56 150 4.2.4.3. Reply Codes after DATA and the Subsequent 151 . . . . . . . . . . . . . . . . . . . . 57 152 4.3. Sequencing of Commands and Replies . . . . . . . . . . . 58 153 4.3.1. Sequencing Overview . . . . . . . . . . . . . . . . . 58 154 4.3.2. Command-Reply Sequences . . . . . . . . . . . . . . . 59 155 4.4. Trace Information . . . . . . . . . . . . . . . . . . . . 61 156 4.4.1. Received Header Field . . . . . . . . . . . . . . . . 61 157 4.5. Additional Implementation Issues . . . . . . . . . . . . 65 158 4.5.1. Minimum Implementation . . . . . . . . . . . . . . . 65 159 4.5.2. Transparency . . . . . . . . . . . . . . . . . . . . 66 160 4.5.3. Sizes and Timeouts . . . . . . . . . . . . . . . . . 66 161 4.5.3.1. Size Limits and Minimums . . . . . . . . . . . . 67 162 4.5.3.1.1. Local-part . . . . . . . . . . . . . . . . . 67 163 4.5.3.1.2. Domain . . . . . . . . . . . . . . . . . . . 67 164 4.5.3.1.3. Path . . . . . . . . . . . . . . . . . . . . 67 165 4.5.3.1.4. Command Line . . . . . . . . . . . . . . . . 67 166 4.5.3.1.5. Reply Line . . . . . . . . . . . . . . . . . 67 167 4.5.3.1.6. Text Line . . . . . . . . . . . . . . . . . . 67 168 4.5.3.1.7. Message Content . . . . . . . . . . . . . . . 68 169 4.5.3.1.8. Recipient Buffer . . . . . . . . . . . . . . 68 170 4.5.3.1.9. Treatment When Limits Exceeded . . . . . . . 68 171 4.5.3.1.10. Too Many Recipients Code . . . . . . . . . . 69 172 4.5.3.2. Timeouts . . . . . . . . . . . . . . . . . . . . 69 173 4.5.3.2.1. Initial 220 Message: 5 Minutes . . . . . . . 70 174 4.5.3.2.2. MAIL Command: 5 Minutes . . . . . . . . . . . 70 175 4.5.3.2.3. RCPT Command: 5 Minutes . . . . . . . . . . . 70 176 4.5.3.2.4. DATA Initiation: 2 Minutes . . . . . . . . . 70 177 4.5.3.2.5. Data Block: 3 Minutes . . . . . . . . . . . . 70 178 4.5.3.2.6. DATA Termination: 10 Minutes. . . . . . . . . 70 179 4.5.3.2.7. Server Timeout: 5 Minutes. . . . . . . . . . 70 180 4.5.4. Retry Strategies . . . . . . . . . . . . . . . . . . 70 181 4.5.5. Messages with a Null Reverse-Path . . . . . . . . . . 73 182 5. Address Resolution and Mail Handling . . . . . . . . . . . . 73 183 5.1. Locating the Target Host . . . . . . . . . . . . . . . . 73 184 5.2. IPv6 and MX Records . . . . . . . . . . . . . . . . . . . 75 185 6. Problem Detection and Handling . . . . . . . . . . . . . . . 76 186 6.1. Reliable Delivery and Replies by Email . . . . . . . . . 76 187 6.2. Unwanted, Unsolicited, and "Attack" Messages . . . . . . 77 188 6.3. Loop Detection . . . . . . . . . . . . . . . . . . . . . 78 189 6.4. Compensating for Irregularities . . . . . . . . . . . . . 78 190 7. Security Considerations . . . . . . . . . . . . . . . . . . . 79 191 7.1. Mail Security and Spoofing . . . . . . . . . . . . . . . 79 192 7.2. "Blind" Copies . . . . . . . . . . . . . . . . . . . . . 80 193 7.3. VRFY, EXPN, and Security . . . . . . . . . . . . . . . . 81 194 7.4. Mail Rerouting Based on the 251 and 551 Response Codes . 82 195 7.5. Information Disclosure in Announcements . . . . . . . . . 82 196 7.6. Information Disclosure in Trace Fields . . . . . . . . . 82 197 7.7. Information Disclosure in Message Forwarding . . . . . . 83 198 7.8. Local Operational Requirements and Resistance to 199 Attacks . . . . . . . . . . . . . . . . . . . . . . . . . 83 200 7.9. Scope of Operation of SMTP Servers . . . . . . . . . . . 83 201 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 84 202 9. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 85 203 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 86 204 10.1. Normative References . . . . . . . . . . . . . . . . . . 86 205 10.2. Informative References . . . . . . . . . . . . . . . . . 87 206 Appendix A. TCP Transport Service . . . . . . . . . . . . . . . 91 207 Appendix B. Generating SMTP Commands from RFC 822 Header 208 Fields . . . . . . . . . . . . . . . . . . . . . . . . . 91 209 Appendix C. Placeholder (formerly Source Routes) . . . . . . . . 93 210 Appendix D. Scenarios . . . . . . . . . . . . . . . . . . . . . 93 211 D.1. A Typical SMTP Transaction Scenario . . . . . . . . . . . 93 212 D.2. Aborted SMTP Transaction Scenario . . . . . . . . . . . . 93 213 D.3. Relayed Mail Scenario . . . . . . . . . . . . . . . . . . 94 214 D.4. Verifying and Sending Scenario . . . . . . . . . . . . . 96 215 Appendix E. Other Gateway Issues . . . . . . . . . . . . . . . . 97 216 Appendix F. Deprecated Features of RFC 821 . . . . . . . . . . . 97 217 F.1. TURN . . . . . . . . . . . . . . . . . . . . . . . . . . 98 218 F.2. Source Routing . . . . . . . . . . . . . . . . . . . . . 98 219 F.3. HELO . . . . . . . . . . . . . . . . . . . . . . . . . . 99 220 F.4. #-literals . . . . . . . . . . . . . . . . . . . . . . . 99 221 F.5. Dates and Years . . . . . . . . . . . . . . . . . . . . . 100 222 F.6. Sending versus Mailing . . . . . . . . . . . . . . . . . 100 223 Appendix G. Other Outstanding Issues . . . . . . . . . . . . . . 100 224 G.1. IP Address literals . . . . . . . . . . . . . . . . . . . 101 225 G.2. Repeated Use of EHLO (closed) . . . . . . . . . . . . . . 101 226 G.3. Meaning of "MTA" and Related Terminology . . . . . . . . 102 227 G.4. Originator, or Originating System, Authentication . . . . 102 228 G.5. Remove or deprecate the work-around from code 552 to 452 229 (closed) . . . . . . . . . . . . . . . . . . . . . . . . 102 230 G.6. Clarify where the protocol stands with respect to 231 submission and TLS issues . . . . . . . . . . . . . . . 102 232 G.7. Probably-substantive Discussion Topics Identified in Other 233 Ways . . . . . . . . . . . . . . . . . . . . . . . . . . 103 234 G.7.1. Issues with 521, 554, and 556 codes (closed) . . . . 103 235 G.7.2. SMTP Model, terminology, and relationship to RFC 236 5598 . . . . . . . . . . . . . . . . . . . . . . . . 103 237 G.7.3. Resolvable FQDNs and private domain names . . . . . . 103 238 G.7.4. Possible clarification about mail transactions and 239 transaction state . . . . . . . . . . . . . . . . . . 103 240 G.7.5. Issues with mailing lists, aliases, and forwarding . 104 241 G.7.6. Requirements for domain name and/or IP address in 242 EHLO . . . . . . . . . . . . . . . . . . . . . . . . 104 243 G.7.7. Does the 'first digit only' and/or non-listed reply 244 code text need clarification? (closed) . . . . . . . 104 245 G.7.8. Size limits (closed) . . . . . . . . . . . . . . . . 104 246 G.7.9. Discussion of 'blind' copies and RCPT . . . . . . . . 104 247 G.7.10. Further clarifications needed to source routes? . . . 105 248 G.7.11. Should 1yz Be Revisited? (closed) . . . . . . . . . . 105 249 G.7.12. Review Timeout Specifications . . . . . . . . . . . . 105 250 G.7.13. Possible SEND, SAML, SOML Loose End (closed) . . . . 105 251 G.7.14. Abstract Update (closed) . . . . . . . . . . . . . . 105 252 G.7.15. Informative References to MIME and/or Message 253 Submission (closed) . . . . . . . . . . . . . . . . . 105 254 G.7.16. Mail Transaction Discussion . . . . . . . . . . . . . 106 255 G.7.17. Hop by hop Authentication and/or Encryption 256 (closed) . . . . . . . . . . . . . . . . . . . . . . 106 257 G.7.18. More Text About 554 Given 521, etc. . . . . . . . . . 106 258 G.7.19. Minimum Lengths and Quantities . . . . . . . . . . . 106 259 G.8. Enhanced Reply Codes and DSNs . . . . . . . . . . . . . . 106 260 G.9. Revisiting Quoted Strings . . . . . . . . . . . . . . . . 107 261 G.10. Internationalization . . . . . . . . . . . . . . . . . . 107 262 G.11. SMTP Clients, Servers, Senders, and Receivers . . . . . . 108 263 G.12. Extension Keywords Starting in 'X-' (closed) . . . . . . 108 264 G.13. Deprecating HELO (closed) . . . . . . . . . . . . . . . . 108 265 G.14. The FOR Clause in Trace Fields: Semantics, Security 266 Considerations, and Other Issues . . . . . . . . . . . . 109 267 G.15. Resistance to Attacks and Operational Necessity 268 (closed) . . . . . . . . . . . . . . . . . . . . . . . . 109 269 G.16. Mandatory 8BITMIME . . . . . . . . . . . . . . . . . . . 110 270 G.17. New tickets created between 2022-01-21 and 2022-03-01 . . 110 271 Appendix H. RFC 5321 Errata Summary and Tentative Change Log . . 110 272 H.1. RFC 5321 Errata Summary . . . . . . . . . . . . . . . . . 110 273 H.2. Changes from RFC 5321 (published October 2008) to the 274 initial (-00) version of this draft . . . . . . . . . . . 113 275 H.3. Changes Among Versions of Rfc5321bis . . . . . . . . . . 114 276 H.3.1. Changes from draft-klensin-rfc5321bis-00 (posted 277 2012-12-02) to -01 . . . . . . . . . . . . . . . . . 114 278 H.3.2. Changes from draft-klensin-rfc5321bis-01 (20191203) to 279 -02 . . . . . . . . . . . . . . . . . . . . . . . . . 114 280 H.3.3. Changes from draft-klensin-rfc5321bis-02 (2019-12-27) 281 to -03 . . . . . . . . . . . . . . . . . . . . . . . 114 282 H.3.4. Changes from draft-klensin-rfc5321bis-03 (2020-07-02) 283 to draft-ietf-emailcore-rfc5321bis-00 . . . . . . . . 115 284 H.3.5. Changes from draft-ietf-emailcore-rfc5321bis-00 285 (2020-10-06) to -01 . . . . . . . . . . . . . . . . . 115 287 H.3.6. Changes from draft-ietf-emailcore-rfc5321bis-01 288 (2020-12-25) to -02 . . . . . . . . . . . . . . . . . 116 289 H.3.7. Changes from draft-ietf-emailcore-rfc5321bis-02 290 (2021-02-21) to -03 . . . . . . . . . . . . . . . . . 116 291 H.3.8. Changes from draft-ietf-emailcore-rfc5321bis-03 292 (2021-07-10) to -04 . . . . . . . . . . . . . . . . . 117 293 H.3.9. Changes from draft-ietf-emailcore-rfc5321bis-04 294 (2021-10-03) to -05 . . . . . . . . . . . . . . . . . 118 295 H.3.10. Changes from draft-ietf-emailcore-rfc5321bis-05 296 (2021-10-24) to -06 . . . . . . . . . . . . . . . . . 119 297 H.3.11. Changes from draft-ietf-emailcore-rfc5321bis-06 298 (2021-11-07) to -07 . . . . . . . . . . . . . . . . . 119 299 H.3.12. Changes from draft-ietf-emailcore-rfc5321bis-07 300 (2021-12-04) to -08 . . . . . . . . . . . . . . . . . 120 301 H.3.13. Changes from draft-ietf-emailcore-rfc5321bis-08 302 (2021-12-31) to -09 . . . . . . . . . . . . . . . . . 121 303 H.3.14. Changes from draft-ietf-emailcore-rfc5321bis-09 304 (2022-02-01 to -10 . . . . . . . . . . . . . . . . . 122 305 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123 306 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 125 308 1. Introduction 310 1.1. Transport of Electronic Mail 312 The objective of the Simple Mail Transfer Protocol (SMTP) is to 313 transfer mail reliably and efficiently. 315 SMTP is independent of the particular transmission subsystem and 316 requires only a reliable ordered data stream channel. While this 317 document specifically discusses transport over TCP, other transports 318 are possible. Appendices to RFC 821 [3] describe some of them. 320 An important feature of SMTP is its capability to transport mail 321 across multiple networks, usually referred to as "SMTP mail relaying" 322 (see Section 3.6). A network consists of the mutually-TCP-accessible 323 hosts on the public Internet, the mutually-TCP-accessible hosts on a 324 firewall-isolated TCP/IP Intranet, or hosts in some other LAN or WAN 325 environment utilizing a non-TCP transport-level protocol. Using 326 SMTP, a process can transfer mail to another process on the same 327 network or to some other network via a relay or gateway process 328 accessible to both networks. 330 In this way, a mail message may pass through a number of intermediate 331 relay or gateway hosts on its path from sender to ultimate recipient. 332 The Mail eXchanger mechanisms of the domain name system (RFC 1035 333 [4], RFC 974 [16], and Section 5 of this document) are used to 334 identify the appropriate next-hop destination for a message being 335 transported. 337 1.2. History and Context for This Document 339 This document is a specification of the basic protocol for the 340 Internet electronic mail transport. It consolidates, updates and 341 clarifies, but does not add new or change existing functionality of 342 the following: 344 * the original SMTP (Simple Mail Transfer Protocol) specification of 345 RFC 821 [3], 347 * domain name system requirements and implications for mail 348 transport from RFC 1035 [4] and RFC 974 [16], 350 * the clarifications and applicability statements in RFC 1123 [5], 352 * the new error codes added by RFC 1846 [20] and later by RFC 7504 353 [45], obsoleting both of those documents, and 355 * material drawn from the SMTP Extension mechanisms in RFC 1869 356 [22]. 358 It also includes editorial and clarification changes that were made 359 to RFC 2821 [30] to bring that specification to Draft Standard and 360 similar changes to RFC 5321 [47] to bring the current document to 361 Internet Standard. 363 It may help the reader to understand that, to reduce the risk of 364 introducing errors, large parts of the document essentially merge the 365 earlier specifications listed in the bullet points above rather than 366 providing a completely rewritten, reorganized, and integrated 367 description of SMTP. An index is provided to assist in the quest for 368 information. 370 It obsoletes RFCs 5321 [47] (the earlier version of this 371 specification), 1846 [20] and incorporates the substance of 7504 372 [45]7504 (specification of reply codes), and 7505 [46] (the "Null MX" 373 specification). 375 // JcK: 202107219: does the text that follows need rewriting? See 376 // comment in Abstract. 377 Although SMTP was designed as a mail transport and delivery protocol, 378 this specification also contains information that is important to its 379 use as a "mail submission" protocol, as recommended for Post Office 380 Protocol (POP) (RFC 937 [14], RFC 1939 [23]) and IMAP (RFC 3501 381 [36]). In general, the separate mail submission protocol specified 382 in RFC 6409 [41] is now preferred to direct use of SMTP; more 383 discussion of that subject appears in that document. 385 Section 2.3 provides definitions of terms specific to this document. 386 Except when the historical terminology is necessary for clarity, this 387 document uses the current 'client' and 'server' terminology to 388 identify the sending and receiving SMTP processes, respectively. 390 A companion document, RFC 5322 [12], discusses message header 391 sections and bodies and specifies formats and structures for them. 392 Other relevant documents and their relationships are discussed in a 393 forthcoming Applicability Statement [48]. 395 1.3. Document Conventions 397 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 398 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 399 document are to be interpreted as described in RFC 2119 [1]. As each 400 of these terms was intentionally and carefully chosen to improve the 401 interoperability of email, each use of these terms is to be treated 402 as a conformance requirement. 404 Because this document has a long history and to avoid the risk of 405 various errors and of confusing readers and documents that point to 406 this one, most examples and the domain names they contain are 407 preserved from RFC 2821. Readers are cautioned that these are 408 illustrative examples that should not actually be used in either code 409 or configuration files. 411 2. The SMTP Model 413 2.1. Basic Structure 415 The SMTP design can be pictured as: 417 +----------+ +----------+ 418 +------+ | | | | 419 | User |<-->| | SMTP | | 420 +------+ | Client- |Commands/Replies| Server- | 421 +------+ | SMTP |<-------------->| SMTP | +------+ 422 | File |<-->| | and Mail | |<-->| File | 423 |System| | | | | |System| 424 +------+ +----------+ +----------+ +------+ 425 SMTP client SMTP server 427 When an SMTP client has a message to transmit, it establishes a two- 428 way transmission channel to an SMTP server. The responsibility of an 429 SMTP client is to transfer mail messages to one or more SMTP servers, 430 or report its failure to do so. 432 The means by which a mail message is presented to an SMTP client, and 433 how that client determines the identifier(s) ("names") of the 434 domain(s) to which mail messages are to be transferred, are local 435 matters. They are not addressed by this document. In some cases, 436 the designated domain(s), or those determined by an SMTP client, will 437 identify the final destination(s) of the mail message. In other 438 cases, common with SMTP clients associated with implementations of 439 the POP (RFC 937 [14], RFC 1939 [23]) or IMAP (RFC 3501 [36]) 440 protocols, or when the SMTP client is inside an isolated transport 441 service environment, the domain determined will identify an 442 intermediate destination through which all mail messages are to be 443 relayed. SMTP clients that transfer all traffic regardless of the 444 target domains associated with the individual messages, or that do 445 not maintain queues for retrying message transmissions that initially 446 cannot be completed, may otherwise conform to this specification but 447 are not considered fully-capable. Fully-capable SMTP 448 implementations, including the relays used by these less capable 449 ones, and their destinations, are expected to support all of the 450 queuing, retrying, and alternate address functions discussed in this 451 specification. In many situations and configurations, the less- 452 capable clients discussed above SHOULD be using the message 453 submission protocol (RFC 6409 [41]) rather than SMTP. 455 The means by which an SMTP client, once it has determined a target 456 domain, determines the identity of an SMTP server to which a copy of 457 a message is to be transferred, and then performs that transfer, are 458 covered by this document. To effect a mail transfer to an SMTP 459 server, an SMTP client establishes a two-way transmission channel to 460 that SMTP server. An SMTP client determines the address of an 461 appropriate host running an SMTP server by resolving a destination 462 domain name to either an intermediate Mail eXchanger host or a final 463 target host. 465 An SMTP server may be either the ultimate destination or an 466 intermediate "relay" (that is, it may assume the role of an SMTP 467 client after receiving the message) or "gateway" (that is, it may 468 transport the message further using some protocol other than SMTP). 469 SMTP commands are generated by the SMTP client and sent to the SMTP 470 server. SMTP replies are sent from the SMTP server to the SMTP 471 client in response to the commands. 473 In other words, message transfer can occur in a single connection 474 between the original SMTP-sender and the final SMTP-recipient, or can 475 occur in a series of hops through intermediary systems. In either 476 case, once the server has issued a success response at the end of the 477 mail data, a formal handoff of responsibility for the message occurs: 478 the protocol requires that a server MUST accept responsibility for 479 either delivering the message or properly reporting the failure to do 480 so (see Sections 6.1, 6.2, and 7.8, below). 482 Once the transmission channel is established and initial handshaking 483 is completed, the SMTP client normally initiates a mail transaction. 484 Such a transaction consists of a series of commands to specify the 485 originator and destination of the mail and transmission of the 486 message content (including any lines in the header section or other 487 structure) itself. When the same message is sent to multiple 488 recipients, this protocol encourages the transmission of only one 489 copy of the data for all recipients at the same destination (or 490 intermediate relay) host. 492 The server responds to each command with a reply; replies may 493 indicate that the command was accepted, that additional commands are 494 expected, or that a temporary or permanent error condition exists. 495 Commands specifying the sender or recipients may include server- 496 permitted SMTP service extension requests, as discussed in 497 Section 2.2. The dialog is purposely lock-step, one-at-a-time, 498 although this can be modified by mutually agreed upon extension 499 requests such as command pipelining (RFC 2920 [31]). 501 Once a given mail message has been transmitted, the client may either 502 request that the connection be shut down or may initiate other mail 503 transactions. In addition, an SMTP client may use a connection to an 504 SMTP server for ancillary services such as verification of email 505 addresses or retrieval of mailing list subscriber addresses. 507 As suggested above, this protocol provides mechanisms for the 508 transmission of mail. Historically, this transmission normally 509 occurred directly from the sending user's host to the receiving 510 user's host when the two hosts are connected to the same transport 511 service. When they are not connected to the same transport service, 512 transmission occurs via one or more relay SMTP servers. A very 513 common case in the Internet today involves submission of the original 514 message to an intermediate, "message submission" server, which is 515 similar to a relay but has some additional properties; such servers 516 are discussed in Section 2.3.10 and at some length in RFC 6409 [41]. 517 An intermediate host that acts as either an SMTP relay or as a 518 gateway into some other transmission environment is usually selected 519 through the use of the domain name service (DNS) Mail eXchanger 520 mechanism. 522 2.2. The Extension Model 524 2.2.1. Background 526 In an effort that started in 1990, approximately a decade after RFC 527 821 was completed, the protocol was modified with a "service 528 extensions" model that permits the client and server to agree to 529 utilize shared functionality beyond the original SMTP requirements. 530 The SMTP extension mechanism defines a means whereby an extended SMTP 531 client and server may recognize each other, and the server can inform 532 the client as to the service extensions that it supports. 534 Contemporary SMTP implementations MUST support the basic extension 535 mechanisms. For instance, servers MUST support the EHLO command even 536 if they do not implement any specific extensions and clients SHOULD 537 preferentially utilize EHLO rather than HELO. (However, for 538 compatibility with older conforming implementations, SMTP clients and 539 servers MUST support the original HELO mechanisms as a fallback.) 540 Unless the different characteristics of HELO must be identified for 541 interoperability purposes, this document discusses only EHLO. 543 SMTP is widely deployed and high-quality implementations have proven 544 to be very robust. However, the Internet community now considers 545 some services to be important that were not anticipated when the 546 protocol was first designed. If support for those services is to be 547 added, it must be done in a way that permits older implementations to 548 continue working acceptably. The extension framework consists of: 550 * The SMTP command EHLO, superseding the earlier HELO, 552 * a registry of SMTP service extensions, 554 * additional parameters to the SMTP MAIL and RCPT commands, and 556 * optional replacements for commands defined in this protocol, such 557 as for DATA in non-ASCII transmissions (RFC 3030 [33]). 559 SMTP's strength comes primarily from its simplicity. Experience with 560 many protocols has shown that protocols with few options tend towards 561 ubiquity, whereas protocols with many options tend towards obscurity. 563 Each and every extension, regardless of its benefits, must be 564 carefully scrutinized with respect to its implementation, deployment, 565 and interoperability costs. In many cases, the cost of extending the 566 SMTP service will likely outweigh the benefit. 568 2.2.2. Definition and Registration of Extensions 570 The IANA maintains a registry of SMTP service extensions [52]. A 571 corresponding EHLO keyword value is associated with each extension. 572 Each service extension registered with the IANA must be defined in a 573 formal Standards-Track or IESG-approved Experimental protocol 574 document. The definition must include: 576 * the textual name of the SMTP service extension; 578 * the EHLO keyword value associated with the extension; 580 * the syntax and possible values of parameters associated with the 581 EHLO keyword value; 583 * any additional SMTP verbs associated with the extension 584 (additional verbs will usually be, but are not required to be, the 585 same as the EHLO keyword value); 587 * any new parameters the extension associates with the MAIL or RCPT 588 verbs; 590 * a description of how support for the extension affects the 591 behavior of a server and client SMTP; and 593 * the increment by which the extension is increasing the maximum 594 length of the commands MAIL and/or RCPT, over that specified in 595 this Standard. 597 Any keyword value presented in the EHLO response MUST correspond to a 598 Standard, Standards-Track, or IESG-approved Experimental SMTP service 599 extension registered with IANA. A conforming server MUST NOT offer 600 keyword values that are not described in a registered extension. 602 2.2.3. Special Issues with Extensions 604 Extensions that change fairly basic properties of SMTP operation are 605 permitted. The text in other sections of this document must be 606 understood in that context. In particular, extensions can change the 607 minimum limits specified in Section 4.5.3, can change the ASCII 608 character set requirement as mentioned above, or can introduce some 609 optional modes of message handling. 611 In particular, if an extension implies that the delivery path 612 normally supports special features of that extension, and an 613 intermediate SMTP system finds a next hop that does not support the 614 required extension, it MAY choose, based on the specific extension 615 and circumstances, to requeue the message and try later and/or try an 616 alternate MX host. If this strategy is employed, the timeout to fall 617 back to an unextended format (if one is available) SHOULD be less 618 than the normal timeout for bouncing as undeliverable (e.g., if 619 normal timeout is three days, the requeue timeout before attempting 620 to transmit the mail without the extension might be one day). 622 2.3. SMTP Terminology 624 2.3.1. Mail Objects 626 SMTP transports a mail object. A mail object contains an envelope 627 and content. 629 The SMTP envelope is sent as a series of SMTP protocol units 630 (described in Section 3). It consists of an originator address (to 631 which error reports should be directed), one or more recipient 632 addresses, and optional protocol extension material. Historically, 633 variations on the reverse-path (originator) address specification 634 command (MAIL) could be used to specify alternate delivery modes, 635 such as immediate display; those variations have now been deprecated 636 (see Appendix F and Appendix F.6). 638 The SMTP content is sent in the SMTP DATA protocol unit and has two 639 parts: the header section and the body. If the content conforms to 640 other contemporary standards, the header section consists of a 641 collection of header fields, each consisting of a header name, a 642 colon, and data, structured as in the message format specification 643 (RFC 5322 [12]); the body, if structured, is defined according to 644 MIME (RFC 2045 [25]). The content is textual in nature, expressed 645 using the US-ASCII repertoire [2]. Although SMTP extensions (such as 646 "8BITMIME", RFC 6152 [44]) may relax this restriction for the content 647 body, the content header fields are always encoded using the US-ASCII 648 repertoire. Two MIME extensions (RFC 2047 [26] and RFC 2231 [29]) 649 define an algorithm for representing header values outside the US- 650 ASCII repertoire, while still encoding them using the US-ASCII 651 repertoire. 653 2.3.2. Senders and Receivers 655 In RFC 821, the two hosts participating in an SMTP transaction were 656 described as the "SMTP-sender" and "SMTP-receiver". This document 657 has been changed to reflect current industry terminology and hence 658 refers to them as the "SMTP client" (or sometimes just "the client") 659 and "SMTP server" (or just "the server"), respectively. Since a 660 given host may act both as server and client in a relay situation, 661 "receiver" and "sender" terminology is still used where needed for 662 clarity. 664 2.3.3. Mail Agents and Message Stores 666 Additional mail system terminology became common after RFC 821 was 667 published and, where convenient, is used in this specification. In 668 particular, SMTP servers and clients provide a mail transport service 669 and therefore act as "Mail Transfer Agents" (MTAs). "Mail User 670 Agents" (MUAs or UAs) are normally thought of as the sources and 671 targets of mail. At the source, an MUA might collect mail to be 672 transmitted from a user and hand it off to an MTA or, more commonly 673 in recent years, a specialized variation on an MTA called a 674 "Submission Server" (MSA) [41]. . At the other end of the process, 675 the final ("delivery") MTA would be thought of as handing the mail 676 off to an MUA (or at least transferring responsibility to it, e.g., 677 by depositing the message in a "message store"). However, while 678 these terms are used with at least the appearance of great precision 679 in other environments, the implied boundaries between MUAs and MTAs 680 often do not accurately match common, and conforming, practices with 681 Internet mail. Hence, the reader should be cautious about inferring 682 the strong relationships and responsibilities that might be implied 683 if these terms were used elsewhere 685 2.3.4. Host 687 For the purposes of this specification, a host is a computer system 688 attached to the Internet (or, in some cases, to a private TCP/IP 689 network) and supporting the SMTP protocol. Hosts are known by names 690 (see the next section); they SHOULD NOT be identified by numerical 691 addresses, i.e., by address literals as described in Section 4.1.2. 693 2.3.5. Domain Names 695 A domain name (or often just a "domain") consists of one or more 696 components, separated by dots if more than one appears. In the case 697 of a top-level domain used by itself in an email address, a single 698 string is used without any dots. This makes the requirement, 699 described in more detail below, that only fully-qualified domain 700 names appear in SMTP transactions on the public Internet, 701 particularly important where top-level domains are involved. These 702 components ("labels" in the DNS terminology of RFC 1035 [4]) are 703 restricted for purposes of SMTP as defined here to consist of a 704 sequence of letters, digits, and hyphens drawn from the ASCII 705 character set [2] and conforming to what RFC 1035 Section 2.3.1 calls 706 the "preferred name syntax". Domain names are used as names of hosts 707 and, except where additionally restricted in this document, of other 708 entities in the domain name hierarchy. For example, a domain may 709 refer to a host alias (label of a CNAME RR) or the label of Mail 710 eXchanger records to be used to deliver mail instead of representing 711 a host name. See RFC 1035 and Section 5 of this specification. 713 The domain name, as described in this document and in RFC 1035 [4], 714 MUST be the entire, fully-qualified name (often referred to as an 715 "FQDN"). Other than an address literal (see Section 4.1.3) where 716 those are permitted, any string that is not a domain name in FQDN 717 form is no more than a reference to be interpreted locally. Such 718 local references for domain names MUST NOT appear in any SMTP 719 transaction (Cf. Section 5). Mechanisms for inferring FQDNs from 720 local references (including partial names or local aliases) are 721 outside of this specification and normally the province of message 722 submission. Due to a history of problems, SMTP servers SHOULD NOT 723 make such inferences (Message Submission Servers [41] have somewhat 724 more flexibility) and intermediate (relay) SMTP servers MUST NOT make 725 them. 727 When domain names are used in SMTP, and unless further restricted in 728 this document, names that can be resolved to MX RRs or address (i.e., 729 A or AAAA) RRs (as discussed in Section 5) are permitted, as are 730 CNAME RRs whose targets can be resolved, in turn, to MX or address 731 RRs. There are two exceptions to the rule requiring FQDNs: 733 * The domain name given in the EHLO command MUST be either a primary 734 host name (a domain name that resolves to an address RR) or, if 735 the host has no name, an address literal, as described in 736 Section 4.1.3 and discussed further in the EHLO discussion of 737 Section 4.1.4. 739 * The reserved mailbox name "postmaster" MAY be used in a RCPT 740 command without domain qualification (see Section 4.1.1.3) and 741 MUST be accepted if so used. 743 2.3.6. Buffer and State Table 745 SMTP sessions are stateful, with both parties carefully maintaining a 746 common view of the current state. In this document, we model this 747 state by a virtual "buffer" and a "state table" on the server that 748 may be used by the client to, for example, "clear the buffer" or 749 "reset the state table", causing the information in the buffer to be 750 discarded and the state to be returned to some previous state. 752 2.3.7. Commands and Replies 754 SMTP commands and, unless altered by a service extension, message 755 data, are transmitted from the sender to the receiver via the 756 transmission channel in "lines". 758 An SMTP reply is an acknowledgment (positive or negative) sent in 759 "lines" from receiver to sender via the transmission channel in 760 response to a command. The general form of a reply is a numeric 761 completion code (indicating failure or success) usually followed by a 762 text string. The codes are for use by programs and the text is 763 usually intended for human users. RFC 3463 [7], specifies further 764 structuring of the reply strings, including the use of supplemental 765 and more specific completion codes (see also RFC 5248 [43]). 767 2.3.8. Lines 769 Lines consist of zero or more data characters terminated by the 770 sequence ASCII character "CR" (hex value 0D) followed immediately by 771 ASCII character "LF" (hex value 0A). This termination sequence is 772 denoted as in this document. Conforming implementations MUST 773 NOT recognize or generate any other character or character sequence 774 as a line terminator. Limits MAY be imposed on line lengths by 775 servers (see Section 4). 777 In addition, the appearance of "bare" "CR" or "LF" characters in text 778 (i.e., either without the other) has a long history of causing 779 problems in mail implementations and applications that use the mail 780 system as a tool. SMTP client implementations MUST NOT transmit 781 these characters except when they are intended as line terminators 782 and then MUST, as indicated above, transmit them only as a 783 sequence. 785 2.3.9. Message Content and Mail Data 787 The terms "message content" and "mail data" are used interchangeably 788 in this document to describe the material transmitted after the DATA 789 command is accepted and before the end of data indication is 790 transmitted. Message content includes the message header section and 791 the possibly structured message body. In the absence of extensions, 792 both are required to be ASCII (see Section 2.3.1). The MIME 793 specification (RFC 2045 [25]) provides the standard mechanisms for 794 structured message bodies. 796 2.3.10. Originator, Delivery, Relay, and Gateway Systems 798 This specification makes a distinction among four types of SMTP 799 systems, based on the role those systems play in transmitting 800 electronic mail. An "originating" system (sometimes called an SMTP 801 originator) introduces mail into the Internet or, more generally, 802 into a transport service environment. A "delivery" SMTP system is 803 one that receives mail from a transport service environment and 804 passes it to a mail user agent or deposits it in a message store that 805 a mail user agent is expected to subsequently access. A "relay" SMTP 806 system (usually referred to just as a "relay") receives mail from an 807 SMTP client and transmits it, without modification to the message 808 data other than adding trace information (see Section 4.4), to 809 another SMTP server for further relaying or for delivery. 811 A "gateway" SMTP system (usually referred to just as a "gateway") 812 receives mail from a client system in one transport environment and 813 transmits it to a server system in another transport environment. 814 Differences in protocols or message semantics between the transport 815 environments on either side of a gateway may require that the gateway 816 system perform transformations to the message that are not permitted 817 to SMTP relay systems. For the purposes of this specification, 818 firewalls that rewrite addresses should be considered as gateways, 819 even if SMTP is used on both sides of them (see RFC 2979 [32]). 821 2.3.11. Mailbox and Address 823 As used in this specification, an "address" is a character string 824 that identifies a user to whom mail will be sent or a location into 825 which mail will be deposited. The term "mailbox" refers to that 826 depository. The two terms are typically used interchangeably unless 827 the distinction between the location in which mail is placed (the 828 mailbox) and a reference to it (the address) is important. An 829 address normally consists of user and domain specifications. The 830 standard mailbox naming convention is defined to be "local- 831 part@domain"; contemporary usage permits a much broader set of 832 applications than simple "user names". Consequently, and due to a 833 long history of problems when intermediate hosts have attempted to 834 optimize transport by modifying them, the local-part MUST be 835 interpreted and assigned semantics only by the host specified in the 836 domain part of the address. 838 2.4. General Syntax Principles and Transaction Model 840 SMTP commands and replies have a rigid syntax. All commands begin 841 with a command verb. All replies begin with a three digit numeric 842 code. In some commands and replies, arguments are required following 843 the verb or reply code. Some commands do not accept arguments (after 844 the verb), and some reply codes are followed, sometimes optionally, 845 by free form text. In both cases, where text appears, it is 846 separated from the verb or reply code by a space character. Complete 847 definitions of commands and replies appear in Section 4. 849 Verbs and argument values (e.g., "TO:" or "to:" in the RCPT command 850 and extension name keywords) are not case sensitive, with the sole 851 exception in this specification of a mailbox local-part (SMTP 852 Extensions may explicitly specify case-sensitive elements). That is, 853 a command verb, an argument value other than a mailbox local-part, 854 and free form text MAY be encoded in upper case, lower case, or any 855 mixture of upper and lower case with no impact on its meaning. The 856 local-part of a mailbox MUST BE treated as case sensitive. 858 Therefore, SMTP implementations MUST take care to preserve the case 859 of mailbox local-parts. In particular, for some hosts, the user 860 "smith" is different from the user "Smith". However, exploiting the 861 case sensitivity of mailbox local-parts impedes interoperability and 862 is discouraged. Mailbox domains follow normal DNS rules and are 863 hence not case sensitive. 865 A few SMTP servers, in violation of this specification (and RFC 821) 866 may require that command verbs be encoded by clients in upper case. 867 Implementations MAY wish to employ this encoding to accommodate those 868 servers. 870 The argument clause consists of a variable-length character string 871 ending with the end of the line, i.e., with the character sequence 872 . The receiver will take no action until this sequence is 873 received. 875 The syntax for each command is shown with the discussion of that 876 command. Common elements and parameters are shown in Section 4.1.2. 878 Commands and replies are composed of characters from the ASCII 879 character set [2]. When the transport service provides an 8-bit byte 880 (octet) transmission channel, each 7-bit character is transmitted, 881 right justified, in an octet with the high-order bit cleared to zero. 882 More specifically, the unextended SMTP service provides 7-bit 883 transport only. An originating SMTP client that has not successfully 884 negotiated an appropriate extension with a particular server (see the 885 next paragraph) MUST NOT transmit messages with information in the 886 high-order bit of octets. If such messages are transmitted in 887 violation of this rule, receiving SMTP servers MAY clear the high- 888 order bit or reject the message as invalid. In general, a relay SMTP 889 SHOULD assume that the message content it has received is valid and, 890 assuming that the envelope permits doing so, relay it without 891 inspecting that content. Of course, if the content is mislabeled and 892 the data path cannot accept the actual content, this may result in 893 the ultimate delivery of a severely garbled message to the recipient. 894 Delivery SMTP systems MAY reject such messages, or return them as 895 undeliverable, rather than deliver them. In the absence of a server- 896 offered extension explicitly permitting it, a sending SMTP system is 897 not permitted to send envelope commands in any character set other 898 than US-ASCII. Receiving systems SHOULD reject such commands, 899 normally using "500 syntax error - invalid character" replies. 901 8-bit message content transmission MAY be requested of the server by 902 a client using extended SMTP facilities, notably the "8BITMIME" 903 extension, RFC 6152 [44]. 8BITMIME SHOULD be supported by SMTP 904 servers. However, it MUST NOT be construed as authorization to 905 transmit unrestricted 8-bit material, nor does 8BITMIME authorize 906 transmission of any envelope material in other than ASCII. 8BITMIME 907 MUST NOT be requested by senders for material with the high bit on 908 that is not in MIME format with an appropriate content-transfer 909 encoding; servers MAY reject such messages. 911 The metalinguistic notation used in this document corresponds to the 912 "Augmented BNF" used in other Internet mail system documents. The 913 reader who is not familiar with that syntax should consult the ABNF 914 specification in RFC 5234 [11]. Metalanguage terms used in running 915 text are surrounded by pointed brackets (e.g., ) for clarity. 916 The reader is cautioned that the grammar expressed in the 917 metalanguage is not comprehensive. There are many instances in which 918 provisions in the text constrain or otherwise modify the syntax or 919 semantics implied by the grammar. 921 3. The SMTP Procedures: An Overview 923 This section contains descriptions of the procedures used in SMTP: 924 session initiation, mail transaction, forwarding mail, verifying 925 mailbox names and expanding mailing lists, and opening and closing 926 exchanges. Comments on relaying, a note on mail domains, and a 927 discussion of changing roles are included at the end of this section. 928 Several complete scenarios are presented in Appendix D. 930 3.1. Session Initiation 932 An SMTP session is initiated when a client opens a connection to a 933 server and the server responds with an opening message. 935 SMTP server implementations MAY include identification of their 936 software and version information in the connection greeting reply 937 after the 220 code, a practice that permits more efficient isolation 938 and repair of any problems. Implementations MAY make provision for 939 SMTP servers to disable the software and version announcement where 940 it causes security concerns. While some systems also identify their 941 contact point for mail problems, this is not a substitute for 942 maintaining the required "postmaster" address (see Section 4). 944 The SMTP protocol allows a server to formally reject a mail session 945 while still allowing the initial connection as follows: a 521 946 response MAY be given in the initial connection opening message 947 instead of the 220. A server taking this approach MUST still wait 948 for the client to send a QUIT (see Section 4.1.1.10) before closing 949 the connection and SHOULD respond to any intervening commands with 950 "503 bad sequence of commands". Since an attempt to make an SMTP 951 connection to such a system is probably in error, a server returning 952 a 521 953 // (or 554?) 954 response on connection opening SHOULD provide enough information in 955 the reply text to facilitate debugging of the sending system. See 956 Section 4.2.4.2. 958 3.2. Client Initiation 960 Once the server has sent the greeting (welcoming) message and the 961 client has received it, the client normally sends the EHLO command to 962 the server, indicating the client's identity. In addition to opening 963 the session, use of EHLO indicates that the client is able to process 964 service extensions and requests that the server provide a list of the 965 extensions it supports. Older SMTP systems that are unable to 966 support service extensions, and contemporary clients that do not 967 require service extensions in the mail session being initiated, MAY 968 use HELO instead of EHLO. Servers MUST NOT return the extended EHLO- 969 style response to a HELO command. For a particular connection 970 attempt, if the server returns a "command not recognized" response to 971 EHLO, the client SHOULD be able to fall back and send HELO. 973 In the EHLO command, the host sending the command identifies itself; 974 the command may be interpreted as saying "Hello, I am " (and, 975 in the case of EHLO, "and I support service extension requests"). 977 3.3. Mail Transactions 979 There are three steps to SMTP mail transactions. The transaction 980 starts with a MAIL command that gives the sender identification. (In 981 general, the MAIL command may be sent only when no mail transaction 982 is in progress; see Section 4.1.4.) A series of one or more RCPT 983 commands follows, giving the receiver information. Then, a DATA 984 command initiates transfer of the mail data and is terminated by the 985 "end of mail" data indicator, which also confirms (and terminates) 986 the transaction. 988 Mail transactions are also terminated by the RSET command 989 (Section 4.1.1.5), the sending of an EHLO command (Section 3.2), or 990 the sending of a QUIT command (Section 3.8) which terminates both any 991 active mail transaction and the SMTP connection. 993 The first step in the procedure is the MAIL command. 995 MAIL FROM: [SP ] 997 This command tells the SMTP-receiver that a new mail transaction is 998 starting and to reset all its state tables and buffers, including any 999 recipients or mail data. The portion of the first or 1000 only argument contains the source mailbox (between "<" and ">" 1001 brackets), which can be used to report errors (see Section 4.2 for a 1002 discussion of error reporting). If accepted, the SMTP server returns 1003 a "250 OK" reply. If the mailbox specification is not acceptable for 1004 some reason, the server MUST return a reply indicating whether the 1005 failure is permanent (i.e., will occur again if the client tries to 1006 send the same address again) or temporary (i.e., the address might be 1007 accepted if the client tries again later). Despite the apparent 1008 scope of this requirement, there are circumstances in which the 1009 acceptability of the reverse-path may not be determined until one or 1010 more forward-paths (in RCPT commands) can be examined. In those 1011 cases, the server MAY reasonably accept the reverse-path (with a 250 1012 reply) and then report problems after the forward-paths are received 1013 and examined. Normally, failures produce 550 or 553 replies. 1015 Historically, the was permitted to contain more than 1016 just a mailbox; however source routing is now deprecated (see 1017 Appendix F.2). 1019 The optional are associated with negotiated SMTP 1020 service extensions (see Section 2.2). 1022 The second step in the procedure is the RCPT command. This step of 1023 the procedure can be repeated any number of times. 1025 RCPT TO: [ SP ] 1027 The first or only argument to this command includes a forward-path 1028 (normally a mailbox local-part and domain, always surrounded by "<" 1029 and ">" brackets) identifying one recipient. If accepted, the SMTP 1030 server returns a "250 OK" reply and stores the forward-path. If the 1031 recipient is known not to be a deliverable address, the SMTP server 1032 returns a 550 reply, typically with a string such as "no such user - 1033 " and the mailbox name (other circumstances and reply codes are 1034 possible). 1036 Historically, the was permitted to contain a source 1037 routing list of hosts and the destination mailbox; however, source 1038 routes are now deprecated (see Appendix F.2). Restricted-capability 1039 clients MUST NOT assume that any SMTP server on the Internet can be 1040 used as their mail processing (relaying) site. If a RCPT command 1041 appears without a previous MAIL command, the server MUST return a 503 1042 "Bad sequence of commands" response. The optional 1043 are associated with negotiated SMTP service extensions (see 1044 Section 2.2). 1045 // [5321bis]: this section would be improved by being more specific 1046 // about where mail transactions begin and end and then talking about 1047 // "transaction state" here, rather than specific prior commands. 1048 // --JcK 1049 Since it has been a common source of errors, it is worth noting that 1050 spaces are not permitted on either side of the colon following FROM 1051 in the MAIL command or TO in the RCPT command. The syntax is exactly 1052 as given above. 1054 The third step in the procedure is the DATA command (or some 1055 alternative specified in a service extension). 1057 DATA 1059 If accepted, the SMTP server returns a 354 Intermediate reply and 1060 considers all succeeding lines up to but not including the end of 1061 mail data indicator to be the message text. When the end of text is 1062 successfully received and stored, the SMTP-receiver sends a "250 OK" 1063 reply. 1065 Since the mail data is sent on the transmission channel, the end of 1066 mail data must be indicated so that the command and reply dialog can 1067 be resumed. SMTP indicates the end of the mail data by sending a 1068 line containing only a "." (period or full stop, hex 2E). A 1069 transparency procedure is used to prevent this from interfering with 1070 the user's text (see Section 4.5.2). 1072 The end of mail data indicator also confirms the mail transaction and 1073 tells the SMTP server to now process the stored recipients and mail 1074 data. If accepted, the SMTP server returns a "250 OK" reply. The 1075 DATA command can fail at only two points in the protocol exchange: 1077 If there was no MAIL, or no RCPT, command, or all such commands were 1078 rejected, the server MAY return a "command out of sequence" (503) or 1079 "no valid recipients" (554) reply in response to the DATA command. 1080 If one of those replies (or any other 5yz reply) is received, the 1081 client MUST NOT send the message data; more generally, message data 1082 MUST NOT be sent unless a 354 reply is received. 1084 If the verb is initially accepted and the 354 reply issued, the DATA 1085 command should fail only if the mail transaction was incomplete (for 1086 example, no recipients), if resources were unavailable (including, of 1087 course, the server unexpectedly becoming unavailable), or if the 1088 server determines that the message should be rejected for policy or 1089 other reasons. 1091 However, in practice, some servers do not perform recipient 1092 verification until after the message text is received. These servers 1093 SHOULD treat a failure for one or more recipients as a "subsequent 1094 failure" and return a mail message as discussed in Section 6 and, in 1095 particular, in Section 6.1. Using a "550 mailbox not found" (or 1096 equivalent) reply code after the data are accepted makes it difficult 1097 or impossible for the client to determine which recipients failed. 1099 When the RFC 822 format ([13], [12]) is being used, the mail data 1100 include the header fields such as those named Date, Subject, To, Cc, 1101 and From. Server SMTP systems SHOULD NOT reject messages based on 1102 perceived defects in the RFC 822 or MIME (RFC 2045 [25]) message 1103 header section or message body. In particular, they MUST NOT reject 1104 messages in which the numbers of Resent-header fields do not match or 1105 Resent-to appears without Resent-from and/or Resent-date. 1107 Mail transaction commands MUST be used in the order discussed above. 1109 3.4. Address Modification and Expansion 1111 3.4.1. Forwarding for Address Correction or Updating 1113 Forwarding support is most often required to consolidate and simplify 1114 addresses within, or relative to, some enterprise and less frequently 1115 to establish addresses to link a person's prior address with a 1116 current one. Silent forwarding of messages (without server 1117 notification to the sender), for security or non-disclosure purposes, 1118 is common in the contemporary Internet. 1120 In both the enterprise and the "new address" cases, information 1121 hiding (and sometimes security) considerations argue against exposure 1122 of the "final" address through the SMTP protocol as a side effect of 1123 the forwarding activity. This may be especially important when the 1124 final address may not even be reachable by the sender. Consequently, 1125 the "forwarding" mechanisms described in Section 3.2 of RFC 821, and 1126 especially the 251 (corrected destination) and 551 reply codes from 1127 RCPT must be evaluated carefully by implementers and, when they are 1128 available, by those configuring systems (see also Section 7.4). 1130 In particular: 1132 * Servers MAY forward messages when they are aware of an address 1133 change. When they do so, they MAY either provide address-updating 1134 information with a 251 code, or may forward "silently" and return 1135 a 250 code. However, if a 251 code is used, they MUST NOT assume 1136 that the client will actually update address information or even 1137 return that information to the user. 1139 Alternately, 1141 * Servers MAY reject messages or return them as non-deliverable when 1142 they cannot be delivered precisely as addressed. When they do so, 1143 they MAY either provide address-updating information with a 551 1144 code, or may reject the message as undeliverable with a 550 code 1145 and no address-specific information. However, if a 551 code is 1146 used, they MUST NOT assume that the client will actually update 1147 address information or even return that information to the user. 1149 SMTP server implementations that support the 251 and/or 551 reply 1150 codes SHOULD provide configuration mechanisms so that sites that 1151 conclude that they would undesirably disclose information can disable 1152 or restrict their use. See Section 7.4 for further discussion of 1153 that issue. 1155 3.4.2. Aliases and Mailing Lists 1157 Many SMTP-capable hosts support address expansion for multiple 1158 delivery via one or both of the alias and the list models. When a 1159 message is delivered or forwarded to each address of an expanded list 1160 form, the return address in the envelope ("MAIL FROM:") MUST be 1161 changed to be the address of a person or other entity who administers 1162 the list. However, in this case, the message header section (RFC 1163 5322 [12]) MUST be left unchanged; in particular, the "From" field of 1164 the header section is unaffected. 1166 // Editor's Note (temporary, 2022-01-21, updated 2022-03-05): 1167 // Discussion during the January 2022 Interim Meeting in January and 1168 // subsequently on the mailing list suggested several options for the 1169 // above sentence (including removal or replacement. Editor awaiting 1170 // consensus and/or clear instructions. 1172 An important mail facility is a mechanism for multi-destination 1173 delivery of a single message, by transforming (or "expanding" or 1174 "exploding") a pseudo-mailbox address into a list of destination 1175 mailbox addresses. When a message is sent to such a pseudo-mailbox 1176 (sometimes called an "exploder"), copies are forwarded or 1177 redistributed to each mailbox in the expanded list. Servers SHOULD 1178 simply utilize the addresses on the list; application of heuristics 1179 or other matching rules to eliminate some addresses, such as that of 1180 the originator, is strongly discouraged. We classify such a pseudo- 1181 mailbox as an "alias" or a "list", depending upon the expansion 1182 rules. 1184 3.4.2.1. Simple Aliases 1186 To expand an alias, the recipient mailer simply replaces the pseudo- 1187 mailbox address in the envelope with each of the expanded addresses 1188 in turn; the rest of the envelope and the message body are left 1189 unchanged. The message is then delivered or forwarded to each 1190 expanded address. 1192 3.4.2.2. Mailing Lists 1194 Processing of a mailing list may be said to operate by 1195 "redistribution" rather than by "forwarding" (as in the simple alias 1196 case in the subsection above). To expand a list, the recipient 1197 mailer replaces the pseudo-mailbox address in the envelope with each 1198 of the expanded addresses in turn. The return (backward-pointing) 1199 address in the envelope is changed so that all error messages 1200 generated by the final deliveries will be returned to a list 1201 administrator, not to the message originator, who generally has no 1202 control over the contents of the list and will typically find error 1203 messages annoying. Note that the key difference between handling 1204 simple aliases Section 3.4.2.1 and redistribution (this subsection) 1205 is the change to the backward-pointing address. When a system 1206 managing a list constrains its processing to the very limited set of 1207 modifications and actions described here, it is acting as part of an 1208 MTA; such list processing, like alias processing, can be treated as a 1209 continuation of email transit. 1211 Mailing list management systems do exist that perform additional, 1212 sometimes extensive, modifications to a message and its envelope. 1213 Such mailing lists need to be viewed as MUAs that accept a message 1214 delivery and then submit a new message for multiple recipients. 1216 3.5. Commands for Debugging Addresses 1218 3.5.1. Overview 1220 SMTP provides commands to verify a user name or obtain the content of 1221 a mailing list. This is done with the VRFY and EXPN commands, which 1222 have character string arguments. Implementations SHOULD support VRFY 1223 and EXPN (however, see Section 3.5.2 and Section 7.3). 1225 For the VRFY command, the string is a user name or a user name and 1226 domain (see below). If a normal (i.e., 250) response is returned, 1227 the response MAY include the full name of the user and MUST include 1228 the mailbox of the user. It MUST be in either of the following 1229 forms: 1231 User Name 1232 local-part@domain 1234 When a name that is the argument to VRFY could identify more than one 1235 mailbox, the server MAY either note the ambiguity or identify the 1236 alternatives. In other words, any of the following are legitimate 1237 responses to VRFY: 1239 553 User ambiguous 1241 or 1243 553- Ambiguous; Possibilities are 1244 553-Joe Smith 1245 553-Harry Smith 1246 553 Melvin Smith 1248 or 1250 553-Ambiguous; Possibilities 1251 553- 1252 553- 1253 553 1255 Under normal circumstances, a client receiving a 553 reply would be 1256 expected to expose the result to the user. Use of exactly the forms 1257 given, and the "user ambiguous" or "ambiguous" keywords, possibly 1258 supplemented by extended reply codes, such as those described in RFC 1259 3463 [7], will facilitate automated translation into other languages 1260 as needed. Of course, a client that was highly automated or that was 1261 operating in another language than English might choose to try to 1262 translate the response to return some other indication to the user 1263 than the literal text of the reply, or to take some automated action 1264 such as consulting a directory service for additional information 1265 before reporting to the user. 1267 For the EXPN command, the string identifies a mailing list, and the 1268 successful (i.e., 250) multiline response MAY include the full name 1269 of the users and MUST give the mailboxes on the mailing list. 1271 In some hosts, the distinction between a mailing list and an alias 1272 for a single mailbox is a bit fuzzy, since a common data structure 1273 may hold both types of entries, and it is possible to have mailing 1274 lists containing only one mailbox. If a request is made to apply 1275 VRFY to a mailing list, a positive response MAY be given if a message 1276 so addressed would be delivered to everyone on the list, otherwise an 1277 error SHOULD be reported (e.g., "550 That is a mailing list, not a 1278 user" or "252 Unable to verify members of mailing list"). If a 1279 request is made to expand a user name, the server MAY return a 1280 positive response consisting of a list containing one name, or an 1281 error MAY be reported (e.g., "550 That is a user name, not a mailing 1282 list"). 1284 In the case of a successful multiline reply (normal for EXPN), 1285 exactly one mailbox is to be specified on each line of the reply. 1286 The case of an ambiguous request is discussed above. 1288 "User name" is a fuzzy term and has been used deliberately. An 1289 implementation of the VRFY or EXPN commands MUST include at least 1290 recognition of local mailboxes as "user names". However, since 1291 current Internet practice often results in a single host handling 1292 mail for multiple domains, hosts, especially hosts that provide this 1293 functionality, SHOULD accept the "local-part@domain" form as a "user 1294 name"; hosts MAY also choose to recognize other strings as "user 1295 names". 1297 The case of expanding a mailbox list requires a multiline reply, such 1298 as: 1300 C: EXPN Example-People 1301 S: 250-Jon Postel 1302 S: 250-Fred Fonebone 1303 S: 250 Sam Q. Smith 1305 or 1307 C: EXPN Executive-Washroom-List 1308 S: 550 Access Denied to You. 1310 The character string arguments of the VRFY and EXPN commands cannot 1311 be further restricted due to the variety of implementations of the 1312 user name and mailbox list concepts. On some systems, it may be 1313 appropriate for the argument of the EXPN command to be a file name 1314 for a file containing a mailing list, but again there are a variety 1315 of file naming conventions in the Internet. Similarly, historical 1316 variations in what is returned by these commands are such that the 1317 response SHOULD be interpreted very carefully, if at all, and SHOULD 1318 generally only be used for diagnostic purposes. 1320 3.5.2. VRFY Normal Response 1322 When normal (2yz or 551) responses are returned from a VRFY or EXPN 1323 request, the reply MUST include the name using a "" construction, where "domain" is a fully-qualified 1325 domain name. In circumstances exceptional enough to justify 1326 violating the intent of this specification, free-form text MAY be 1327 returned. In order to facilitate parsing by both computers and 1328 people, addresses SHOULD appear in pointed brackets. When addresses, 1329 rather than free-form debugging information, are returned, EXPN and 1330 VRFY MUST return only valid domain addresses that are usable in SMTP 1331 RCPT commands. Consequently, if an address implies delivery to a 1332 program or other system, the mailbox name used to reach that target 1333 MUST be given. Paths (explicit source routes) MUST NOT be returned 1334 by VRFY or EXPN. 1336 Server implementations SHOULD support both VRFY and EXPN. For 1337 security reasons, implementations MAY provide local installations a 1338 way to disable either or both of these commands through configuration 1339 options or the equivalent (see Section 7.3). When these commands are 1340 supported, they are not required to work across relays when relaying 1341 is supported. Since they were both optional in RFC 821, but VRFY was 1342 made mandatory in RFC 1123 [5], if EXPN is supported, it MUST be 1343 listed as a service extension in an EHLO response. VRFY MAY be 1344 listed as a convenience but, since support for it is required, SMTP 1345 clients are not required to check for its presence on the extension 1346 list before using it. 1348 3.5.3. Meaning of VRFY or EXPN Success Response 1350 A server MUST NOT return a 250 code in response to a VRFY or EXPN 1351 command unless it has actually verified the address. In particular, 1352 a server MUST NOT return 250 if all it has done is to verify that the 1353 syntax given is valid. In that case, 502 (Command not implemented) 1354 or 500 (Syntax error, command unrecognized) SHOULD be returned. As 1355 stated elsewhere, implementation (in the sense of actually validating 1356 addresses and returning information) of VRFY and EXPN are strongly 1357 recommended. Hence, implementations that return 500 or 502 for VRFY 1358 are not in full compliance with this specification. 1360 There may be circumstances where an address appears to be valid but 1361 cannot reasonably be verified in real time, particularly when a 1362 server is acting as a mail exchanger for another server or domain. 1363 "Apparent validity", in this case, would normally involve at least 1364 syntax checking and might involve verification that any domains 1365 specified were ones to which the host expected to be able to relay 1366 mail. In these situations, reply code 252 SHOULD be returned. These 1367 cases parallel the discussion of RCPT verification in Section 2.1. 1369 Similarly, the discussion in Section 3.4.1 applies to the use of 1370 reply codes 251 and 551 with VRFY (and EXPN) to indicate addresses 1371 that are recognized but that would be forwarded or rejected were mail 1372 received for them. Implementations generally SHOULD be more 1373 aggressive about address verification in the case of VRFY than in the 1374 case of RCPT, even if it takes a little longer to do so. 1376 3.5.4. Semantics and Applications of EXPN 1378 EXPN is often very useful in debugging and understanding problems 1379 with mailing lists and multiple-target-address aliases. Some systems 1380 have attempted to use source expansion of mailing lists as a means of 1381 eliminating duplicates. The propagation of aliasing systems with 1382 mail on the Internet for hosts (typically with MX and CNAME DNS 1383 records), for mailboxes (various types of local host aliases), and in 1384 various proxying arrangements has made it nearly impossible for these 1385 strategies to work consistently, and mail systems SHOULD NOT attempt 1386 them. 1388 3.6. Relaying and Mail Routing 1390 3.6.1. Mail eXchange Records and Relaying 1392 A relay SMTP server is usually the target of a DNS MX record that 1393 designates it, rather than the final delivery system. The relay 1394 server may accept or reject the task of relaying the mail in the same 1395 way it accepts or rejects mail for a local user. If it accepts the 1396 task, it then becomes an SMTP client, establishes a transmission 1397 channel to the next SMTP server specified in the DNS (according to 1398 the rules in Section 5), and sends it the mail. If it declines to 1399 relay mail to a particular address for policy reasons, a 550 response 1400 SHOULD be returned. 1402 This specification does not deal with the verification of return 1403 paths. Server efforts to verify a return path and actions to be 1404 taken under various circumstances are outside the scope of this 1405 specification. 1407 3.6.2. Message Submission Servers as Relays 1409 Many mail-sending clients exist, especially in conjunction with 1410 facilities that receive mail via POP3 or IMAP, that have limited 1411 capability to support some of the requirements of this specification, 1412 such as the ability to queue messages for subsequent delivery 1413 attempts. For these clients, it is common practice to make private 1414 arrangements to send all messages to a single server for processing 1415 and subsequent distribution. SMTP, as specified here, is not ideally 1416 suited for this role. A standardized mail submission protocol has 1417 been developed that is gradually superseding practices based on SMTP 1418 (see RFC 6409 [41]). In any event, because these arrangements are 1419 private and fall outside the scope of this specification, they are 1420 not described here. 1422 It is important to note that MX records can point to SMTP servers 1423 that act as gateways into other environments, not just SMTP relays 1424 and final delivery systems; see Sections 3.7 and 5. 1426 If an SMTP server has accepted the task of relaying the mail and 1427 later finds that the destination is incorrect or that the mail cannot 1428 be delivered for some other reason, then it MUST construct an 1429 "undeliverable mail" notification message and send it to the 1430 originator of the undeliverable mail (as indicated by the reverse- 1431 path). Formats specified for non-delivery reports by other standards 1432 (see, for example, RFC 3461 [34] and RFC 3464 [35]) SHOULD be used if 1433 possible. 1435 This notification message must be from the SMTP server at the relay 1436 host or the host that first determines that delivery cannot be 1437 accomplished. Of course, SMTP servers MUST NOT send notification 1438 messages about problems transporting notification messages. One way 1439 to prevent loops in error reporting is to specify a null reverse-path 1440 in the MAIL command of a notification message. When such a message 1441 is transmitted, the reverse-path MUST be set to null (see 1442 Section 4.5.5 for additional discussion). A MAIL command with a null 1443 reverse-path appears as follows: 1445 MAIL FROM:<> 1447 As discussed in Section 6.4, a relay SMTP has no need to inspect or 1448 act upon the header section or body of the message data and MUST NOT 1449 do so except to add its own "Received:" header field (Section 4.4.1 1450 and possibly other trace header fields) and, optionally, to attempt 1451 to detect looping in the mail system (see Section 6.3). Of course, 1452 this prohibition also applies to any modifications of these header 1453 fields or text (see also Section 7.9). 1455 3.7. Mail Gatewaying 1457 While the relay function discussed above operates within the Internet 1458 SMTP transport service environment, MX records or various forms of 1459 explicit routing may require that an intermediate SMTP server perform 1460 a translation function between one transport service and another. As 1461 discussed in Section 2.3.10, when such a system is at the boundary 1462 between two transport service environments, we refer to it as a 1463 "gateway" or "gateway SMTP". 1465 Gatewaying mail between different mail environments, such as 1466 different mail formats and protocols, is complex and does not easily 1467 yield to standardization. However, some general requirements may be 1468 given for a gateway between the Internet and another mail 1469 environment. 1471 3.7.1. Header Fields in Gatewaying 1473 Header fields MAY be rewritten when necessary as messages are 1474 gatewayed across mail environment boundaries. This may involve 1475 inspecting the message body or interpreting the local-part of the 1476 destination address in spite of the prohibitions in Section 6.4. 1478 Other mail systems gatewayed to the Internet often use a subset of 1479 the RFC 822 header section or provide similar functionality with a 1480 different syntax, but some of these mail systems do not have an 1481 equivalent to the SMTP envelope. Therefore, when a message leaves 1482 the Internet environment, it may be necessary to fold the SMTP 1483 envelope information into the message header section. A possible 1484 solution would be to create new header fields to carry the envelope 1485 information (e.g., "X-SMTP-MAIL:" and "X-SMTP-RCPT:"); however, this 1486 would require changes in mail programs in foreign environments and 1487 might risk disclosure of private information (see Section 7.2). 1489 3.7.2. Received Lines in Gatewaying 1491 When forwarding a message into or out of the Internet environment, a 1492 gateway MUST prepend a Received: line, but it MUST NOT alter in any 1493 way a Received: line that is already in the header section. 1495 "Received:" header fields of messages originating from other 1496 environments may not conform exactly to this specification. However, 1497 the most important use of Received: lines is for debugging mail 1498 faults, and this debugging can be severely hampered by well-meaning 1499 gateways that try to "fix" a Received: line. As another consequence 1500 of trace header fields arising in non-SMTP environments, receiving 1501 systems MUST NOT reject mail based on the format of a trace header 1502 field and SHOULD be extremely robust in the light of unexpected 1503 information or formats in those header fields. 1505 The gateway SHOULD indicate the environment and protocol in the "via" 1506 clauses of Received header field(s) that it supplies. 1508 3.7.3. Addresses in Gatewaying 1510 From the Internet side, the gateway SHOULD accept all valid address 1511 formats in SMTP commands and in the RFC 822 header section, and all 1512 valid RFC 822 messages. Addresses and header fields generated by 1513 gateways MUST conform to applicable standards (including this one and 1514 RFC 5322 [12]). Gateways are, of course, subject to the same rules 1515 for handling source routes as those described for other SMTP systems 1516 in Section 3.3. 1518 3.7.4. Other Header Fields in Gatewaying 1520 The gateway MUST ensure that all header fields of a message that it 1521 forwards into the Internet mail environment meet the requirements for 1522 Internet mail. In particular, all addresses in "From:", "To:", 1523 "Cc:", etc., header fields MUST be transformed (if necessary) to 1524 satisfy the standard header syntax of RFC 5322 [12], MUST reference 1525 only fully-qualified domain names, and MUST be effective and useful 1526 for sending replies. The translation algorithm used to convert mail 1527 from the Internet protocols to another environment's protocol SHOULD 1528 ensure that error messages from the foreign mail environment are 1529 delivered to the reverse-path from the SMTP envelope, not to an 1530 address in the "From:", "Sender:", or similar header fields of the 1531 message. 1533 3.7.5. Envelopes in Gatewaying 1535 Similarly, when forwarding a message from another environment into 1536 the Internet, the gateway SHOULD set the envelope return path in 1537 accordance with an error message return address, if supplied by the 1538 foreign environment. If the foreign environment has no equivalent 1539 concept, the gateway must select and use a best approximation, with 1540 the message originator's address as the default of last resort. 1542 3.8. Terminating Sessions and Connections 1544 An SMTP connection is terminated when the client sends a QUIT 1545 command. The server responds with a positive reply code, after which 1546 it closes the connection. 1548 An SMTP server MUST NOT intentionally close the connection under 1549 normal operational circumstances (see Section 7.8) except: 1551 * After receiving a QUIT command and responding with a 221 reply. 1553 * After detecting the need to shut down the SMTP service and 1554 returning a 421 reply code. This reply code can be issued after 1555 the server receives any command or, if necessary, asynchronously 1556 from command receipt (on the assumption that the client will 1557 receive it after the next command is issued). 1559 * After a timeout, as specified in Section 4.5.3.2, occurs waiting 1560 for the client to send a command or data. 1562 In particular, a server that closes connections in response to 1563 commands that are not understood is in violation of this 1564 specification. Servers are expected to be tolerant of unknown 1565 commands, issuing a 500 reply and awaiting further instructions from 1566 the client. 1568 An SMTP server that is forcibly shut down via external means SHOULD 1569 attempt to send a line containing a 421 reply code to the SMTP client 1570 before exiting. The SMTP client will normally read the 421 reply 1571 code after sending its next command. 1573 SMTP clients that experience a connection close, reset, or other 1574 communications failure due to circumstances not under their control 1575 (in violation of the intent of this specification but sometimes 1576 unavoidable) SHOULD, to maintain the robustness of the mail system, 1577 treat the mail transaction as if a 421 response had been received and 1578 act accordingly. 1580 There are circumstances, contrary to the intent of this 1581 specification, in which an SMTP server may receive an indication that 1582 the underlying TCP connection has been closed or reset. To preserve 1583 the robustness of the mail system, SMTP servers SHOULD be prepared 1584 for this condition and SHOULD treat it as if a QUIT had been received 1585 before the connection disappeared. 1587 4. The SMTP Specifications 1589 4.1. SMTP Commands 1591 4.1.1. Command Semantics and Syntax 1593 The SMTP commands define the mail transfer or the mail system 1594 function requested by the user. SMTP commands are character strings 1595 terminated by . The commands themselves are alphabetic 1596 characters terminated by if parameters follow and 1597 otherwise. (In the interest of improved interoperability, SMTP 1598 receivers SHOULD tolerate trailing white space before the terminating 1599 .) The syntax of the local part of a mailbox MUST conform to 1600 receiver site conventions and the syntax specified in Section 4.1.2. 1602 The SMTP commands are discussed below. The SMTP replies are 1603 discussed in Section 4.2. 1605 A mail transaction involves several data objects that are 1606 communicated as arguments to different commands. The reverse-path is 1607 the argument of the MAIL command, the forward-path is the argument of 1608 the RCPT command, and the mail data is the argument of the DATA 1609 command. These arguments or data objects must be transmitted and 1610 held, pending the confirmation communicated by the end of mail data 1611 indication that finalizes the transaction. The model for this is 1612 that distinct buffers are provided to hold the types of data objects; 1613 that is, there is a reverse-path buffer, a forward-path buffer, and a 1614 mail data buffer. Specific commands cause information to be appended 1615 to a specific buffer, or cause one or more buffers to be cleared. 1617 Several commands (RSET, DATA, QUIT) are specified as not permitting 1618 parameters. In the absence of specific extensions offered by the 1619 server and accepted by the client, clients MUST NOT send such 1620 parameters and servers SHOULD reject commands containing them as 1621 having invalid syntax. 1623 4.1.1.1. Extended HELLO (EHLO) or HELLO (HELO) 1625 These commands are used to identify the SMTP client to the SMTP 1626 server. The argument clause contains the fully-qualified domain name 1627 of the SMTP client, if one is available. In situations in which the 1628 SMTP client system does not have a meaningful domain name (e.g., when 1629 its address is dynamically allocated and no reverse mapping record is 1630 available), the client SHOULD send an address literal (see 1631 Section 4.1.3). Additional discussion of domain names in SMTP 1632 commands appears in Section 2.3.5. 1634 RFC 2821, and some earlier informal practices, encouraged following 1635 the literal by information that would help to identify the client 1636 system. That convention was not widely supported, and many SMTP 1637 servers considered it an error. In the interest of interoperability, 1638 it is probably wise for servers to be prepared for this string to 1639 occur, but SMTP clients SHOULD NOT send it. 1641 The SMTP server identifies itself to the SMTP client in the 1642 connection greeting reply and in the response to this command. 1644 A client SMTP SHOULD start an SMTP session by issuing the EHLO 1645 command. If the SMTP server supports the SMTP service extensions, it 1646 will give a successful response, a failure response, or an error 1647 response. If the SMTP server, in violation of this specification, 1648 does not support any SMTP service extensions, it will generate an 1649 error response. Older client SMTP systems MAY, as discussed above, 1650 use HELO (as specified in RFC 821) instead of EHLO, and servers MUST 1651 support the HELO command and reply properly to it. In any event, a 1652 client MUST issue HELO or EHLO before starting a mail transaction. 1654 These commands, and a "250 OK" reply to one of them, confirm that 1655 both the SMTP client and the SMTP server are in the initial state, 1656 that is, there is no transaction in progress and all state tables and 1657 buffers are cleared. 1659 Syntax: 1661 ehlo = "EHLO" SP ( Domain / address-literal ) CRLF 1663 helo = "HELO" SP Domain CRLF 1665 Normally, the response to EHLO will be a multiline reply. Each line 1666 of the response contains a keyword and, optionally, one or more 1667 parameters. Following the normal syntax for multiline replies, these 1668 keywords follow the code (250) and a hyphen for all but the last 1669 line, and the code and a space for the last line. The syntax for a 1670 positive response, using the ABNF notation and terminal symbols of 1671 RFC 5234 [11], is: 1673 ehlo-ok-rsp = ( "250" SP Domain [ SP ehlo-greet ] CRLF ) 1674 / ( "250-" Domain [ SP ehlo-greet ] CRLF 1675 *( "250-" ehlo-line CRLF ) 1676 "250" SP ehlo-line CRLF ) 1678 ehlo-greet = 1*(%d0-9 / %d11-12 / %d14-127) 1679 ; string of any characters other than CR or LF 1681 ehlo-line = ehlo-keyword *( SP ehlo-param ) 1683 ehlo-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-") 1684 ; additional syntax of ehlo-params depends on 1685 ; ehlo-keyword 1687 ehlo-param = 1*(%d33-126) 1688 ; any CHAR excluding and all 1689 ; control characters (US-ASCII 0-31 and 127 1690 ; inclusive) 1692 Although EHLO keywords may be specified in upper, lower, or mixed 1693 case, they MUST always be recognized and processed in a case- 1694 insensitive manner. This is simply an extension of practices 1695 specified in RFC 821 and Section 2.4. 1697 The EHLO response MUST contain keywords (and associated parameters if 1698 required) for all commands not listed as "required" in Section 4.5.1. 1700 4.1.1.2. MAIL (MAIL) 1702 This command is used to initiate a mail transaction in which the mail 1703 data is delivered to an SMTP server that may, in turn, deliver it to 1704 one or more mailboxes or pass it on to another system (possibly using 1705 SMTP). The argument clause contains a reverse-path and may contain 1706 optional parameters. In general, the MAIL command may be sent only 1707 when no mail transaction is in progress, see Section 4.1.4. 1709 The reverse-path consists of the sender mailbox. Historically, that 1710 mailbox might optionally have been preceded by a list of hosts, but 1711 that behavior is now deprecated (see Appendix F.2). In some types of 1712 reporting messages for which a reply is likely to cause a mail loop 1713 (for example, mail delivery and non-delivery notifications), the 1714 reverse-path may be null (see Section 3.6). 1716 This command clears the reverse-path buffer, the forward-path buffer, 1717 and the mail data buffer, and it inserts the reverse-path information 1718 from its argument clause into the reverse-path buffer. 1720 If service extensions were negotiated, the MAIL command may also 1721 carry parameters associated with a particular service extension. 1723 Syntax: 1725 mail = "MAIL FROM:" Reverse-path 1726 [SP Mail-parameters] CRLF 1728 4.1.1.3. RECIPIENT (RCPT) 1730 This command is used to identify an individual recipient of the mail 1731 data; multiple recipients are specified by multiple uses of this 1732 command. The argument clause contains a forward-path and may contain 1733 optional parameters. 1735 The forward-path consists of the required destination mailbox. When 1736 mail reaches its ultimate destination, the SMTP server inserts it 1737 into the destination mailbox in accordance with its host mail 1738 conventions. 1740 Prior versions of the SMTP specification included text and examples 1741 in this section of use of the deprecated source route construct. If 1742 desired, see Appendix F.2 for discussion of that mechanism. 1744 This command appends its forward-path argument to the forward-path 1745 buffer; it does not change the reverse-path buffer nor the mail data 1746 buffer. 1748 For example, mail received at relay host xyz.com with envelope 1749 commands 1751 MAIL FROM: 1752 RCPT TO: 1754 will result in a DNS lookup for d.bar.org and transmission to the 1755 host specified in the most-preferred MX record that is available (or 1756 by the address record if there are no MX records). It will use 1757 envelope commands identical to the above, i.e., 1759 MAIL FROM: 1760 RCPT TO: 1762 Since hosts are not required to relay mail at all, xyz.com MAY also 1763 reject the message entirely when the RCPT command is received, using 1764 a 550 code (since this is a "policy reason"). 1766 If the SMTP server determines that a message sent to the mailbox in 1767 the forward-path is not deliverable, it MUST either return an 1768 appropriate response code (see Section 4.2.2) or generate a non- 1769 delivery notification. 1771 // Editor's Note: Following text moved from Section 4.4.1, per 2021 1772 // November discussion, and rewritten slightly (in -09). With the 1773 // current structure of the document, this seemed the least-bad place 1774 // to put it. Other plausible alternatives would be to put a "Non- 1775 // delivery Notifications" section into either Section 3 or 1776 // Section 6. 1778 If there were multiple failed recipients, either a single 1779 notification listing all of the failed recipients or separate 1780 notification messages MUST be sent for each failed recipient. For 1781 economy of processing by the sender, the former SHOULD be used when 1782 possible. All notification messages about undeliverable mail MUST be 1783 sent using the MAIL command and MUST use a null return path as 1784 discussed in Section 3.6. 1786 If service extensions were negotiated, the RCPT command may also 1787 carry parameters associated with a particular service extension 1788 offered by the server. The client MUST NOT transmit parameters other 1789 than those associated with a service extension offered by the server 1790 in its EHLO response. 1792 Syntax: 1794 rcpt = "RCPT TO:" ( "" / "" / 1795 Forward-path ) [SP Rcpt-parameters] CRLF 1796 Note that, in a departure from the usual rules for 1797 local-parts, the "Postmaster" string shown above is 1798 treated as case-insensitive. 1800 4.1.1.4. DATA (DATA) 1802 The receiver normally sends a 354 response to DATA, and then treats 1803 the lines (strings ending in sequences, as described in 1804 Section 2.3.7) following the command as mail data from the sender. 1805 This command causes the mail data to be appended to the mail data 1806 buffer. The mail data may contain any of the 128 ASCII character 1807 codes, although experience has indicated that use of control 1808 characters other than SP, HT, CR, and LF may cause problems and 1809 SHOULD be avoided when possible. 1811 The mail data are terminated by a line containing only a period, that 1812 is, the character sequence ".", where the first is 1813 actually the terminator of the previous line (see Section 4.5.2). 1814 This is the end of mail data indication. The first of this 1815 terminating sequence is also the that ends the final line of 1816 the data (message text) or, if there was no mail data, ends the DATA 1817 command itself (the "no mail data" case does not conform to this 1818 specification since it would require that neither the trace header 1819 fields required by this specification nor the message header section 1820 required by RFC 5322 [12] be transmitted). An extra MUST NOT 1821 be added, as that would cause an empty line to be added to the 1822 message. The only exception to this rule would arise if the message 1823 body were passed to the originating SMTP-sender with a final "line" 1824 that did not end in ; in that case, the originating SMTP system 1825 MUST either reject the message as invalid or add in order to 1826 have the receiving SMTP server recognize the "end of data" condition. 1828 The custom of accepting lines ending only in , as a concession to 1829 non-conforming behavior on the part of some UNIX systems, has proven 1830 to cause more interoperability problems than it solves, and SMTP 1831 server systems MUST NOT do this, even in the name of improved 1832 robustness. In particular, the sequence "." (bare line 1833 feeds, without carriage returns) MUST NOT be treated as equivalent to 1834 . as the end of mail data indication. 1836 Receipt of the end of mail data indication requires the server to 1837 process the stored mail transaction information. This processing 1838 consumes the information in the reverse-path buffer, the forward-path 1839 buffer, and the mail data buffer, and on the completion of this 1840 command these buffers are cleared. If the processing is successful, 1841 the receiver MUST send an OK reply. If the processing fails, the 1842 receiver MUST send a failure reply. The SMTP model does not allow 1843 for partial failures at this point: either the message is accepted by 1844 the server for delivery and a positive response is returned or it is 1845 not accepted and a failure reply is returned. In sending a positive 1846 "250 OK" completion reply to the end of data indication, the receiver 1847 takes full responsibility for the message (see Section 6.1). Errors 1848 that are diagnosed subsequently MUST be reported in a mail message, 1849 as discussed in Section 4.4. 1851 When the SMTP server accepts a message either for relaying or for 1852 final delivery, it inserts a trace record (also referred to 1853 interchangeably as a "time stamp line" or "Received" line) at the top 1854 of the mail data. This trace record indicates the identity of the 1855 host that sent the message, the identity of the host that received 1856 the message (and is inserting this time stamp), and the date and time 1857 the message was received. Relayed messages will have multiple time 1858 stamp lines. Details for formation of these lines, including their 1859 syntax, is specified in Section 4.4. 1861 Additional discussion about the operation of the DATA command appears 1862 in Section 3.3. 1864 Syntax: 1866 data = "DATA" CRLF 1868 4.1.1.5. RESET (RSET) 1870 This command specifies that the current mail transaction will be 1871 aborted. Any stored sender, recipients, and mail data MUST be 1872 discarded, and all buffers and state tables cleared. The receiver 1873 MUST send a "250 OK" reply to a RSET command with no arguments. A 1874 reset command may be issued by the client at any time. It is 1875 effectively equivalent to a NOOP (i.e., it has no effect) if issued 1876 immediately after EHLO, before EHLO is issued in the session, after 1877 an end of data indicator has been sent and acknowledged, or 1878 immediately before a QUIT. An SMTP server MUST NOT close the 1879 connection as the result of receiving a RSET; that action is reserved 1880 for QUIT (see Section 4.1.1.10). 1882 Since EHLO implies some additional processing and response by the 1883 server, RSET will normally be more efficient than reissuing that 1884 command, even though the formal semantics are the same. 1886 Syntax: 1888 rset = "RSET" CRLF 1890 4.1.1.6. VERIFY (VRFY) 1892 This command asks the receiver to confirm that the argument 1893 identifies a user or mailbox. If it is a user name, information is 1894 returned as specified in Section 3.5. 1896 This command has no effect on the reverse-path buffer, the forward- 1897 path buffer, or the mail data buffer. 1899 Syntax: 1901 vrfy = "VRFY" SP String CRLF 1903 4.1.1.7. EXPAND (EXPN) 1905 This command asks the receiver to confirm that the argument 1906 identifies a mailing list, and if so, to return the membership of 1907 that list. If the command is successful, a reply is returned 1908 containing information as described in Section 3.5. This reply will 1909 have multiple lines except in the trivial case of a one-member list. 1911 This command has no effect on the reverse-path buffer, the forward- 1912 path buffer, or the mail data buffer, and it may be issued at any 1913 time. 1915 Syntax: 1917 expn = "EXPN" SP String CRLF 1919 4.1.1.8. HELP (HELP) 1921 This command causes the server to send helpful information to the 1922 client. The command MAY take an argument (e.g., any command name) 1923 and return more specific information as a response. 1925 This command has no effect on the reverse-path buffer, the forward- 1926 path buffer, or the mail data buffer, and it may be issued at any 1927 time. 1929 SMTP servers SHOULD support HELP without arguments and MAY support it 1930 with arguments. 1932 Syntax: 1934 help = "HELP" [ SP String ] CRLF 1936 4.1.1.9. NOOP (NOOP) 1938 This command does not affect any parameters or previously entered 1939 commands. It specifies no action other than that the receiver send a 1940 "250 OK" reply. 1942 This command has no effect on the reverse-path buffer, the forward- 1943 path buffer, or the mail data buffer, and it may be issued at any 1944 time. If a parameter string is specified, servers SHOULD ignore it. 1946 Syntax: 1948 noop = "NOOP" [ SP String ] CRLF 1950 4.1.1.10. QUIT (QUIT) 1952 This command specifies that the receiver MUST send a "221 OK" reply, 1953 and then close the transmission channel. 1955 The receiver MUST NOT intentionally close the transmission channel 1956 until it receives and replies to a QUIT command (even if there was an 1957 error). The sender MUST NOT intentionally close the transmission 1958 channel until it sends a QUIT command, and it SHOULD wait until it 1959 receives the reply (even if there was an error response to a previous 1960 command). If the connection is closed prematurely due to violations 1961 of the above or system or network failure, the server MUST cancel any 1962 pending transaction, but not undo any previously completed 1963 transaction, and generally MUST act as if the command or transaction 1964 in progress had received a temporary error (i.e., a 4yz response). 1966 The QUIT command may be issued at any time. Any current uncompleted 1967 mail transaction will be aborted. 1969 Syntax: 1971 quit = "QUIT" CRLF 1973 4.1.1.11. Mail-Parameter and Rcpt-Parameter Error Responses 1975 If the server SMTP does not recognize or cannot implement one or more 1976 of the parameters associated with a particular MAIL or RCPT command, 1977 it will return code 555. 1979 If, for some reason, the server is temporarily unable to accommodate 1980 one or more of the parameters associated with a MAIL or RCPT command, 1981 and if the definition of the specific parameter does not mandate the 1982 use of another code, it should return code 455. 1984 Errors specific to particular parameters and their values will be 1985 specified in the parameter's defining RFC. 1987 4.1.2. Command Argument Syntax 1989 The syntax of the argument clauses of the above commands (using the 1990 syntax specified in RFC 5234 [11] where applicable) is given below. 1991 Some terminals not defined in this document, but are defined 1992 elsewhere, specifically: 1994 * In the "core" syntax in Appendix B of RFC 5234 [11]: ALPHA , CRLF 1995 , DIGIT , HEXDIG , and SP 1997 * In the message format syntax in RFC 5322 [12]: atext , CFWS , and 1998 FWS . 2000 Reverse-path = Path / "<>" 2002 Forward-path = Path 2004 Path = "<" Mailbox ">" 2006 Mail-parameters = esmtp-param *(SP esmtp-param) 2008 Rcpt-parameters = esmtp-param *(SP esmtp-param) 2010 esmtp-param = esmtp-keyword ["=" esmtp-value] 2012 esmtp-keyword = (ALPHA / DIGIT) *(ALPHA / DIGIT / "-") 2014 esmtp-value = 1*(%d33-60 / %d62-126) 2015 ; any CHAR excluding "=", SP, and control 2016 ; characters. If this string is an email address, 2017 ; i.e., a Mailbox, then the "xtext" syntax [34] 2018 ; SHOULD be used. 2020 Keyword = Ldh-str 2022 Argument = Atom 2024 Domain = sub-domain *("." sub-domain) 2025 sub-domain = Let-dig [Ldh-str] 2027 Let-dig = ALPHA / DIGIT 2029 Ldh-str = *( ALPHA / DIGIT / "-" ) Let-dig 2031 address-literal = "[" ( IPv4-address-literal / 2032 IPv6-address-literal / 2033 General-address-literal ) "]" 2034 ; See Section 4.1.3 2036 Mailbox = Local-part "@" ( Domain / address-literal ) 2038 Local-part = Dot-string / Quoted-string 2039 ; MAY be case-sensitive 2041 Dot-string = Atom *("." Atom) 2043 Atom = 1*atext 2045 Quoted-string = DQUOTE 1*QcontentSMTP DQUOTE 2047 QcontentSMTP = qtextSMTP / quoted-pairSMTP 2049 quoted-pairSMTP = %d92 %d32-126 2050 ; i.e., backslash followed by any ASCII 2051 ; graphic (including itself) or SPace 2053 qtextSMTP = %d32-33 / %d35-91 / %d93-126 2054 ; i.e., within a quoted string, any 2055 ; ASCII graphic or space is permitted 2056 ; without backslash-quoting except 2057 ; double-quote and the backslash itself. 2059 String = Atom / Quoted-string 2061 Note that the backslash, "\", is a quote character, which is used to 2062 indicate that the next character is to be used literally (instead of 2063 its normal interpretation). For example, "Joe\,Smith" indicates a 2064 single nine-character user name string with the comma being the 2065 fourth character of that string. 2067 While the above definition for Local-part is relatively permissive, 2068 for maximum interoperability, a mailbox SHOULD NOT be defined with 2069 Local-part requiring (or using) the Quoted-string form or with the 2070 Local-part being case-sensitive. Further, when comparing a Local- 2071 part (e.g., to a specific mailbox name), all quoting MUST be treated 2072 as equivalent. A sending system SHOULD transmit the form that uses 2073 the minimum quoting possible. 2075 For example, the following 3 local-parts are equivalent and MUST 2076 compare equal: "ab cd ef", "ab\ cd ef" and "ab\ \cd ef". 2077 Similarly, "fred" and fred must compare equal. White space 2078 reduction MUST NOT be applied to Local-part by intermediate 2079 systems. 2081 Systems MUST NOT define mailboxes in such a way as to require the use 2082 in SMTP of non-ASCII characters (octets with the high order bit set 2083 to one) or ASCII "control characters" (decimal value 0-31 and 127). 2084 These characters MUST NOT be used in MAIL or RCPT commands or other 2085 commands that require mailbox names. 2087 To promote interoperability and consistent with long-standing 2088 guidance about conservative use of the DNS in naming and applications 2089 (e.g., see Section 2.3.1 of the base DNS document, RFC 1035 [4]), 2090 characters outside the set of alphabetic characters, digits, and 2091 hyphen MUST NOT appear in domain name labels for SMTP clients or 2092 servers. In particular, the underscore character is not permitted. 2093 SMTP servers that receive a command in which invalid character codes 2094 have been employed, and for which there are no other reasons for 2095 rejection, MUST reject that command with a 501 response (this rule, 2096 like others, could be overridden by appropriate SMTP extensions). 2098 4.1.3. Address Literals 2100 Sometimes a host is not known to the domain name system and 2101 communication (and, in particular, communication to report and repair 2102 the error) is blocked. To bypass this barrier, a special literal 2103 form of the address is allowed as an alternative to a domain name. 2104 For IPv4 addresses, this form uses four small decimal integers 2105 separated by dots and enclosed by brackets such as [123.255.37.2], 2106 which indicates an (IPv4) Internet Address in sequence-of-octets 2107 form. For IPv6 and other forms of addressing that might eventually 2108 be standardized, the form consists of a standardized "tag" that 2109 identifies the address syntax, a colon, and the address itself, in a 2110 format specified as part of the relevant standards (i.e., RFC 4291 2111 [10] for IPv6). 2113 // [5321bis] Proposed erratum 4315 (2015-03-27) suggests yet another 2114 // modification to the IPv6 address literal syntax, based on part on 2115 // RFC 5952. We should consider whether those, or other, 2116 // modifications are appropriate and/or whether, given both the 2117 // issues of spam/malware and servers supporting multiple domains, it 2118 // it time to deprecate mailboxes containing address literals 2119 // entirely (EHLO fields may be a different issue). If we are going 2120 // to allow IPv6 address literals, it may be time to incorporate 2121 // something by reference rather than including specific syntax here 2122 // (RFC 5952 is 14 pages long and does not contain any ABNF). 2124 Specifically: 2126 IPv4-address-literal = Snum 3("." Snum) 2128 IPv6-address-literal = "IPv6:" IPv6-addr 2130 General-address-literal = Standardized-tag ":" 1*dcontent 2132 Standardized-tag = Ldh-str 2133 ; Standardized-tag MUST be specified in a 2134 ; Standards-Track RFC and registered with IANA 2136 dcontent = %d33-90 / ; Printable US-ASCII 2137 %d94-126 ; excl. "[", "\", "]" 2139 Snum = 1*3DIGIT 2140 ; representing a decimal integer 2141 ; value in the range 0 through 255 2143 IPv6-addr = 6( h16 ":" ) ls32 2144 / "::" 5( h16 ":" ) ls32 2145 / [ h16 ] "::" 4( h16 ":" ) ls32 2146 / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32 2147 / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32 2148 / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32 2149 / [ *4( h16 ":" ) h16 ] "::" ls32 2150 / [ *5( h16 ":" ) h16 ] "::" h16 2151 / [ *6( h16 ":" ) h16 ] "::" 2152 ; This definition is consistent with the one for 2153 ; URIs [40]. 2155 ls32 = ( h16 ":" h16 ) / IPv4address 2156 ; least-significant 32 bits of address 2158 h16 = 1*4HEXDIG 2159 ; 16 bits of address represented in hexadecimal 2161 4.1.4. Order of Commands 2163 There are restrictions on the order in which these commands may be 2164 used. 2166 A session that will contain mail transactions MUST first be 2167 initialized by the use of the EHLO command. An SMTP server SHOULD 2168 accept commands for non-mail transactions (e.g., VRFY, EXPN, or NOOP) 2169 without this initialization. 2171 An EHLO command MAY be issued by a client later in the session. If 2172 it is issued after the session begins and the EHLO command is 2173 acceptable to the SMTP server, the SMTP server MUST clear all buffers 2174 and reset the state exactly as if a RSET command had been issued 2175 (specifically, it terminates any mail transaction that was in 2176 progress, see Section 3.3). In other words, the sequence of RSET 2177 followed immediately by EHLO is redundant, but not harmful other than 2178 in the performance cost of executing unnecessary commands. However 2179 the response to an additional EHLO command MAY be different from that 2180 from prior ones; the client MUST rely only on the responses from the 2181 most recent EHLO command. 2183 If the EHLO command is not acceptable to the SMTP server, 501, 500, 2184 502, or 550 failure replies MUST be returned as appropriate. The 2185 SMTP server MUST stay in the same state after transmitting these 2186 replies that it was in before the EHLO was received. 2188 The SMTP client MUST, if possible, ensure that the domain parameter 2189 to the EHLO command is a primary host name as specified for this 2190 command in Section 2.3.5. If this is not possible (e.g., when the 2191 client's address is dynamically assigned and the client does not have 2192 an obvious name), an address literal SHOULD be substituted for the 2193 domain name. 2195 An SMTP server MAY verify that the domain name argument in the EHLO 2196 command has an address record matching the IP address of the client. 2198 // JcK 20211022: Note that Alessandro's email of 2021-10-13 proposes 2199 // adding "See [A/S] for further discussion." after that sentence. 2200 // Noting that phrasing could get us in trouble if the A/S takes a 2201 // long time to complete, can the WG please make a decision? 2203 // JcK 20211022: Additional question: should we be clear that this 2204 // refers to a forward lookup of the domain name, not a reverse 2205 // lookup of the address? 2206 The NOOP, HELP, EXPN, VRFY, and RSET commands can be used at any time 2207 during a session, or without previously initializing a session. SMTP 2208 servers SHOULD process these normally (that is, not return a 503 2209 code) even if no EHLO command has yet been received; clients SHOULD 2210 open a session with EHLO before sending these commands. 2212 If these rules are followed, the example in RFC 821 that shows "550 2213 access denied to you" in response to an EXPN command is incorrect 2214 unless an EHLO command precedes the EXPN or the denial of access is 2215 based on the client's IP address or other authentication or 2216 authorization-determining mechanisms. 2218 A mail transaction begins with a MAIL command and then consists of 2219 one or more RCPT commands, and a DATA command, in that order. A mail 2220 transaction may be aborted by the RSET, a new EHLO, or the QUIT 2221 command. 2223 SMTP extensions (see Section 2.2) may create additional commands that 2224 initiate, abort, or end the transaction.More generally, any new 2225 command MUST clearly document any effect it has on the transaction 2226 state. 2228 There may be zero or more transactions in a session. MAIL MUST NOT 2229 be sent if a mail transaction is already open, i.e., it should be 2230 sent only if no mail transaction had been started in the session, or 2231 if the previous one successfully concluded with a successful DATA 2232 command, or if the previous one was aborted, e.g., with a RSET or new 2233 EHLO. 2234 // [5321bis] See comment about changing this convoluted discussion to 2235 // talk about 'mail transaction' above. --JcK (and see Ticket #11 2236 // correspondence with Alexey 2021-07-06) 2238 If the transaction beginning command argument is not acceptable, a 2239 501 failure reply MUST be returned and the SMTP server MUST stay in 2240 the same state. If the commands in a transaction are out of order to 2241 the degree that they cannot be processed by the server, a 503 failure 2242 reply MUST be returned and the SMTP server MUST stay in the same 2243 state. 2245 The last command in a session MUST be the QUIT command. The QUIT 2246 command SHOULD be used by the client SMTP to request connection 2247 closure, even when no session opening command was sent and accepted. 2249 4.2. SMTP Replies 2251 Replies to SMTP commands serve to ensure the synchronization of 2252 requests and actions in the process of mail transfer and to guarantee 2253 that the SMTP client always knows the state of the SMTP server. 2254 Every command MUST generate exactly one reply. 2256 The details of the command-reply sequence are described in 2257 Section 4.3. 2259 An SMTP reply consists of a three digit number (transmitted as three 2260 numeric characters) followed by some text unless specified otherwise 2261 in this document. The number is for use by automata to determine 2262 what state to enter next; the text is for the human user. The three 2263 digits contain enough encoded information that the SMTP client need 2264 not examine the text and may either discard it or pass it on to the 2265 user, as appropriate. Exceptions are as noted elsewhere in this 2266 document. In particular, the 220, 221, 251, 421, and 551 reply codes 2267 are associated with message text that must be parsed and interpreted 2268 by machines. In the general case, the text may be receiver dependent 2269 and context dependent, so there are likely to be varying texts for 2270 each reply code. A discussion of the theory of reply codes is given 2271 in Section 4.2.1. Formally, a reply is defined to be the sequence: a 2272 three-digit code, , one line of text, and , or a multiline 2273 reply (as defined in the same section). Since, in violation of this 2274 specification, the text is sometimes not sent, clients that do not 2275 receive it SHOULD be prepared to process the code alone (with or 2276 without a trailing space character). Only the EHLO, EXPN, and HELP 2277 commands are expected to result in multiline replies in normal 2278 circumstances; however, multiline replies are allowed for any 2279 command. 2281 In ABNF, server responses are: 2283 Greeting = ( "220 " (Domain / address-literal) 2284 [ SP textstring ] CRLF ) / 2285 ( "220-" (Domain / address-literal) 2286 [ SP textstring ] CRLF 2287 *( "220-" [ textstring ] CRLF ) 2288 "220" [ SP textstring ] CRLF ) 2290 textstring = 1*(%d09 / %d32-126) ; HT, SP, Printable US-ASCII 2292 Reply-line = *( Reply-code "-" [ textstring ] CRLF ) 2293 Reply-code [ SP textstring ] CRLF 2295 Reply-code = %x32-35 %x30-35 %x30-39 2296 where "Greeting" appears only in the 220 response that announces that 2297 the server is opening its part of the connection. (Other possible 2298 server responses upon connection follow the syntax of Reply-line.) 2300 An SMTP server SHOULD send only the reply codes listed in this 2301 document or additions to the list as discussed below. An SMTP server 2302 SHOULD use the text shown in the examples whenever appropriate. 2304 An SMTP client MUST determine its actions only by the reply code, not 2305 by the text (except for the "change of address" 251 and 551 and, if 2306 necessary, 220, 221, and 421 replies); in the general case, any text, 2307 including no text at all (although senders SHOULD NOT send bare 2308 codes), MUST be acceptable. The space (blank) following the reply 2309 code is considered part of the text. A Sender-SMTP MUST first test 2310 the whole 3 digit reply code it receives, as well as any accompanying 2311 supplemental codes or information (see RFC 3463 [7] and RFC 5248 2312 [43]). If the full reply code is not recognized, and the additional 2313 information is not recognized or missing, the Sender-SMTP MUST use 2314 the first digit (severity indication) of a reply code it receives. 2316 The list of codes that appears below MUST NOT be construed as 2317 permanent. While the addition of new codes should be a rare and 2318 significant activity, with supplemental information in the textual 2319 part of the response (including enhanced status codes [7] and the 2320 successors to that specification) being preferred, new codes may be 2321 added as the result of new Standards or Standards-Track 2322 specifications. Consequently, a sender-SMTP MUST be prepared to 2323 handle codes not specified in this document and MUST do so by 2324 interpreting the first digit only. 2326 In the absence of extensions negotiated with the client, SMTP servers 2327 MUST NOT send reply codes whose first digits are other than 2, 3, 4, 2328 or 5. Clients that receive such out-of-range codes SHOULD normally 2329 treat them as fatal errors and terminate the mail transaction. 2331 4.2.1. Reply Code Severities and Theory 2333 The three digits of the reply each have a special significance. The 2334 first digit denotes whether the response is good, bad, or incomplete. 2335 An unsophisticated SMTP client, or one that receives an unexpected 2336 code, will be able to determine its next action (proceed as planned, 2337 redo, retrench, etc.) by examining this first digit. An SMTP client 2338 that wants to know approximately what kind of error occurred (e.g., 2339 mail system error, command syntax error) may examine the second 2340 digit. The third digit and any supplemental information that may be 2341 present is reserved for the finest gradation of information. 2343 There are four values for the first digit of the reply code: 2345 2yz Positive Completion reply 2346 The requested action has been successfully completed. A new 2347 request may be initiated. 2349 3yz Positive Intermediate reply 2350 The command has been accepted, but the requested action is being 2351 held in abeyance, pending receipt of further information. The 2352 SMTP client should send another command specifying this 2353 information. This reply is used in command sequence groups (i.e., 2354 in DATA). 2356 4yz Transient Negative Completion reply 2357 The command was not accepted, and the requested action did not 2358 occur. However, the error condition is temporary, and the action 2359 may be requested again. The sender should return to the beginning 2360 of the command sequence (if any). It is difficult to assign a 2361 meaning to "transient" when two different sites (receiver- and 2362 sender-SMTP agents) must agree on the interpretation. Each reply 2363 in this category might have a different time value, but the SMTP 2364 client SHOULD try again. A rule of thumb to determine whether a 2365 reply fits into the 4yz or the 5yz category (see below) is that 2366 replies are 4yz if they can be successful if repeated without any 2367 change in command form or in properties of the sender or receiver 2368 (that is, the command is repeated identically and the receiver 2369 does not put up a new implementation). 2371 5yz Permanent Negative Completion reply 2372 The command was not accepted and the requested action did not 2373 occur. The SMTP client SHOULD NOT repeat the exact request (in 2374 the same sequence). Even some "permanent" error conditions can be 2375 corrected, so the human user may want to direct the SMTP client to 2376 reinitiate the command sequence by direct action at some point in 2377 the future (e.g., after the spelling has been changed, or the user 2378 has altered the account status). 2380 It is worth noting that the file transfer protocol (FTP) [15] uses a 2381 very similar code architecture and that the SMTP codes are based on 2382 the FTP model. However, SMTP uses a one-command, one-response model 2383 (while FTP is asynchronous) and FTP's 1yz codes are not part of the 2384 SMTP model. 2386 The second digit encodes responses in specific categories: 2388 x0z Syntax: These replies refer to syntax errors, syntactically 2389 correct commands that do not fit any functional category, and 2390 unimplemented or superfluous commands. 2392 x1z Information: These are replies to requests for information, such 2393 as status or help. 2395 x2z Connections: These are replies referring to the transmission 2396 channel. 2398 x3z Unspecified. 2400 x4z Unspecified. 2402 x5z Mail system: These replies indicate the status of the receiver 2403 mail system vis-a-vis the requested transfer or other mail system 2404 action. 2406 The third digit gives a finer gradation of meaning in each category 2407 specified by the second digit. The list of replies illustrates this. 2408 Each reply text is recommended rather than mandatory, and may even 2409 change according to the command with which it is associated. On the 2410 other hand, the reply codes must strictly follow the specifications 2411 in this section. Receiver implementations should not invent new 2412 codes for slightly different situations from the ones described here, 2413 but rather adapt codes already defined. 2415 For example, a command such as NOOP, whose successful execution does 2416 not offer the SMTP client any new information, will return a 250 2417 reply. The reply is 502 when the command requests an unimplemented 2418 non-site-specific action. A refinement of that is the 504 reply for 2419 a command that is implemented, but that requests an unimplemented 2420 parameter. 2422 The reply text may be longer than a single line; in these cases the 2423 complete text must be marked so the SMTP client knows when it can 2424 stop reading the reply. This requires a special format to indicate a 2425 multiple line reply. 2427 The format for multiline replies requires that every line, except the 2428 last, begin with the reply code, followed immediately by a hyphen, 2429 "-" (also known as minus), followed by text. The last line will 2430 begin with the reply code, followed immediately by , optionally 2431 some text, and . As noted above, servers SHOULD send the 2432 if subsequent text is not sent, but clients MUST be prepared for it 2433 to be omitted. 2435 For example: 2437 250-First line 2438 250-Second line 2439 250-234 Text beginning with numbers 2440 250 The last line 2442 In a multiline reply, the reply code on each of the lines MUST be the 2443 same. It is reasonable for the client to rely on this, so it can 2444 make processing decisions based on the code in any line, assuming 2445 that all others will be the same. In a few cases, there is important 2446 data for the client in the reply "text". The client will be able to 2447 identify these cases from the current context. 2449 4.2.2. Reply Codes by Function Groups 2451 500 Syntax error, command unrecognized (This may include errors such 2452 as command line too long) 2454 501 Syntax error in parameters or arguments 2456 502 Command not implemented (see Section 4.2.4.1) 2458 503 Bad sequence of commands 2460 504 Command parameter not implemented 2462 211 System status, or system help reply 2464 214 Help message (Information on how to use the receiver or the 2465 meaning of a particular non-standard command; this reply is useful 2466 only to the human user) 2468 220 Service ready 2470 221 Service closing transmission channel 2472 421 Service not available, closing transmission channel 2473 (This may be a reply to any command if the service knows it must 2474 shut down) 2476 521 No mail service here. 2478 556 No mail service at this domain. 2480 250 Requested mail action okay, completed 2482 251 User not local; will forward to (See 2483 Section 3.4.1) 2485 252 Cannot VRFY user, but will accept message and attempt delivery 2486 (See Section 3.5.3) 2488 455 Server unable to accommodate parameters 2489 555 MAIL FROM/RCPT TO parameters not recognized or not implemented 2491 450 Requested mail action not taken: mailbox unavailable (e.g., 2492 mailbox busy or temporarily blocked for policy reasons) 2494 550 Requested action not taken: mailbox unavailable (e.g., mailbox 2495 not found, no access, or command rejected for policy reasons) 2497 451 Requested action aborted: error in processing 2499 551 User not local; please try (See Section 3.4.1) 2501 452 Requested action not taken: insufficient system storage 2502 (preferred code for "too many recipients", see Section 4.5.3.1.10) 2504 552 Requested mail action aborted: exceeded storage allocation. 2506 553 Requested action not taken: mailbox name not allowed (e.g., 2507 mailbox syntax incorrect) 2509 354 Start mail input; end with . 2511 554 Transaction failed (Or, historically in the case of a 2512 connection-opening response, "No SMTP service here". 521 is now 2513 preferred for that function at connection-opening if the server 2514 never accepts mail.) 2516 4.2.3. Reply Codes in Numeric Order 2518 211 System status, or system help reply 2520 214 Help message (Information on how to use the receiver or the 2521 meaning of a particular non-standard command; this reply is useful 2522 only to the human user) 2524 220 Service ready 2526 221 Service closing transmission channel 2528 250 Requested mail action okay, completed 2530 251 User not local; will forward to (See 2531 Section 3.4.1) 2533 252 Cannot VRFY user, but will accept message and attempt delivery 2534 (See Section 3.5.3) 2536 354 Start mail input; end with . 2537 421 Service not available, closing transmission channel 2538 (This may be a reply to any command if the service knows it must 2539 shut down) 2541 450 Requested mail action not taken: mailbox unavailable (e.g., 2542 mailbox busy or temporarily blocked for policy reasons) 2544 451 Requested action aborted: local error in processing 2546 452 Requested action not taken: insufficient system storage (also 2547 preferred code for "too many recipients", see Section 4.5.3.1.10) 2549 455 Server unable to accommodate parameters 2551 500 Syntax error, command unrecognized (This may include errors such 2552 as command line too long) 2554 501 Syntax error in parameters or arguments 2556 502 Command not implemented (see Section 4.2.4.1) 2558 503 Bad sequence of commands 2560 504 Command parameter not implemented 2562 521 No mail service (See Section 4.2.4.2.) 2564 550 Requested action not taken: mailbox unavailable (e.g., mailbox 2565 not found, no access, or command rejected for policy reasons) 2567 551 User not local; please try (See Section 3.4.1) 2569 552 Requested mail action aborted: exceeded storage allocation. 2571 553 Requested action not taken: mailbox name not allowed (e.g., 2572 mailbox syntax incorrect) 2574 554 Transaction failed (Or, in the case of a connection-opening 2575 response, "No SMTP service here" although 521 is now preferred for 2576 the latter. See Section 4.2.4.2.) 2578 555 MAIL FROM/RCPT TO parameters not recognized or not implemented 2580 556 No mail service at this domain. (See Section 4.2.4.2.) 2582 4.2.4. Some specific code situations and relationships 2584 4.2.4.1. Reply Code 502 2586 Questions have been raised as to when reply code 502 (Command not 2587 implemented) SHOULD be returned in preference to other codes. 502 2588 SHOULD be used when the command is actually recognized by the SMTP 2589 server, but not implemented. If the command is not recognized, code 2590 500 SHOULD be returned. Extended SMTP systems MUST NOT list 2591 capabilities in response to EHLO for which they will return 502 (or 2592 500) replies. 2594 4.2.4.2. "No mail accepted" situations and the 521, 554, and 556 codes 2596 Codes 521, 554, and 556 are all used to report different types of "no 2597 mail accepted" situations. They differ as follows. 521 is an 2598 indication from a system answering on the SMTP port that it does not 2599 support SMTP service (a so-called "dummy server" as discussed in RFC 2600 7504 [45] and elsewhere). Obviously, it requires that system exist 2601 and that a connection can be made successfully to it. Because a 2602 system that does not accept any mail cannot meaningfully accept a 2603 RCPT command, any commands (other than QUIT) issued after an SMTP 2604 server has issued a 521 reply are client (sender) errors. 2606 When a domain does not intend to accept mail and wishes to publish 2607 that fact rather than being subjected to connection attempts, the 2608 best way to accomplish that is to use the "Null MX" convention. This 2609 is done by advertising a single MX RR (see Section 3.3.9 of RFC 1035 2610 [4]) with an RDATA section consisting of preference number 0 and a 2611 zero-length label, written in master files as ".", as the exchange 2612 domain, to denote that there exists no mail exchanger for that 2613 domain. Reply code 556 is then used by a message submission or 2614 intermediate SMTP system (see Section 1.1) to report that it cannot 2615 forward the message further because it knows from the DNS entry that 2616 the recipient domain does not accept mail. If, despite publishing 2617 the DNS entry, the host associated with the server domain chooses to 2618 respond on the SMTP port, it SHOULD respond with the 556 code as 2619 well. The details of the Null MX convention were first defined in 2620 RFC 7505 [46]; see that document for additional discussion of the 2621 rationale for that convention. 2623 // JcK 2022-03-05: Add some text and a reference to the IANA registry 2624 // to cover the enhanced status codes here (see email, this date)? 2626 Reply code 554 would normally be used in response to a RCPT command 2627 (or extension command with similar intent) when the SMTP system 2628 identifies a domain that it can (or has) determined never accepts 2629 mail. Other codes, including 554 and the temporary 450, are used for 2630 more transient situations and situations in which an SMTP server 2631 cannot or will not deliver to (or accept mail for) a particular 2632 system or mailbox for policy reasons rather than ones directly 2633 related to SMTP processing. 2635 // [JcK 20210904]: do we want/need to discuss temporary server 2636 // outages? And is the discussion above sufficient to obsolete RFC 2637 // 7505 or do we need either more text or some pretense to claim to 2638 // update it. 2640 4.2.4.3. Reply Codes after DATA and the Subsequent . 2642 When an SMTP server returns a positive completion status (2yz code) 2643 after the DATA command is completed with ., it accepts 2644 responsibility for: 2646 * delivering the message (if the recipient mailbox exists), or 2648 * if attempts to deliver the message fail due to transient 2649 conditions, retrying delivery some reasonable number of times at 2650 intervals as specified in Section 4.5.4. 2652 * if attempts to deliver the message fail due to permanent 2653 conditions, or if repeated attempts to deliver the message fail 2654 due to transient conditions, returning appropriate notification to 2655 the sender of the original message (using the address in the SMTP 2656 MAIL command). 2658 When an SMTP server returns a temporary error status (4yz) code after 2659 the DATA command is completed with ., it MUST NOT make a 2660 subsequent attempt to deliver that message. The SMTP client retains 2661 responsibility for the delivery of that message and may either return 2662 it to the user or requeue it for a subsequent attempt (see 2663 Section 4.5.4.1). 2665 The user who originated the message SHOULD be able to interpret the 2666 return of a transient failure status (by mail message or otherwise) 2667 as a non-delivery indication, just as a permanent failure would be 2668 interpreted. If the client SMTP successfully handles these 2669 conditions, the user will not receive such a reply. 2671 When an SMTP server returns a permanent error status (5yz) code after 2672 the DATA command is completed with ., it MUST NOT make 2673 any subsequent attempt to deliver the message. As with temporary 2674 error status codes, the SMTP client retains responsibility for the 2675 message, but SHOULD NOT again attempt delivery to the same server 2676 without user review of the message and response and appropriate 2677 intervention. 2679 4.3. Sequencing of Commands and Replies 2681 4.3.1. Sequencing Overview 2683 The communication between the sender and receiver is an alternating 2684 dialogue, controlled by the sender. As such, the sender issues a 2685 command and the receiver responds with a reply. Unless other 2686 arrangements are negotiated through service extensions, the sender 2687 MUST wait for this response before sending further commands. One 2688 important reply is the connection greeting. Normally, a receiver 2689 will send a 220 "Service ready" reply when the connection is 2690 completed. The sender SHOULD wait for this greeting message before 2691 sending any commands. 2693 Note: all the greeting-type replies have the official name (the 2694 fully-qualified primary domain name) of the server host as the first 2695 word following the reply code. Sometimes the host will have no 2696 meaningful name. See Section 4.1.3 for a discussion of alternatives 2697 in these situations. 2699 For example, 2701 220 ISIF.USC.EDU Service ready 2703 or 2705 220 mail.example.com SuperSMTP v 6.1.2 Service ready 2707 or 2709 220 [10.0.0.1] Clueless host service ready 2711 The table below lists alternative success and failure replies for 2712 each command. These SHOULD be strictly adhered to. A receiver MAY 2713 substitute text in the replies, but the meanings and actions implied 2714 by the code numbers and by the specific command reply sequence MUST 2715 be preserved. However, in order to provide robustness as SMTP is 2716 extended and evolves, the discussion in Section 4.2.1 still applies: 2717 all SMTP clients MUST be prepared to accept any code that conforms to 2718 the discussion in that section and MUST be prepared to interpret it 2719 on the basis of its first digit only. 2721 4.3.2. Command-Reply Sequences 2723 Each command is listed with its usual possible replies. The prefixes 2724 used before the possible replies are "I" for intermediate, "S" for 2725 success, and "E" for error. Since some servers may generate other 2726 replies under special circumstances, and to allow for future 2727 extension, SMTP clients SHOULD, when possible, interpret only the 2728 first digit of the reply and MUST be prepared to deal with 2729 unrecognized reply codes by interpreting the first digit only. 2730 Unless extended using the mechanisms described in Section 2.2, SMTP 2731 servers MUST NOT transmit reply codes to an SMTP client that are 2732 other than three digits or that do not start in a digit between 2 and 2733 5 inclusive. 2735 These sequencing rules and, in principle, the codes themselves, can 2736 be extended or modified by SMTP extensions offered by the server and 2737 accepted (requested) by the client. However, if the target is more 2738 precise granularity in the codes, rather than codes for completely 2739 new purposes, the system described in RFC 3463 [7] SHOULD be used in 2740 preference to the invention of new codes. 2742 In addition to the codes listed below, any SMTP command can return 2743 any of the following codes if the corresponding unusual circumstances 2744 are encountered: 2746 500 For the "command line too long" case or if the command name was 2747 not recognized. Note that producing a "command not recognized" 2748 error in response to the required subset of these commands is a 2749 violation of this specification. Similarly, producing a "command 2750 too long" message for a command line shorter than 512 characters 2751 would violate the provisions of Section 4.5.3.1.4. 2753 501 Syntax error in command or arguments. In order to provide for 2754 future extensions, commands that are specified in this document as 2755 not accepting arguments (DATA, RSET, QUIT) SHOULD return a 501 2756 message if arguments are supplied in the absence of EHLO- 2757 advertised extensions. 2759 421 Service shutting down and closing transmission channel 2761 Specific sequences are: 2763 CONNECTION ESTABLISHMENT 2765 - S: 220 2766 E: 521, 554, 556 2768 EHLO or HELO 2770 - S: 250 2771 E: 504 (a conforming implementation could return this code only 2772 in fairly obscure cases), 550, 502 (permitted only with an old- 2773 style server that does not support EHLO) 2775 MAIL 2777 - S: 250 2778 E: 552, 451, 452, 550, 553, 503, 455, 555 2780 RCPT 2782 - S: 250, 251 (but see Section 3.4.1 for discussion of 251 and 2783 551) 2784 E: 550, 551, 552 (obsolete for "too many recipients; see 2785 Section 4.5.3.1.10), 553, 450, 451, 452, 503, 455, 555 2787 DATA 2789 - I: 354 -> data -> S: 250 2791 o E: 552, 554, 451, 452 2793 o E: 450, 550 (rejections for policy reasons) 2795 - E: 503, 554 2797 RSET 2799 - S: 250 2801 VRFY 2803 - S: 250, 251, 252 2804 E: 550, 551, 553, 502, 504 2806 EXPN 2807 - S: 250, 252 2808 E: 550, 500, 502, 504 2810 HELP 2812 - S: 211, 214 2813 E: 502, 504 2815 NOOP 2817 - S: 250 2819 QUIT 2821 - S: 221 2823 4.4. Trace Information 2825 Trace information is used to provide an audit trail of message 2826 handling. In addition, it indicates a route back to the sender of 2827 the message. 2829 4.4.1. Received Header Field 2831 When an SMTP server receives a message for delivery or further 2832 processing, it MUST insert trace (often referred to as "time stamp" 2833 or "Received" information) at the beginning of the message content, 2834 as discussed in Section 4.1.1.4. 2836 This line MUST be structured as follows: 2838 * The FROM clause, which MUST be supplied in an SMTP environment, 2839 SHOULD contain both (1) the name of the source host as presented 2840 in the EHLO command and (2) an address literal containing the IP 2841 address of the source, determined from the TCP connection. 2843 * The ID clause MAY contain an "@" as suggested in RFC 822, but this 2844 is not required. 2846 * If the FOR clause appears, it MUST contain exactly one 2847 entry, even when multiple RCPT commands have been given. Multiple 2848 s raise some security issues and have been deprecated, see 2849 Section 7.2. 2851 An Internet mail program MUST NOT change or delete a Received: line 2852 that was previously added to the message header section. SMTP 2853 servers MUST prepend Received lines to messages; they MUST NOT change 2854 the order of existing lines or insert Received lines in any other 2855 location. 2857 As the Internet grows, comparability of Received header fields is 2858 important for detecting problems, especially slow relays. SMTP 2859 servers that create Received header fields SHOULD use explicit 2860 offsets in the dates (e.g., -0800), rather than time zone names of 2861 any type. Local time (with an offset) SHOULD be used rather than UT 2862 when feasible. This formulation allows slightly more information 2863 about local circumstances to be specified. If UT is needed, the 2864 receiver need merely do some simple arithmetic to convert the values. 2865 Use of UT loses information about the time zone-location of the 2866 server. If it is desired to supply a time zone name, it SHOULD be 2867 included in a comment. 2869 When the delivery SMTP server makes the "final delivery" of a 2870 message, it inserts a return-path line at the beginning of the mail 2871 data. This use of return-path is required; mail systems MUST support 2872 it. The return-path line preserves the information in the from the MAIL command. Here, final delivery means the message 2874 has left the SMTP environment. Normally, this would mean it had been 2875 delivered to the destination user or an associated mail drop, but in 2876 some cases it may be further processed and transmitted by another 2877 mail system. 2879 It is possible for the mailbox in the return path to be different 2880 from the actual sender's mailbox, for example, if error responses are 2881 to be delivered to a special error handling mailbox rather than to 2882 the message sender. When mailing lists are involved, this 2883 arrangement is common and useful as a means of directing errors to 2884 the list maintainer rather than the message originator. 2886 The text above implies that the final mail data will begin with a 2887 return path line, followed by one or more time stamp lines. These 2888 lines will be followed by the rest of the mail data: first the 2889 balance of the mail header section and then the body (RFC 5322 [12]). 2891 It is sometimes difficult for an SMTP server to determine whether or 2892 not it is making final delivery since forwarding or other operations 2893 may occur after the message is accepted for delivery. Consequently, 2894 any further (forwarding, gateway, or relay) systems MAY remove the 2895 return path and rebuild the MAIL command as needed to ensure that 2896 exactly one such line appears in a delivered message. 2898 A message-originating SMTP system SHOULD NOT send a message that 2899 already contains a Return-path header field. SMTP servers performing 2900 a relay function MUST NOT inspect the message data, and especially 2901 not to the extent needed to determine if Return-path header fields 2902 are present. SMTP servers making final delivery MAY remove Return- 2903 path header fields before adding their own. 2905 The primary purpose of the Return-path is to designate the address to 2906 which messages indicating non-delivery or other mail system failures 2907 are to be sent. For this to be unambiguous, exactly one return path 2908 SHOULD be present when the message is delivered. Systems using RFC 2909 822 syntax with non-SMTP transports SHOULD designate an unambiguous 2910 address, associated with the transport envelope, to which error 2911 reports (e.g., non-delivery messages) should be sent. 2913 Historical note: Text in RFC 822 that appears to contraindicate the 2914 use of the Return-path header field (or the envelope reverse-path 2915 address from the MAIL command) if the destination for error messages 2916 is not applicable on the Internet. The reverse-path address (as 2917 copied into the Return-path) MUST be used as the target of any mail 2918 containing delivery error messages. 2920 In particular: 2922 * a gateway from SMTP -> elsewhere SHOULD insert a return-path 2923 header field, unless it is known that the "elsewhere" transport 2924 also uses Internet domain addresses and maintains the envelope 2925 sender address separately. 2927 * a gateway from elsewhere -> SMTP SHOULD delete any return-path 2928 header field present in the message, and either copy that 2929 information to the SMTP envelope or combine it with information 2930 present in the envelope of the other transport system to construct 2931 the reverse-path argument to the MAIL command in the SMTP 2932 envelope. 2934 The server must give special treatment to cases in which the 2935 processing following the end of mail data indication is only 2936 partially successful. This could happen if, after accepting several 2937 recipients and the mail data, the SMTP server finds that the mail 2938 data could be successfully delivered to some, but not all, of the 2939 recipients. In such cases, the response to the DATA command MUST be 2940 an OK reply. However, the SMTP server MUST compose and send an 2941 "undeliverable mail" notification message to the originator of the 2942 message. 2944 The time stamp line and the return path line are formally defined as 2945 follows (the definitions for "FWS" and "CFWS" appear in RFC 5322 2946 [12]): 2948 Return-path-line = "Return-Path:" FWS Reverse-path 2950 Time-stamp-line = "Received:" FWS Stamp 2952 Stamp = From-domain By-domain Opt-info [CFWS] ";" 2953 FWS date-time 2954 ; where "date-time" is as defined in RFC 5322 [12] 2955 ; but the "obs-" forms, especially two-digit 2956 ; years, are prohibited in SMTP and MUST NOT be used. 2958 From-domain = "FROM" FWS Extended-Domain 2960 By-domain = CFWS "BY" FWS Extended-Domain 2962 Extended-Domain = Domain / 2963 ( Domain FWS "(" TCP-info ")" ) / 2964 ( address-literal FWS "(" TCP-info ")" ) 2966 TCP-info = address-literal / ( Domain FWS address-literal ) 2967 ; Information derived by server from TCP connection 2968 ; not client EHLO. 2970 Opt-info = [Via] [With] [ID] [For] 2971 [Additional-Registered-Clauses] 2973 Via = CFWS "VIA" FWS Link 2975 With = CFWS "WITH" FWS Protocol 2977 ID = CFWS "ID" FWS ( Atom / msg-id ) 2978 ; msg-id is defined in RFC 5322 [12] 2980 For = CFWS "FOR" FWS ( Path / Mailbox ) 2982 Additional-Registered-Clauses = 1* (CFWS Atom FWS String) 2984 // [5321bis] 5321 errata #1683, 20090215, 2985 ; Additional standard clauses may be added in this 2986 ; location by future standards and registration with 2987 ; IANA. SMTP servers SHOULD NOT use unregistered 2988 ; names. See Section 8. 2990 Link = "TCP" / Addtl-Link 2991 Addtl-Link = Atom 2992 ; Additional standard names for links are 2993 ; registered with the Internet Assigned Numbers 2994 ; Authority (IANA). "Via" is primarily of value 2995 ; with non-Internet transports. SMTP servers 2996 ; SHOULD NOT use unregistered names. 2998 Protocol = "ESMTP" / "SMTP" / Attdl-Protocol 3000 Addtl-Protocol = Atom 3001 ; Additional standard names for protocols are 3002 ; registered with the Internet Assigned Numbers 3003 ; Authority (IANA) in the "mail parameters" 3004 ; registry [8]. SMTP servers SHOULD NOT 3005 ; use unregistered names. 3007 4.5. Additional Implementation Issues 3009 4.5.1. Minimum Implementation 3011 In order to make SMTP workable, the following minimum implementation 3012 MUST be provided by all receivers. The following commands MUST be 3013 supported to conform to this specification: 3015 EHLO 3016 HELO 3017 MAIL 3018 RCPT 3019 DATA 3020 RSET 3021 NOOP 3022 QUIT 3023 VRFY 3025 Any system that includes an SMTP server supporting mail relaying or 3026 delivery MUST support the reserved mailbox "postmaster" as a case- 3027 insensitive local name. This postmaster address is not strictly 3028 necessary if the server always returns 554 on connection opening (as 3029 described in Section 3.1). The requirement to accept mail for 3030 postmaster implies that RCPT commands that specify a mailbox for 3031 postmaster at any of the domains for which the SMTP server provides 3032 mail service, as well as the special case of "RCPT TO:" 3033 (with no domain specification), MUST be supported. 3035 SMTP systems are expected to make every reasonable effort to accept 3036 mail directed to Postmaster from any other system on the Internet. 3037 In extreme cases -- such as to contain a denial of service attack or 3038 other breach of security -- an SMTP server may block mail directed to 3039 Postmaster. However, such arrangements SHOULD be narrowly tailored 3040 so as to avoid blocking messages that are not part of such attacks. 3042 4.5.2. Transparency 3044 Without some provision for data transparency, the character sequence 3045 "." ends the mail text and cannot be sent by the user. 3046 In general, users are not aware of such "forbidden" sequences. To 3047 allow all user composed text to be transmitted transparently, the 3048 following procedures are used: 3050 * Before sending a line of mail text, the SMTP client checks the 3051 first character of the line. If it is a period, one additional 3052 period is inserted at the beginning of the line. 3054 * When a line of mail text is received by the SMTP server, it checks 3055 the line. If the line is composed of a single period, it is 3056 treated as the end of mail indicator. If the first character is a 3057 period and there are other characters on the line, the first 3058 character is deleted. 3060 The mail data may contain any of the 128 ASCII characters. All 3061 characters are to be delivered to the recipient's mailbox, including 3062 spaces, vertical and horizontal tabs, and other control characters. 3063 If the transmission channel provides an 8-bit byte (octet) data 3064 stream, the 7-bit ASCII codes are transmitted, right justified, in 3065 the octets, with the high-order bits cleared to zero. See 3066 Section 3.6 for special treatment of these conditions in SMTP systems 3067 serving a relay function. 3069 In some systems, it may be necessary to transform the data as it is 3070 received and stored. This may be necessary for hosts that use a 3071 different character set than ASCII as their local character set, that 3072 store data in records rather than strings, or which use special 3073 character sequences as delimiters inside mailboxes. If such 3074 transformations are necessary, they MUST be reversible, especially if 3075 they are applied to mail being relayed. 3077 4.5.3. Sizes and Timeouts 3078 4.5.3.1. Size Limits and Minimums 3080 There are several objects that have required minimum/maximum sizes. 3081 Every implementation MUST be able to receive objects of at least 3082 these sizes. Objects larger than these sizes SHOULD be avoided when 3083 possible. However, some Internet mail constructs such as encoded 3084 X.400 addresses (RFC 2156 [27]) will often require larger objects. 3085 Clients MAY attempt to transmit these, but MUST be prepared for a 3086 server to reject them if they cannot be handled by it. To the 3087 maximum extent possible, implementation techniques that impose no 3088 limits on the length of these objects should be used. 3090 Extensions to SMTP may involve the use of characters that occupy more 3091 than a single octet each. This section therefore specifies lengths 3092 in octets where absolute lengths, rather than character counts, are 3093 intended. 3095 4.5.3.1.1. Local-part 3097 The maximum total length of a user name or other local-part is 64 3098 octets. 3100 4.5.3.1.2. Domain 3102 The maximum total length of a domain name or number is 255 octets. 3104 4.5.3.1.3. Path 3106 The maximum total length of a reverse-path or forward-path is 256 3107 octets (including the punctuation and element separators). 3109 4.5.3.1.4. Command Line 3111 The maximum total length of a command line including the command word 3112 and the is 512 octets. SMTP extensions may be used to 3113 increase this limit. 3115 4.5.3.1.5. Reply Line 3117 The maximum total length of a reply line including the reply code and 3118 the is 512 octets. More information may be conveyed through 3119 multiple-line replies. 3121 4.5.3.1.6. Text Line 3123 The maximum total length of a text line including the is 1000 3124 octets (not counting the leading dot duplicated for transparency). 3125 This number may be increased by the use of SMTP Service Extensions. 3127 4.5.3.1.7. Message Content 3129 The maximum total length of a message content (including any message 3130 header section as well as the message body) MUST BE at least 64K 3131 octets. Since the introduction of Internet Standards for multimedia 3132 mail (RFC 2045 [25]), message lengths on the Internet have grown 3133 dramatically, and message size restrictions should be avoided if at 3134 all possible. SMTP server systems that must impose restrictions 3135 SHOULD implement the "SIZE" service extension of RFC 1870 [6], and 3136 SMTP client systems that will send large messages SHOULD utilize it 3137 when possible. 3139 4.5.3.1.8. Recipient Buffer 3141 The minimum total number of recipients that MUST be buffered is 100 3142 recipients. Rejection of messages (for excessive recipients) with 3143 fewer than 100 RCPT commands is a violation of this specification. 3144 The general principle that relaying SMTP server MUST NOT, and 3145 delivery SMTP servers SHOULD NOT, perform validation tests on message 3146 header fields suggests that messages SHOULD NOT be rejected based on 3147 the total number of recipients shown in header fields. A server that 3148 imposes a limit on the number of recipients MUST behave in an orderly 3149 fashion, such as rejecting additional addresses over its limit rather 3150 than silently discarding addresses previously accepted. A client 3151 that needs to deliver a message containing over 100 RCPT commands 3152 SHOULD be prepared to transmit in 100-recipient "chunks" if the 3153 server declines to accept more than 100 recipients in a single 3154 message. 3156 4.5.3.1.9. Treatment When Limits Exceeded 3158 Errors due to exceeding these limits may be reported by using the 3159 reply codes. Some examples of reply codes are: 3161 500 Line too long. 3163 or 3165 501 Path too long 3167 or 3169 452 Too many recipients (see below) 3171 or 3173 552 Too much mail data (historically also used for too many 3174 recipients (see below). 3176 4.5.3.1.10. Too Many Recipients Code 3178 RFC 821 [3] incorrectly listed the error where an SMTP server 3179 exhausts its implementation limit on the number of RCPT commands 3180 ("too many recipients") as having reply code 552. The correct reply 3181 code for this condition is 452. At the time RFC 5321 was written, 3182 the use of response code 552 by servers was sufficiently common that 3183 client implementation were advised to simply treat it as if 452 had 3184 been sent. That advice is no longer necessary or useful. 3186 When a conforming SMTP server encounters this condition, it has at 3187 least 100 successful RCPT commands in its recipient buffer. If the 3188 server is able to accept the message, then at least these 100 3189 addresses will be removed from the SMTP client's queue. When the 3190 client attempts retransmission of those addresses that received 452 3191 responses, at least 100 of these will be able to fit in the SMTP 3192 server's recipient buffer. Each retransmission attempt that is able 3193 to deliver anything will be able to dispose of at least 100 of these 3194 recipients. 3196 If an SMTP server has an implementation limit on the number of RCPT 3197 commands and this limit is exhausted, it MUST use a response code of 3198 452. If the server has a configured site-policy limitation on the 3199 number of RCPT commands, it MAY instead use a 5yz response code. In 3200 particular, if the intent is to prohibit messages with more than a 3201 site-specified number of recipients, rather than merely limit the 3202 number of recipients in a given mail transaction, it would be 3203 reasonable to return a 503 response to any DATA command received 3204 subsequent to the 452 code or to simply return the 503 after DATA 3205 without returning any previous negative response. 3207 4.5.3.2. Timeouts 3209 An SMTP client MUST provide a timeout mechanism. It MUST use per- 3210 command timeouts rather than somehow trying to time the entire mail 3211 transaction. Timeouts SHOULD be easily reconfigurable, preferably 3212 without recompiling the SMTP code. To implement this, a timer is set 3213 for each SMTP command and for each buffer of the data transfer. The 3214 latter means that the overall timeout is inherently proportional to 3215 the size of the message. 3217 Based on extensive experience with busy mail-relay hosts, the minimum 3218 per-command timeout values SHOULD be as follows: 3220 4.5.3.2.1. Initial 220 Message: 5 Minutes 3222 An SMTP client process needs to distinguish between a failed TCP 3223 connection and a delay in receiving the initial 220 greeting message. 3224 Many SMTP servers accept a TCP connection but delay delivery of the 3225 220 message until their system load permits more mail to be 3226 processed. 3228 4.5.3.2.2. MAIL Command: 5 Minutes 3230 4.5.3.2.3. RCPT Command: 5 Minutes 3232 A longer timeout is required if processing of mailing lists and 3233 aliases is not deferred until after the message was accepted. 3235 4.5.3.2.4. DATA Initiation: 2 Minutes 3237 This is while awaiting the "354 Start Input" reply to a DATA command. 3239 4.5.3.2.5. Data Block: 3 Minutes 3241 This is while awaiting the completion of each TCP SEND call 3242 transmitting a chunk of data. 3244 4.5.3.2.6. DATA Termination: 10 Minutes. 3246 This is while awaiting the "250 OK" reply. When the receiver gets 3247 the final period terminating the message data, it typically performs 3248 processing to deliver the message to a user mailbox. A spurious 3249 timeout at this point would be very wasteful and would typically 3250 result in delivery of multiple copies of the message, since it has 3251 been successfully sent and the server has accepted responsibility for 3252 delivery. See Section 6.1 for additional discussion. 3254 4.5.3.2.7. Server Timeout: 5 Minutes. 3256 An SMTP server SHOULD have a timeout of at least 5 minutes while it 3257 is awaiting the next command from the sender. 3259 4.5.4. Retry Strategies 3261 The common structure of a host SMTP implementation includes user 3262 mailboxes, one or more areas for queuing messages in transit, and one 3263 or more daemon processes for sending and receiving mail. The exact 3264 structure will vary depending on the needs of the users on the host 3265 and the number and size of mailing lists supported by the host. We 3266 describe several optimizations that have proved helpful, particularly 3267 for mailers supporting high traffic levels. 3269 Any queuing strategy MUST include timeouts on all activities on a 3270 per-command basis. A queuing strategy MUST NOT send error messages 3271 in response to error messages under any circumstances. 3273 4.5.4.1. Sending Strategy 3275 The general model for an SMTP client is one or more processes that 3276 periodically attempt to transmit outgoing mail. In a typical system, 3277 the program that composes a message has some method for requesting 3278 immediate attention for a new piece of outgoing mail, while mail that 3279 cannot be transmitted immediately MUST be queued and periodically 3280 retried by the sender. A mail queue entry will include not only the 3281 message itself but also the envelope information. 3283 The sender MUST delay retrying a particular destination after one 3284 attempt has failed. In general, the retry interval SHOULD be at 3285 least 30 minutes; however, more sophisticated and variable strategies 3286 will be beneficial when the SMTP client can determine the reason for 3287 non-delivery. 3289 Retries continue until the message is transmitted or the sender gives 3290 up; the give-up time generally needs to be at least 4-5 days. It MAY 3291 be appropriate to set a shorter maximum number of retries for non- 3292 delivery notifications and equivalent error messages than for 3293 standard messages. The parameters to the retry algorithm MUST be 3294 configurable. 3296 A client SHOULD keep a list of hosts it cannot reach and 3297 corresponding connection timeouts, rather than just retrying queued 3298 mail items. 3300 Experience suggests that failures are typically transient (the target 3301 system or its connection has crashed), favoring a policy of two 3302 connection attempts in the first hour the message is in the queue, 3303 and then backing off to one every two or three hours. 3305 The SMTP client can shorten the queuing delay in cooperation with the 3306 SMTP server. For example, if mail is received from a particular 3307 address, it is likely that mail queued for that host can now be sent. 3308 Application of this principle may, in many cases, eliminate the 3309 requirement for an explicit "send queues now" function such as ETRN, 3310 RFC 1985 [24]. 3312 The strategy may be further modified as a result of multiple 3313 addresses per host (see below) to optimize delivery time versus 3314 resource usage. 3316 An SMTP client may have a large queue of messages for each 3317 unavailable destination host. If all of these messages were retried 3318 in every retry cycle, there would be excessive Internet overhead and 3319 the sending system would be blocked for a long period. Note that an 3320 SMTP client can generally determine that a delivery attempt has 3321 failed only after a timeout of several minutes, and even a one-minute 3322 timeout per connection will result in a very large delay if retries 3323 are repeated for dozens, or even hundreds, of queued messages to the 3324 same host. 3326 At the same time, SMTP clients SHOULD use great care in caching 3327 negative responses from servers. In an extreme case, if EHLO is 3328 issued multiple times during the same SMTP connection, different 3329 answers may be returned by the server. More significantly, 5yz 3330 responses to the MAIL command MUST NOT be cached. 3332 When a mail message is to be delivered to multiple recipients, and 3333 the SMTP server to which a copy of the message is to be sent is the 3334 same for multiple recipients, then only one copy of the message 3335 SHOULD be transmitted. That is, the SMTP client SHOULD use the 3336 command sequence: MAIL, RCPT, RCPT, ..., RCPT, DATA instead of the 3337 sequence: MAIL, RCPT, DATA, ..., MAIL, RCPT, DATA. However, if there 3338 are very many addresses, a limit on the number of RCPT commands per 3339 MAIL command MAY be imposed. This efficiency feature SHOULD be 3340 implemented. 3342 Similarly, to achieve timely delivery, the SMTP client MAY support 3343 multiple concurrent outgoing mail transactions. However, some limit 3344 may be appropriate to protect the host from devoting all its 3345 resources to mail. 3347 4.5.4.2. Receiving Strategy 3349 The SMTP server SHOULD attempt to keep a pending listen on the SMTP 3350 port (specified by IANA as port 25) at all times. This requires the 3351 support of multiple incoming TCP connections for SMTP. Some limit 3352 MAY be imposed, but servers that cannot handle more than one SMTP 3353 transaction at a time are not in conformance with the intent of this 3354 specification. 3356 As discussed above, when the SMTP server receives mail from a 3357 particular host address, it could activate its own SMTP queuing 3358 mechanisms to retry any mail pending for that host address. 3360 4.5.5. Messages with a Null Reverse-Path 3362 There are several types of notification messages that are required by 3363 existing and proposed Standards to be sent with a null reverse-path, 3364 namely non-delivery notifications as discussed in Section 3.6.1 and 3365 Section 3.6.2, other kinds of Delivery Status Notifications (DSNs, 3366 RFC 3461 [34]), and Message Disposition Notifications (MDNs, RFC 8098 3367 [37]). All of these kinds of messages are notifications about a 3368 previous message, and they are sent to the reverse-path of the 3369 previous mail message. (If the delivery of such a notification 3370 message fails, that usually indicates a problem with the mail system 3371 of the host to which the notification message is addressed. For this 3372 reason, at some hosts the MTA is set up to forward such failed 3373 notification messages to someone who is able to fix problems with the 3374 mail system, e.g., via the postmaster alias.) 3376 All other types of messages (i.e., any message which is not required 3377 by a Standards-Track RFC to have a null reverse-path) SHOULD be sent 3378 with a valid, non-null reverse-path. 3380 Implementers of automated email processors should be careful to make 3381 sure that the various kinds of messages with a null reverse-path are 3382 handled correctly. In particular, such systems SHOULD NOT reply to 3383 messages with a null reverse-path, and they SHOULD NOT add a non-null 3384 reverse-path, or change a null reverse-path to a non-null one, to 3385 such messages when forwarding. 3387 5. Address Resolution and Mail Handling 3389 5.1. Locating the Target Host 3391 Once an SMTP client lexically identifies a domain to which mail will 3392 be delivered for processing (as described in Sections 2.3.5 and 3.6), 3393 a DNS lookup MUST be performed to resolve the domain name (RFC 1035 3394 [4]. The names are required to be fully-qualified domain names 3395 (FQDNs) as discussed in Section 2.3.5. 3397 The lookup first attempts to locate an MX record associated with the 3398 name. If a CNAME record is found, the resulting name is processed as 3399 if it were the initial name. If a non-existent domain error is 3400 returned, this situation MUST be reported as an error. If a 3401 temporary error is returned, the message MUST be queued and retried 3402 later (see Section 4.5.4.1). If an empty list of MXs is returned, 3403 the address is treated as if it was associated with an implicit MX RR 3404 with a preference of 0, pointing to that host. If MX records are 3405 present, but none of them are usable, or the implicit MX is unusable, 3406 this situation MUST be reported as an error. 3408 When the lookup succeeds, the mapping can result in a list of 3409 alternative delivery addresses rather than a single address. This 3410 can be due to multiple MX records, multihoming, or both. To provide 3411 reliable mail transmission, the SMTP client MUST be able to try (and 3412 be prepared to retry) each of the relevant addresses in this list in 3413 order (see below), until a delivery attempt succeeds. However, as 3414 discussed more generally in Section 7.8 there MAY also be a 3415 configurable limit on the number of alternate addresses that can be 3416 tried. In any case, the SMTP client SHOULD try at least two 3417 addresses. 3419 If one or more MX RRs are found for a given name, SMTP systems MUST 3420 NOT utilize any address RRs associated with that name unless they are 3421 located using the MX RRs; the "implicit MX" rule above applies only 3422 if there are no MX records present. If MX records are present, but 3423 none of them are usable, this situation MUST be reported as an error. 3424 That domain name also MUST be a primary host name, i.e., it is not 3425 allowed to be an alias. 3427 When a domain name associated with an MX RR is looked up and the 3428 associated data field obtained, the data field of that response MUST 3429 contain a domain name that conforms to the specifications of 3430 Section 2.3.5. 3432 // [[5321bis Editor's Note: Depending on how the "null MX" discussion 3433 // unfolds, some additional text may be in order here (20140718)]] 3434 That domain name, when queried, MUST return at least one address 3435 record (e.g., A or AAAA RR) that gives the IP address of the SMTP 3436 server to which the message should be directed. Any other response, 3437 specifically including a value that will return a CNAME record when 3438 queried, lies outside the scope of this Standard. The prohibition on 3439 labels in the data that resolve to CNAMEs is discussed in more detail 3440 in RFC 2181, Section 10.3 [28]. 3442 Two types of information are used to rank the host addresses: 3443 multiple MX records, and multihomed hosts. 3445 MX records contain a numerical preference indication that MUST be 3446 used in sorting if more than one such record appears. Lower numbers 3447 are more preferred than higher ones. The sender-SMTP MUST inspect 3448 the list for any of the names or addresses by which it might be known 3449 in mail transactions. If a matching record is found, all records at 3450 that preference level and higher-numbered ones MUST be discarded from 3451 consideration. If there are no records left at that point, it is an 3452 error condition, and a 5yz reply code generated (terminating the mail 3453 transaction) or the message MUST be returned as undeliverable. If 3454 there is a single MX record at the most-preferred preference label, 3455 the data field associated with that record is used as the next 3456 destination. Otherwise, if there are multiple records with the same 3457 preference and there is no clear reason to favor one (e.g., by 3458 recognition of an easily reached address), then the sender-SMTP MUST 3459 randomize them to spread the load across multiple mail exchangers for 3460 a specific organization. 3462 The destination host (from either the data field of the preferred MX 3463 record or from an address record found in an implicit MX) may be 3464 multihomed. In those cases the domain name resolver will return a 3465 list of alternative IP addresses. It is the responsibility of the 3466 domain name resolver interface to have ordered this list by 3467 decreasing preference if necessary, and the SMTP sender MUST try them 3468 in the order presented. 3470 Although the capability to try multiple alternative addresses is 3471 required, specific installations may want to limit or disable the use 3472 of alternative addresses. The question of whether a sender should 3473 attempt retries using the different addresses of a multihomed host 3474 has been controversial. The main argument for using the multiple 3475 addresses is that it maximizes the likelihood of timely delivery, and 3476 indeed sometimes the likelihood of any delivery; the counter-argument 3477 is that it may result in unnecessary resource use. Note that 3478 resource use is also strongly determined by the sending strategy 3479 discussed in Section 4.5.4.1. 3481 If an SMTP server receives a message with a destination for which it 3482 is a designated Mail eXchanger, it MAY relay the message (potentially 3483 after having rewritten the MAIL FROM and/or RCPT TO addresses), make 3484 final delivery of the message, or hand it off using some mechanism 3485 outside the SMTP-provided transport environment. Of course, neither 3486 of the latter require that the list of MX records be examined 3487 further. 3489 If it determines that it should relay the message without rewriting 3490 the address, it MUST process the MX records as described above to 3491 determine candidates for delivery. 3493 5.2. IPv6 and MX Records 3495 In the contemporary Internet, SMTP clients and servers may be hosted 3496 on IPv4 systems, IPv6 systems, or dual-stack systems that are 3497 compatible with either version of the Internet Protocol. The host 3498 domains to which MX records point may, consequently, contain "A RR"s 3499 (IPv4), "AAAA RR"s (IPv6), or any combination of them. While RFC 3500 3974 [39] discusses some operational experience in mixed 3501 environments, it was not comprehensive enough to justify 3502 standardization, and some of its recommendations appear to be 3503 inconsistent with this specification. The appropriate actions to be 3504 taken either will depend on local circumstances, such as performance 3505 of the relevant networks and any conversions that might be necessary, 3506 or will be obvious (e.g., an IPv6-only client need not attempt to 3507 look up A RRs or attempt to reach IPv4-only servers). Designers of 3508 SMTP implementations that might run in IPv6 or dual-stack 3509 environments should study the procedures above, especially the 3510 comments about multihomed hosts, and, preferably, provide mechanisms 3511 to facilitate operational tuning and mail interoperability between 3512 IPv4 and IPv6 systems while considering local circumstances. 3514 6. Problem Detection and Handling 3516 6.1. Reliable Delivery and Replies by Email 3518 When the receiver-SMTP accepts a piece of mail (by sending a "250 OK" 3519 message in response to DATA), it is accepting responsibility for 3520 delivering or relaying the message. It must take this responsibility 3521 seriously. It MUST NOT lose the message for frivolous reasons, such 3522 as because the host later crashes or because of a predictable 3523 resource shortage. Some reasons that are not considered frivolous 3524 are discussed in the next subsection and in Section 7.8. 3526 If there is a delivery failure after acceptance of a message, the 3527 receiver-SMTP MUST formulate and mail a notification message. This 3528 notification MUST be sent using a null ("<>") reverse-path in the 3529 envelope. The recipient of this notification MUST be the address 3530 from the envelope return path (or the Return-Path: line). However, 3531 if this address is null ("<>"), the receiver-SMTP MUST NOT send a 3532 notification. Obviously, nothing in this section can or should 3533 prohibit local decisions (i.e., as part of the same system 3534 environment as the receiver-SMTP) to log or otherwise transmit 3535 information about null address events locally if that is desired. 3537 Some delivery failures after the message is accepted by SMTP will be 3538 unavoidable. For example, it may be impossible for the receiving 3539 SMTP server to validate all the delivery addresses in RCPT command(s) 3540 due to a "soft" domain system error, because the target is a mailing 3541 list (see earlier discussion of RCPT), or because the server is 3542 acting as a relay and has no immediate access to the delivering 3543 system. 3545 To avoid receiving duplicate messages as the result of timeouts, a 3546 receiver-SMTP MUST seek to minimize the time required to respond to 3547 the final . end of data indicator. See RFC 1047 [17] for 3548 a discussion of this problem. 3550 6.2. Unwanted, Unsolicited, and "Attack" Messages 3552 Utility and predictability of the Internet mail system requires that 3553 messages that can be delivered should be delivered, regardless of any 3554 syntax or other faults associated with those messages and regardless 3555 of their content. If they cannot be delivered, and cannot be 3556 rejected by the SMTP server during the SMTP transaction, they should 3557 be "bounced" (returned with non-delivery notification messages) as 3558 described above. In today's world, in which many SMTP server 3559 operators have discovered that the quantity of undesirable bulk email 3560 vastly exceeds the quantity of desired mail and in which accepting a 3561 message may trigger additional undesirable traffic by providing 3562 verification of the address, those principles may not be practical. 3564 As discussed in Section 7.8 and Section 7.9 below, dropping mail 3565 without notification of the sender is permitted in practice. 3566 However, it is extremely dangerous and violates a long tradition and 3567 community expectations that mail is either delivered or returned. If 3568 silent message-dropping is misused, it could easily undermine 3569 confidence in the reliability of the Internet's mail systems. So 3570 silent dropping of messages should be considered only in those cases 3571 where there is very high confidence that the messages are seriously 3572 fraudulent or otherwise inappropriate. 3574 To stretch the principle of delivery if possible even further, it may 3575 be a rational policy to not deliver mail that has an invalid return 3576 address, although the history of the network is that users are 3577 typically better served by delivering any message that can be 3578 delivered. Reliably determining that a return address is invalid can 3579 be a difficult and time-consuming process, especially if the putative 3580 sending system is not directly accessible or does not fully and 3581 accurately support VRFY and, even if a "drop messages with invalid 3582 return addresses" policy is adopted, it SHOULD be applied only when 3583 there is near-certainty that the return addresses are, in fact, 3584 invalid. 3586 Conversely, if a message is rejected because it is found to contain 3587 hostile content (a decision that is outside the scope of an SMTP 3588 server as defined in this document), rejection ("bounce") messages 3589 SHOULD NOT be sent unless the receiving site is confident that those 3590 messages will be usefully delivered. The preference and default in 3591 these cases is to avoid sending non-delivery messages when the 3592 incoming message is determined to contain hostile content. 3594 6.3. Loop Detection 3596 Simple counting of the number of "Received:" header fields in a 3597 message has proven to be an effective, although rarely optimal, 3598 method of detecting loops in mail systems. SMTP servers using this 3599 technique SHOULD use a large rejection threshold, normally at least 3600 100 Received entries. Whatever mechanisms are used, servers MUST 3601 contain provisions for detecting and stopping trivial loops. 3603 6.4. Compensating for Irregularities 3605 Unfortunately, variations, creative interpretations, and outright 3606 violations of Internet mail protocols do occur; some would suggest 3607 that they occur quite frequently. The debate as to whether a well- 3608 behaved SMTP receiver or relay should reject a malformed message, 3609 attempt to pass it on unchanged, or attempt to repair it to increase 3610 the odds of successful delivery (or subsequent reply) began almost 3611 with the dawn of structured network mail and shows no signs of 3612 abating. Advocates of rejection claim that attempted repairs are 3613 rarely completely adequate and that rejection of bad messages is the 3614 only way to get the offending software repaired. Advocates of 3615 "repair" or "deliver no matter what" argue that users prefer that 3616 mail go through it if at all possible and that there are significant 3617 market pressures in that direction. In practice, these market 3618 pressures may be more important to particular vendors than strict 3619 conformance to the standards, regardless of the preference of the 3620 actual developers. 3622 The problems associated with ill-formed messages were exacerbated by 3623 the introduction of the split-UA mail reading protocols (Post Office 3624 Protocol (POP) version 2 [14], Post Office Protocol (POP) version 3 3625 [23], IMAP version 2 [19], and PCMAIL [18]). These protocols 3626 encouraged the use of SMTP as a posting (message submission) 3627 protocol, and SMTP servers as relay systems for these client hosts 3628 (which are often only intermittently connected to the Internet). 3629 Historically, many of those client machines lacked some of the 3630 mechanisms and information assumed by SMTP (and indeed, by the mail 3631 format protocol, RFC 822 [13]). Some could not keep adequate track 3632 of time; others had no concept of time zones; still others could not 3633 identify their own names or addresses; and, of course, none could 3634 satisfy the assumptions that underlay RFC 822's conception of 3635 authenticated addresses. 3637 In response to these weak SMTP clients, many SMTP systems now 3638 complete messages that are delivered to them in incomplete or 3639 incorrect form. This strategy is generally considered appropriate 3640 when the server can identify or authenticate the client, and there 3641 are prior agreements between them. By contrast, there is at best 3642 great concern about fixes applied by a relay or delivery SMTP server 3643 that has little or no knowledge of the user or client machine. Many 3644 of these issues are addressed by using a separate protocol, such as 3645 that defined in RFC 6409 [41], for message submission, rather than 3646 using originating SMTP servers for that purpose. 3648 The following changes to a message being processed MAY be applied 3649 when necessary by an originating SMTP server, or one used as the 3650 target of SMTP as an initial posting (message submission) protocol: 3652 * Addition of a message-id field when none appears 3654 * Addition of a date, time, or time zone when none appears 3656 * Correction of addresses to proper FQDN format 3658 The less information the server has about the client, the less likely 3659 these changes are to be correct and the more caution and conservatism 3660 should be applied when considering whether or not to perform fixes 3661 and how. These changes MUST NOT be applied by an SMTP server that 3662 provides an intermediate relay function. 3664 In all cases, properly operating clients supplying correct 3665 information are preferred to corrections by the SMTP server. In all 3666 cases, documentation SHOULD be provided in trace header fields and/or 3667 header field comments for actions performed by the servers. 3669 7. Security Considerations 3671 7.1. Mail Security and Spoofing 3673 SMTP mail is inherently insecure in that it is feasible for even 3674 fairly casual users to negotiate directly with receiving and relaying 3675 SMTP servers and create messages that will trick a naive recipient 3676 into believing that they came from somewhere else. Constructing such 3677 a message so that the "spoofed" behavior cannot be detected by an 3678 expert is somewhat more difficult, but not sufficiently so as to be a 3679 deterrent to someone who is determined and knowledgeable. 3680 Consequently, as knowledge of Internet mail increases, so does the 3681 knowledge that SMTP mail inherently cannot be authenticated, or 3682 integrity checks provided, at the transport level. Real mail 3683 security lies only in end-to-end methods involving the message 3684 bodies, such as those that use digital signatures (see RFC 1847 [21] 3685 and, e.g., Pretty Good Privacy (PGP) in RFC 4880 [42] or Secure/ 3686 Multipurpose Internet Mail Extensions (S/MIME) in RFC 8551 [38]). 3688 Various protocol extensions and configuration options that provide 3689 authentication at the transport level (e.g., from an SMTP client to 3690 an SMTP server) improve somewhat on the traditional situation 3691 described above. However, in general, they only authenticate one 3692 server to another rather than a chain of relays and servers, much 3693 less authenticating users or user machines. Consequently, unless 3694 they are accompanied by careful handoffs of responsibility in a 3695 carefully designed trust environment, they remain inherently weaker 3696 than end-to-end mechanisms that use digitally signed messages rather 3697 than depending on the integrity of the transport system. 3699 Efforts to make it more difficult for users to set envelope return 3700 path and header "From" fields to point to valid addresses other than 3701 their own are largely misguided: they frustrate legitimate 3702 applications in which mail is sent by one user on behalf of another, 3703 in which error (or normal) replies should be directed to a special 3704 address, or in which a single message is sent to multiple recipients 3705 on different hosts. (Systems that provide convenient ways for users 3706 to alter these header fields on a per-message basis should attempt to 3707 establish a primary and permanent mailbox address for the user so 3708 that Sender header fields within the message data can be generated 3709 sensibly.) 3711 This specification does not further address the authentication issues 3712 associated with SMTP other than to advocate that useful functionality 3713 not be disabled in the hope of providing some small margin of 3714 protection against a user who is trying to fake mail. 3716 7.2. "Blind" Copies 3718 Addresses that do not appear in the message header section may appear 3719 in the RCPT commands to an SMTP server for a number of reasons. The 3720 two most common involve the use of a mailing address as a "list 3721 exploder" (a single address that resolves into multiple addresses) 3722 and the appearance of "blind copies". Especially when more than one 3723 RCPT command is present, and in order to avoid defeating some of the 3724 purpose of these mechanisms, SMTP clients and servers SHOULD NOT copy 3725 the full set of RCPT command arguments into the header section, 3726 either as part of trace header fields or as informational or private- 3727 extension header fields. 3728 // [rfc5321bis] [[Note in draft - Suggestion from 20070124 that got 3729 // lost: delete "especially" and "the full set of" -- copying the 3730 // first one can be as harmful as copying all of them, at least 3731 // without verifying that the addresses do appear in the headers. 3732 // See G.7.9 and ticket #15. 3733 Because this rule is often violated in practice, and cannot be 3734 enforced, sending SMTP systems that are aware of "bcc" use MAY find 3735 it helpful to send each blind copy as a separate message transaction 3736 containing only a single RCPT command. 3738 There is no inherent relationship between either "reverse" (from the 3739 MAIL command) or "forward" (RCPT) addresses in the SMTP transaction 3740 ("envelope") and the addresses in the header section. Receiving 3741 systems SHOULD NOT attempt to deduce such relationships and use them 3742 to alter the header section of the message for delivery. The popular 3743 "Apparently-to" header field is a violation of this principle as well 3744 as a common source of unintended information disclosure and SHOULD 3745 NOT be used. 3747 7.3. VRFY, EXPN, and Security 3749 As discussed in Section 3.5, individual sites may want to disable 3750 either or both of VRFY or EXPN for security reasons (see below). As 3751 a corollary to the above, implementations that permit this MUST NOT 3752 appear to have verified addresses that are not, in fact, verified. 3753 If a site disables these commands for security reasons, the SMTP 3754 server MUST return a 252 response, rather than a code that could be 3755 confused with successful or unsuccessful verification. 3757 Returning a 250 reply code with the address listed in the VRFY 3758 command after having checked it only for syntax violates this rule. 3759 Of course, an implementation that "supports" VRFY by always returning 3760 550 whether or not the address is valid is equally not in 3761 conformance. 3763 On the public Internet, the contents of mailing lists have become 3764 popular as an address information source for so-called "spammers." 3765 The use of EXPN to "harvest" addresses has increased as list 3766 administrators have installed protections against inappropriate uses 3767 of the lists themselves. However, VRFY and EXPN are still useful for 3768 authenticated users and within an administrative domain. For 3769 example, VRFY and EXPN are useful for performing internal audits of 3770 how email gets routed to check and to make sure no one is 3771 automatically forwarding sensitive mail outside the organization. 3772 Sites implementing SMTP authentication may choose to make VRFY and 3773 EXPN available only to authenticated requestors. Implementations 3774 SHOULD still provide support for EXPN, but sites SHOULD carefully 3775 evaluate the tradeoffs. 3777 Whether disabling VRFY provides any real marginal security depends on 3778 a series of other conditions. In many cases, RCPT commands can be 3779 used to obtain the same information about address validity. On the 3780 other hand, especially in situations where determination of address 3781 validity for RCPT commands is deferred until after the DATA command 3782 is received, RCPT may return no information at all, while VRFY is 3783 expected to make a serious attempt to determine validity before 3784 generating a response code (see discussion above). 3786 7.4. Mail Rerouting Based on the 251 and 551 Response Codes 3788 Before a client uses the 251 or 551 reply codes from a RCPT command 3789 to automatically update its future behavior (e.g., updating the 3790 user's address book), it should be certain of the server's 3791 authenticity. If it does not, it may be subject to a man in the 3792 middle attack. 3794 7.5. Information Disclosure in Announcements 3796 There has been an ongoing debate about the tradeoffs between the 3797 debugging advantages of announcing server type and version (and, 3798 sometimes, even server domain name) in the greeting response or in 3799 response to the HELP command and the disadvantages of exposing 3800 information that might be useful in a potential hostile attack. The 3801 utility of the debugging information is beyond doubt. Those who 3802 argue for making it available point out that it is far better to 3803 actually secure an SMTP server rather than hope that trying to 3804 conceal known vulnerabilities by hiding the server's precise identity 3805 will provide more protection. Sites are encouraged to evaluate the 3806 tradeoff with that issue in mind; implementations SHOULD minimally 3807 provide for making type and version information available in some way 3808 to other network hosts. 3810 7.6. Information Disclosure in Trace Fields 3812 In some circumstances, such as when mail originates from within a LAN 3813 whose hosts are not directly on the public Internet, trace (e.g., 3814 "Received") header fields produced in conformance with this 3815 specification may disclose host names and similar information that 3816 would not normally be available. This ordinarily does not pose a 3817 problem, but sites with special concerns about name disclosure should 3818 be aware of it. Also, the optional FOR clause should be supplied 3819 with caution or not at all when multiple recipients are involved lest 3820 it inadvertently disclose the identities of "blind copy" recipients 3821 to others. 3823 7.7. Information Disclosure in Message Forwarding 3825 As discussed in Section 3.4.1, use of the 251 or 551 reply codes to 3826 identify the replacement address associated with a mailbox may 3827 inadvertently disclose sensitive information. Sites that are 3828 concerned about those issues should ensure that they select and 3829 configure servers appropriately. 3831 7.8. Local Operational Requirements and Resistance to Attacks 3833 In recent years, there has been an increase of attacks on SMTP 3834 servers, either in conjunction with attempts to discover addresses 3835 for sending unsolicited messages or simply to make the servers 3836 inaccessible to others (i.e., as an application-level denial of 3837 service attack). There may also be important local circumstances 3838 that justify departures from some of the limits specified in this 3839 documents especially ones involving maximums or minimums. While the 3840 means of doing so are beyond the scope of this Standard, rational 3841 operational behavior requires that servers be permitted to detect 3842 such attacks and take action to defend themselves. For example, if a 3843 server determines that a large number of RCPT commands are being 3844 sent, most or all with invalid addresses, as part of such an attack, 3845 it would be reasonable for the server to close the connection after 3846 generating an appropriate number of 5yz (normally 550) replies. 3848 7.9. Scope of Operation of SMTP Servers 3850 It is a well-established principle that an SMTP server may refuse to 3851 accept mail for any operational or technical reason that makes sense 3852 to the site providing the server. However, cooperation among sites 3853 and installations makes the Internet possible. If sites take 3854 excessive advantage of the right to reject traffic, the ubiquity of 3855 email availability (one of the strengths of the Internet) will be 3856 threatened; considerable care should be taken and balance maintained 3857 if a site decides to be selective about the traffic it will accept 3858 and process. 3860 In recent years, use of the relay function through arbitrary sites 3861 has been used as part of hostile efforts to hide the actual origins 3862 of mail. Some sites have decided to limit the use of the relay 3863 function to known or identifiable sources, and implementations SHOULD 3864 provide the capability to perform this type of filtering. When mail 3865 is rejected for these or other policy reasons, a 550 code SHOULD be 3866 used in response to EHLO (or HELO), MAIL, or RCPT as appropriate. 3868 8. IANA Considerations 3870 IANA maintains three registries in support of this specification, all 3871 of which were created for RFC 2821 or earlier. This document expands 3872 the third one as specified below. The registry references listed are 3873 as of the time of publication; IANA does not guarantee the locations 3874 associated with the URLs. The registries are as follows: 3876 * The first, "Simple Mail Transfer Protocol (SMTP) Service 3877 Extensions" [49], consists of SMTP service extensions with the 3878 associated keywords, and, as needed, parameters and verbs. 3879 Entries may be made only for service extensions (and associated 3880 keywords, parameters, or verbs) that are defined in Standards- 3881 Track or Experimental RFCs specifically approved by the IESG for 3882 this purpose. 3884 * The second registry, "Address Literal Tags" [50], consists of 3885 "tags" that identify forms of domain literals other than those for 3886 IPv4 addresses (specified in RFC 821 and in this document). The 3887 initial entry in that registry is for IPv6 addresses (specified in 3888 this document). Additional literal types require standardization 3889 before being used; none are anticipated at this time. 3891 * The third, "Mail Transmission Types" [49], established by RFC 821 3892 and renewed by this specification, is a registry of link and 3893 protocol identifiers to be used with the "via" and "with" 3894 subclauses of the time stamp ("Received:" header field) described 3895 in Section 4.4. Link and protocol identifiers in addition to 3896 those specified in this document may be registered only by 3897 standardization or by way of an RFC-documented, IESG-approved, 3898 Experimental protocol extension. This name space is for 3899 identification and not limited in size: the IESG is encouraged to 3900 approve on the basis of clear documentation and a distinct method 3901 rather than preferences about the properties of the method itself. 3902 An additional subsection has been added to the "VIA link types" 3903 and "WITH protocol types" subsections of this registry to contain 3904 registrations of "Additional-registered-clauses" as described 3905 above. The registry will contain clause names, a description, a 3906 summary of the syntax of the associated String, and a reference. 3907 As new clauses are defined, they may, in principle, specify 3908 creation of their own registries if the Strings consist of 3909 reserved terms or keywords rather than less restricted strings. 3910 As with link and protocol identifiers, additional clauses may be 3911 registered only by standardization or by way of an RFC-documented, 3912 IESG-approved, Experimental protocol extension. The additional 3913 clause name space is for identification and is not limited in 3914 size: the IESG is encouraged to approve on the basis of clear 3915 documentation, actual use or strong signs that the clause will be 3916 used, and a distinct requirement rather than preferences about the 3917 properties of the clause itself. 3919 In addition, if additional trace header fields (i.e., in addition to 3920 Return-path and Received) are ever created, those trace fields MUST 3921 be added to the IANA registry established by BCP 90 (RFC 3864) [9] 3922 for use with RFC 5322 [12]. 3924 9. Acknowledgments 3926 Many people contributed to the development of RFCs 2821 and 5321. 3927 Those documents should be consulted for those acknowledgments. 3929 Neither this document nor RFCs 2821 or 5321 would have been possible 3930 without the many contribution and insights of the late Jon Postel. 3931 Those contributions of course include the original specification of 3932 SMTP in RFC 821. A considerable quantity of text from RFC 821 still 3933 appears in this document as do several of Jon's original examples 3934 that have been updated only as needed to reflect other changes in the 3935 specification. 3937 The following filed errata against RFC 5321 that were not rejected at 3938 the time of submission: Jasen Betts, Adrien de Croy Guillaume Fortin- 3939 Debigare Roberto Javier Godoy, David Romerstein, Dominic Sayers, 3940 Rodrigo Speller, Alessandro Vesely, and Brett Watson. Some of those 3941 individuals made additional suggestions after the EMAILCORE WG was 3942 initiated. In addition to the above, several of whom continued to 3943 make other suggestions, specific suggestions that led to corrections 3944 and improvements in early versions of the current specification were 3945 received from Dave Crocker, Ned Freed, Arnt Gulbrandsen, Tony Hansen, 3946 Barry Leiba, Ivar Lumi, Pete Resnick, Hector Santos, Paul Smith and 3947 others. 3949 chetti contributed an analysis that clarified the ABNF productions 3950 that implicitly reference other documents. 3952 The EMAILCORE Working Group was chartered in September 2020 with 3953 Alexey Melnikov and Seth Blank as co-chairs. Todd Herr replaced Seth 3954 Blank early in 2021. Without their leadership and technical 3955 contributions, this document would never have been completed. 3957 10. References 3959 10.1. Normative References 3961 [1] Bradner, S., "Key words for use in RFCs to Indicate 3962 Requirement Levels", BCP 14, RFC 2119, 3963 DOI 10.17487/RFC2119, March 1997, 3964 . 3966 [2] American National Standards Institute (formerly United 3967 States of America Standards Institute), "USA Code for 3968 Information Interchange", ANSI X3.4-1968, 1968. ANSI 3969 X3.4-1968 has been replaced by newer versions with slight 3970 modifications, but the 1968 version remains definitive for 3971 the Internet. 3973 [3] Postel, J., "Simple Mail Transfer Protocol", STD 10, 3974 RFC 821, DOI 10.17487/RFC0821, August 1982, 3975 . 3977 [4] Mockapetris, P., "Domain names - implementation and 3978 specification", STD 13, RFC 1035, DOI 10.17487/RFC1035, 3979 November 1987, . 3981 [5] Braden, R., Ed., "Requirements for Internet Hosts - 3982 Application and Support", STD 3, RFC 1123, 3983 DOI 10.17487/RFC1123, October 1989, 3984 . 3986 [6] Klensin, J., Freed, N., and K. Moore, "SMTP Service 3987 Extension for Message Size Declaration", STD 10, RFC 1870, 3988 DOI 10.17487/RFC1870, November 1995, 3989 . 3991 [7] Vaudreuil, G., "Enhanced Mail System Status Codes", 3992 RFC 3463, DOI 10.17487/RFC3463, January 2003, 3993 . 3995 [8] Newman, C., "ESMTP and LMTP Transmission Types 3996 Registration", RFC 3848, DOI 10.17487/RFC3848, July 2004, 3997 . 3999 [9] Klyne, G., Nottingham, M., and J. Mogul, "Registration 4000 Procedures for Message Header Fields", BCP 90, RFC 3864, 4001 DOI 10.17487/RFC3864, September 2004, 4002 . 4004 [10] Hinden, R. and S. Deering, "IP Version 6 Addressing 4005 Architecture", RFC 4291, DOI 10.17487/RFC4291, February 4006 2006, . 4008 [11] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 4009 Specifications: ABNF", STD 68, RFC 5234, 4010 DOI 10.17487/RFC5234, January 2008, 4011 . 4013 [12] Resnick, P., Ed., "Internet Message Format", RFC 5322, 4014 DOI 10.17487/RFC5322, October 2008, 4015 . 4017 10.2. Informative References 4019 [13] Crocker, D., "STANDARD FOR THE FORMAT OF ARPA INTERNET 4020 TEXT MESSAGES", STD 11, RFC 822, DOI 10.17487/RFC0822, 4021 August 1982, . 4023 [14] Butler, M., Postel, J., Chase, D., Goldberger, J., and J. 4024 Reynolds, "Post Office Protocol: Version 2", RFC 937, 4025 DOI 10.17487/RFC0937, February 1985, 4026 . 4028 [15] Postel, J. and J. Reynolds, "File Transfer Protocol", 4029 STD 9, RFC 959, DOI 10.17487/RFC0959, October 1985, 4030 . 4032 [16] Partridge, C., "Mail routing and the domain system", 4033 STD 10, RFC 974, DOI 10.17487/RFC0974, January 1986, 4034 . 4036 [17] Partridge, C., "Duplicate messages and SMTP", RFC 1047, 4037 DOI 10.17487/RFC1047, February 1988, 4038 . 4040 [18] Lambert, M., "PCMAIL: A distributed mail system for 4041 personal computers", RFC 1056, DOI 10.17487/RFC1056, June 4042 1988, . 4044 [19] Crispin, M., "Interactive Mail Access Protocol: Version 4045 2", RFC 1176, DOI 10.17487/RFC1176, August 1990, 4046 . 4048 [20] Durand, A. and F. Dupont, "SMTP 521 Reply Code", RFC 1846, 4049 DOI 10.17487/RFC1846, September 1995, 4050 . 4052 [21] Galvin, J., Murphy, S., Crocker, S., and N. Freed, 4053 "Security Multiparts for MIME: Multipart/Signed and 4054 Multipart/Encrypted", RFC 1847, DOI 10.17487/RFC1847, 4055 October 1995, . 4057 [22] Klensin, J., Freed, N., Rose, M., Stefferud, E., and D. 4058 Crocker, "SMTP Service Extensions", STD 10, RFC 1869, 4059 DOI 10.17487/RFC1869, November 1995, 4060 . 4062 [23] Myers, J. and M. Rose, "Post Office Protocol - Version 3", 4063 STD 53, RFC 1939, DOI 10.17487/RFC1939, May 1996, 4064 . 4066 [24] De Winter, J., "SMTP Service Extension for Remote Message 4067 Queue Starting", RFC 1985, DOI 10.17487/RFC1985, August 4068 1996, . 4070 [25] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 4071 Extensions (MIME) Part One: Format of Internet Message 4072 Bodies", RFC 2045, DOI 10.17487/RFC2045, November 1996, 4073 . 4075 [26] Moore, K., "MIME (Multipurpose Internet Mail Extensions) 4076 Part Three: Message Header Extensions for Non-ASCII Text", 4077 RFC 2047, DOI 10.17487/RFC2047, November 1996, 4078 . 4080 [27] Kille, S., "MIXER (Mime Internet X.400 Enhanced Relay): 4081 Mapping between X.400 and RFC 822/MIME", RFC 2156, 4082 DOI 10.17487/RFC2156, January 1998, 4083 . 4085 [28] Elz, R. and R. Bush, "Clarifications to the DNS 4086 Specification", RFC 2181, DOI 10.17487/RFC2181, July 1997, 4087 . 4089 [29] Freed, N. and K. Moore, "MIME Parameter Value and Encoded 4090 Word Extensions: Character Sets, Languages, and 4091 Continuations", RFC 2231, DOI 10.17487/RFC2231, November 4092 1997, . 4094 [30] Klensin, J., Ed., "Simple Mail Transfer Protocol", 4095 RFC 2821, DOI 10.17487/RFC2821, April 2001, 4096 . 4098 [31] Freed, N., "SMTP Service Extension for Command 4099 Pipelining", STD 60, RFC 2920, DOI 10.17487/RFC2920, 4100 September 2000, . 4102 [32] Freed, N., "Behavior of and Requirements for Internet 4103 Firewalls", RFC 2979, DOI 10.17487/RFC2979, October 2000, 4104 . 4106 [33] Vaudreuil, G., "SMTP Service Extensions for Transmission 4107 of Large and Binary MIME Messages", RFC 3030, 4108 DOI 10.17487/RFC3030, December 2000, 4109 . 4111 [34] Moore, K., "Simple Mail Transfer Protocol (SMTP) Service 4112 Extension for Delivery Status Notifications (DSNs)", 4113 RFC 3461, DOI 10.17487/RFC3461, January 2003, 4114 . 4116 [35] Moore, K. and G. Vaudreuil, "An Extensible Message Format 4117 for Delivery Status Notifications", RFC 3464, 4118 DOI 10.17487/RFC3464, January 2003, 4119 . 4121 [36] Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4122 4rev1", RFC 3501, DOI 10.17487/RFC3501, March 2003, 4123 . 4125 [37] Hansen, T., Ed. and A. Melnikov, Ed., "Message Disposition 4126 Notification", STD 85, RFC 8098, DOI 10.17487/RFC8098, 4127 February 2017, . 4129 [38] Schaad, J., Ramsdell, B., and S. Turner, "Secure/ 4130 Multipurpose Internet Mail Extensions (S/MIME) Version 4.0 4131 Message Specification", RFC 8551, DOI 10.17487/RFC8551, 4132 April 2019, . 4134 [39] Nakamura, M. and J. Hagino, "SMTP Operational Experience 4135 in Mixed IPv4/v6 Environments", RFC 3974, 4136 DOI 10.17487/RFC3974, January 2005, 4137 . 4139 [40] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 4140 Resource Identifier (URI): Generic Syntax", STD 66, 4141 RFC 3986, DOI 10.17487/RFC3986, January 2005, 4142 . 4144 [41] Gellens, R. and J. Klensin, "Message Submission for Mail", 4145 STD 72, RFC 6409, DOI 10.17487/RFC6409, November 2011, 4146 . 4148 [42] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. 4149 Thayer, "OpenPGP Message Format", RFC 4880, 4150 DOI 10.17487/RFC4880, November 2007, 4151 . 4153 [43] Hansen, T. and J. Klensin, "A Registry for SMTP Enhanced 4154 Mail System Status Codes", BCP 138, RFC 5248, 4155 DOI 10.17487/RFC5248, June 2008, 4156 . 4158 [44] Klensin, J., Freed, N., Rose, M., and D. Crocker, Ed., 4159 "SMTP Service Extension for 8-bit MIME Transport", STD 71, 4160 RFC 6152, DOI 10.17487/RFC6152, March 2011, 4161 . 4163 [45] Klensin, J., "SMTP 521 and 556 Reply Codes", RFC 7504, 4164 DOI 10.17487/RFC7504, June 2015, 4165 . 4167 [46] Levine, J. and M. Delany, "A "Null MX" No Service Resource 4168 Record for Domains That Accept No Mail", RFC 7505, 4169 DOI 10.17487/RFC7505, June 2015, 4170 . 4172 [47] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 4173 DOI 10.17487/RFC5321, October 2008, 4174 . 4176 [48] Klensin, J.C., Ed., Murchison, K., Ed., and E. Sam, Ed., 4177 "Applicability Statement for IETF Core Email Protocols", 6 4178 August 2021, . 4181 [49] Internet Assigned Number Authority (IANA), "IANA Mail 4182 Parameters", 2007, 4183 . 4185 [50] Internet Assigned Number Authority (IANA), "Address 4186 Literal Tags", 2007, 4187 . 4189 [51] RFC Editor, "RFC Errata - RFC 5321", 2019, 4190 . Captured 4191 2019-11-19 4193 [52] IANA, "SMTP Service Extensions", 2021, 4194 . Notes in draft: RFC 4196 Editor: Please adjust date field to reflect whatever you 4197 want for a registry that is updated periodically. IANA: 4198 Please determine if the above URL is a sufficiently stable 4199 reference and adjust as appropriate if it is not. 4201 Appendix A. TCP Transport Service 4203 The TCP connection supports the transmission of 8-bit bytes. The 4204 SMTP data is 7-bit ASCII characters. Each character is transmitted 4205 as an 8-bit byte with the high-order bit cleared to zero. Service 4206 extensions may modify this rule to permit transmission of full 8-bit 4207 data bytes as part of the message body, or, if specifically designed 4208 to do so, in SMTP commands or responses. 4210 Appendix B. Generating SMTP Commands from RFC 822 Header Fields 4212 Some systems use an RFC 822 header section (only) in a mail 4213 submission protocol, or otherwise generate SMTP commands from RFC 822 4214 header fields when such a message is handed to an MTA from a UA. 4215 While the MTA-UA protocol is a private matter, not covered by any 4216 Internet Standard, there are problems with this approach. For 4217 example, there have been repeated problems with proper handling of 4218 "bcc" copies and redistribution lists when information that 4219 conceptually belongs to the mail envelope is not separated early in 4220 processing from header field information (and kept separate). 4222 It is recommended that the UA provide its initial ("submission 4223 client") MTA with an envelope separate from the message itself. 4224 However, if the envelope is not supplied, SMTP commands SHOULD be 4225 generated as follows: 4227 1. Each recipient address from a TO, CC, or BCC header field SHOULD 4228 be copied to a RCPT command (generating multiple message copies 4229 if that is required for queuing or delivery). This includes any 4230 addresses listed in a RFC 822 "group". Any BCC header fields 4231 SHOULD then be removed from the header section. Once this 4232 process is completed, the remaining header fields SHOULD be 4233 checked to verify that at least one TO, CC, or BCC header field 4234 remains. If none do, then a BCC header field with no additional 4235 information SHOULD be inserted as specified in [12]. 4237 2. The return address in the MAIL command SHOULD, if possible, be 4238 derived from the system's identity for the submitting (local) 4239 user, and the "From:" header field otherwise. If there is a 4240 system identity available, it SHOULD also be copied to the Sender 4241 header field if it is different from the address in the From 4242 header field. (Any Sender header field that was already there 4243 SHOULD be removed.) Systems may provide a way for submitters to 4244 override the envelope return address, but may want to restrict 4245 its use to privileged users. This will not prevent mail forgery, 4246 but may lessen its incidence; see Section 7.1. 4248 When an MTA is being used in this way, it bears responsibility for 4249 ensuring that the message being transmitted is valid. The mechanisms 4250 for checking that validity, and for handling (or returning) messages 4251 that are not valid at the time of arrival, are part of the MUA-MTA 4252 interface and not covered by this specification. 4254 A submission protocol based on Standard RFC 822 information alone 4255 MUST NOT be used to gateway a message from a foreign (non-SMTP) mail 4256 system into an SMTP environment. Additional information to construct 4257 an envelope must come from some source in the other environment, 4258 whether supplemental header fields or the foreign system's envelope. 4260 Attempts to gateway messages using only their header "To" and "Cc" 4261 fields have repeatedly caused mail loops and other behavior adverse 4262 to the proper functioning of the Internet mail environment. These 4263 problems have been especially common when the message originates from 4264 an Internet mailing list and is distributed into the foreign 4265 environment using envelope information. When these messages are then 4266 processed by a header-section-only remailer, loops back to the 4267 Internet environment (and the mailing list) are almost inevitable. 4269 Appendix C. Placeholder (formerly Source Routes) 4271 // This entire section has been removed, with some material moved 4272 // into Appendix F.2. This comment is retained as a temporary 4273 // placeholder because the WG, the Ticket list, and various email 4274 // threads refer to Appendix letters and it would not be good to 4275 // create confusion about that while rfc5321bis is under development. 4277 Appendix D. Scenarios 4279 This section presents complete scenarios of several types of SMTP 4280 sessions. In the examples, "C:" indicates what is said by the SMTP 4281 client, and "S:" indicates what is said by the SMTP server. 4283 D.1. A Typical SMTP Transaction Scenario 4285 This SMTP example shows mail sent by Smith at host bar.com, and to 4286 Jones, Green, and Brown at host foo.com. Here we assume that host 4287 bar.com contacts host foo.com directly. The mail is accepted for 4288 Jones and Brown. Green does not have a mailbox at host foo.com. 4290 S: 220 foo.com Simple Mail Transfer Service Ready 4291 C: EHLO bar.com 4292 S: 250-foo.com greets bar.com 4293 S: 250-8BITMIME 4294 S: 250-SIZE 4295 S: 250-DSN 4296 S: 250 HELP 4297 C: MAIL FROM: 4298 S: 250 OK 4299 C: RCPT TO: 4300 S: 250 OK 4301 C: RCPT TO: 4302 S: 550 No such user here 4303 C: RCPT TO: 4304 S: 250 OK 4305 C: DATA 4306 S: 354 Start mail input; end with . 4307 C: Blah blah blah... 4308 C: ...etc. etc. etc. 4309 C: . 4310 S: 250 OK 4311 C: QUIT 4312 S: 221 foo.com Service closing transmission channel 4314 D.2. Aborted SMTP Transaction Scenario 4315 S: 220 foo.com Simple Mail Transfer Service Ready 4316 C: EHLO bar.com 4317 S: 250-foo.com greets bar.com 4318 S: 250-8BITMIME 4319 S: 250-SIZE 4320 S: 250-DSN 4321 S: 250 HELP 4322 C: MAIL FROM: 4323 S: 250 OK 4324 C: RCPT TO: 4325 S: 250 OK 4326 C: RCPT TO: 4327 S: 550 No such user here 4328 C: RSET 4329 S: 250 OK 4330 C: QUIT 4331 S: 221 foo.com Service closing transmission channel 4333 D.3. Relayed Mail Scenario 4335 Step 1 -- Source Host to Relay Host 4336 The source host performs a DNS lookup on XYZ.COM (the destination 4337 address) and finds DNS MX records specifying xyz.com as the best 4338 preference and foo.com as a lower preference. It attempts to open a 4339 connection to xyz.com and fails. It then opens a connection to 4340 foo.com, with the following dialogue: 4342 S: 220 foo.com Simple Mail Transfer Service Ready 4343 C: EHLO bar.com 4344 S: 250-foo.com greets bar.com 4345 S: 250-8BITMIME 4346 S: 250-SIZE 4347 S: 250-DSN 4348 S: 250 HELP 4349 C: MAIL FROM: 4350 S: 250 OK 4351 C: RCPT TO: 4352 S: 250 OK 4353 C: DATA 4354 S: 354 Start mail input; end with . 4355 C: Date: Thu, 21 May 1998 05:33:29 -0700 4356 C: From: John Q. Public 4357 C: Subject: The Next Meeting of the Board 4358 C: To: Jones@xyz.com 4359 C: 4360 C: Bill: 4361 C: The next meeting of the board of directors will be 4362 C: on Tuesday. 4363 C: John. 4364 C: . 4365 S: 250 OK 4366 C: QUIT 4367 S: 221 foo.com Service closing transmission channel 4369 Step 2 -- Relay Host to Destination Host 4370 foo.com, having received the message, now does a DNS lookup on 4371 xyz.com. It finds the same set of MX records, but cannot use the one 4372 that points to itself (or to any other host as a worse preference). 4373 It tries to open a connection to xyz.com itself and succeeds. Then 4374 we have: 4376 S: 220 xyz.com Simple Mail Transfer Service Ready 4377 C: EHLO foo.com 4378 S: 250 xyz.com is on the air 4379 C: MAIL FROM: 4380 S: 250 OK 4381 C: RCPT TO: 4382 S: 250 OK 4383 C: DATA 4384 S: 354 Start mail input; end with . 4385 C: Received: from bar.com by foo.com ; Thu, 21 May 1998 4386 C: 05:33:29 -0700 4387 C: Date: Thu, 21 May 1998 05:33:29 -0700 4388 C: From: John Q. Public 4389 C: Subject: The Next Meeting of the Board 4390 C: To: Jones@xyz.com 4391 C: 4392 C: Bill: 4393 C: The next meeting of the board of directors will be 4394 C: on Tuesday. 4395 C: John. 4396 C: . 4397 S: 250 OK 4398 C: QUIT 4399 S: 221 xyz.com Service closing transmission channel 4401 D.4. Verifying and Sending Scenario 4402 S: 220 foo.com Simple Mail Transfer Service Ready 4403 C: EHLO bar.com 4404 S: 250-foo.com greets bar.com 4405 S: 250-8BITMIME 4406 S: 250-SIZE 4407 S: 250-DSN 4408 S: 250-VRFY 4409 S: 250 HELP 4410 C: VRFY Crispin 4411 S: 250 Mark Crispin 4412 C: MAIL FROM: 4413 S: 250 OK 4414 C: RCPT TO: 4415 S: 250 OK 4416 C: DATA 4417 S: 354 Start mail input; end with . 4418 C: Blah blah blah... 4419 C: ...etc. etc. etc. 4420 C: . 4421 S: 250 OK 4422 C: QUIT 4423 S: 221 foo.com Service closing transmission channel 4425 Appendix E. Other Gateway Issues 4427 In general, gateways between the Internet and other mail systems 4428 SHOULD attempt to preserve any layering semantics across the 4429 boundaries between the two mail systems involved. Gateway- 4430 translation approaches that attempt to take shortcuts by mapping 4431 (such as mapping envelope information from one system to the message 4432 header section or body of another) have generally proven to be 4433 inadequate in important ways. Systems translating between 4434 environments that do not support both envelopes and a header section 4435 and Internet mail must be written with the understanding that some 4436 information loss is almost inevitable. 4438 Appendix F. Deprecated Features of RFC 821 4440 A few features of RFC 821 have proven to be problematic and SHOULD 4441 NOT be used in Internet mail. Some of these features were deprecated 4442 in RFC 2821 in 2001; source routing and two-digit years in dates were 4443 deprecated even earlier, by RFC 1123 in 1989. Of the domain literal 4444 forms, RFC 1123 required support only for the dotted decimal form. 4445 With the possible exception of old, hardware-embedded, applications, 4446 there is no longer any excuse for these features to appear on the 4447 contemporary Internet. 4449 F.1. TURN 4451 This command, described in RFC 821, raises important security issues 4452 since, in the absence of strong authentication of the host requesting 4453 that the client and server switch roles, it can easily be used to 4454 divert mail from its correct destination. Its use is deprecated; 4455 SMTP systems SHOULD NOT use it unless the server can authenticate the 4456 client. 4458 F.2. Source Routing 4460 RFC 821 utilized the concept of explicit source routing to get mail 4461 from one host to another via a series of relays. Source routes could 4462 appear in either the or to show the 4463 hosts through which mail would be routed to reach the destination. 4464 The requirement to utilize source routes in regular mail traffic was 4465 eliminated by the introduction of the domain name system "MX" record 4466 by RFC 974 in early 1986 and the last significant justification for 4467 them was eliminated by the introduction, in RFC 1123, of a clear 4468 requirement that addresses following an "@" must all be fully- 4469 qualified domain names. Issues involving local aliases for mailboxes 4470 were addressed by the introduction of a separate specification for 4471 mail submission [41]. Consequently, there are no remaining 4472 justifications for the use of source routes other than support for 4473 very old SMTP clients. Even use in mail system debugging is unlikely 4474 to work because almost all contemporary systems either ignore or 4475 reject them. 4477 Historically, for relay purposes, the forward-path may have been a 4478 source route of the form "@ONE,@TWO:JOE@THREE", where ONE, TWO, and 4479 THREE MUST be fully-qualified domain names. This form was used to 4480 emphasize the distinction between an address and a route. The 4481 mailbox (here, JOE@THREE) is an absolute address, and the route is 4482 information about how to get there. The two concepts should not be 4483 confused. 4485 SMTP servers MAY continue to accept source route syntax as specified 4486 in this appendix. If they do so, they SHOULD ignore the routes and 4487 utilize only the target domain in the address. If they do utilize 4488 the source route, the message MUST be sent to the first domain shown 4489 in the address. 4491 In particular, a server MUST NOT guess at shortcuts within the source 4492 route. 4494 SMTP clients MUST NOT attempt to utilize explicit source routing. 4496 If source routes appear in mail received by an SMTP server contrary 4497 to the requirements and recommendations in this specification, RFC 4498 821 and the text below should be consulted for the mechanisms for 4499 constructing and updating the forward-path. A server that is reached 4500 by means of a source route (e.g., its domain name appears first in 4501 the list in the forward-path) MUST remove its domain name from any 4502 forward-paths in which that domain name appears before forwarding the 4503 message and MAY remove all other source routing information. Any 4504 source route information in the reverse-path SHOULD be removed by 4505 servers conforming to this specification. 4507 The following information is provided for historical information so 4508 that the source route syntax and application can be understood if 4509 needed. 4511 Syntax: 4512 The original form of the production in Section 4.1.2 was: 4514 Path = "<" [ A-d-l ":" ] Mailbox ">" 4516 A-d-l = At-domain *( "," At-domain ) 4518 At-domain = "@" Domain 4520 For example, suppose that a delivery service notification must be 4521 sent for a message that arrived with: 4522 MAIL FROM:<@a.example,@b.example:user@d.example> 4523 The notification message MUST be sent using: 4524 RCPT TO: 4526 F.3. HELO 4528 As discussed in Sections 3.1 and 4.1.1, EHLO SHOULD be used rather 4529 than HELO when the server will accept the former. Servers MUST 4530 continue to accept and process HELO in order to support older 4531 clients. 4533 F.4. #-literals 4535 RFC 821 provided for specifying an Internet address as a decimal 4536 integer host number prefixed by a pound sign, "#". In practice, that 4537 form has been obsolete since the introduction of TCP/IP. It is 4538 deprecated and MUST NOT be used. 4540 F.5. Dates and Years 4542 When dates are inserted into messages by SMTP clients or servers 4543 (e.g., in trace header fields), four-digit years MUST BE used. Two- 4544 digit years are deprecated; three-digit years were never permitted in 4545 the Internet mail system. 4547 F.6. Sending versus Mailing 4549 In addition to specifying a mechanism for delivering messages to 4550 user's mailboxes, RFC 821 provided additional, optional, commands to 4551 deliver messages directly to the user's terminal screen. These 4552 commands (SEND, SAML, SOML) were rarely implemented, and changes in 4553 workstation technology and the introduction of other protocols may 4554 have rendered them obsolete even where they are implemented. 4556 Clients SHOULD NOT use SEND, SAML, or SOML commands. If a server 4557 implements them, the implementation model specified in RFC 821 [3] 4558 MUST be used and the command names MUST be published in the response 4559 to the EHLO command. 4561 Appendix G. Other Outstanding Issues 4563 [[RFC Editor: Please remove this section before publication.]] 4565 In December 2019, an issue was raised on the ietf-smtp@ietf.org list 4566 that led to a broad discussion of ways in which existing practice had 4567 diverged from the specifications and recommendations of RFC 5321 in 4568 the more than eleven years since it was published (some of those 4569 issues probably affect the boundary between RFC 5321 and 5322 and 4570 hence the latter as well). In most cases, those divergences call for 4571 revision of the Technical Specification to match the practice, 4572 clarification of the specification text in other ways, or a more 4573 comprehensive explanation of why the practices recommended by the 4574 specification should really be followed. 4576 Those discussions raised two other issues, which were that 4578 * The publication of the Submission Server specification of RFC 6409 4579 in November 2011 may not have been fully reflected in RFC 5321 4580 (despite the even earlier publication of RFC 4409) and 4582 * There may be inconsistencies between the July 2009 Internet Mail 4583 Architecture description of RFC 5598 and the model described in 4584 RFC 5321. The issue called out in Appendix G.3 below may be an 4585 example of one of those inconsistencies. 4587 Those discrepancies should be identified and discussed and decisions 4588 made to fix them (and where) or to ignore them and let them continue. 4590 There has also been discussion on the mailing list, perhaps amounting 4591 to very rough consensus, that any revision of RFC 5321 and/or 5322 4592 should be accompanied by a separate Applicability Statement document 4593 that would make recommendations about applicability or best practices 4594 in particular areas rather than trying to get everything into the two 4595 technical specifications. This appendix does not attempt to identify 4596 which issues should get which treatment. 4598 This work is now (starting in the last half of 2020) being considered 4599 in the EMAILCORE WG. This appendix will act as a temporary record of 4600 issues that should be discussed and decided upon before a revised 4601 SMTP specification (or a related Applicability Statement) is 4602 published, issues that have not been reflected in errata (see 4603 Appendix H.1 below for those covered by errata). 4605 Ticket numbers listed below reference the list in 4606 https://trac.ietf.org/trac/emailcore/report/1 . 4608 G.1. IP Address literals 4610 The specification is unclear about whether IP address literals, 4611 particularly IP address literals used as arguments to the EHLO 4612 command, are required to be accepted or whether they are allowed to 4613 be rejected as part of the general "operational necessity" exception. 4614 Some have suggested that rejection of them is so common as an anti- 4615 spam measure that the use of such literals should be deprecated 4616 entirely in the specification, others that the are still useful and 4617 used and/or that, whatever is said about IP address literals within 4618 an SMTP session (e.g., in MAIL or RCPT commands), they should 4619 continue to be allowed (and required) in EHLO. 4620 Ticket #1 (issue for A/S). 4622 G.2. Repeated Use of EHLO (closed) 4624 While the specification says that an SMTP client's sending EHLO again 4625 after it has been issued (starting an SMTP session and treats it as 4626 if RSET had been sent (closing the session) followed by EHLO, there 4627 are apparently applications, at least some of them involving setting 4628 up of secure connections, in which the second EHLO is required and 4629 does not imply RSET. Does the specification need to be adjusted to 4630 reflect or call out those cases? 4632 After extended discussion in October 2020, it appears that the 4633 easiest fix to these problems is to clarify the conditions for 4634 termination of a mail transaction in Section 3.3 and to clearly 4635 specify the effect of a second (or subsequent) EHLO command in 4636 Section 4.1.4. 4637 See also Appendix G.7.4. 4638 Ticket #2. (closed - Both changes have been made in draft-ietf- 4639 emailcore-rfc5321bis-01). 4641 G.3. Meaning of "MTA" and Related Terminology 4643 A terminology issue has come up about what the term "MTA" actually 4644 refers to, a question that became at least slightly more complicated 4645 when we formalized RFC 6409 Submission Servers. Does the document 4646 need to be adjusted to be more clear about this topic? Note that the 4647 answer may interact with the question asked in Section 2 above. 4648 Possibly along the same lines, RFC 2821 changed the RFC 821 4649 terminology from "sender-SMTP" and "receiver-SMTP" to "SMTP client" 4650 and "SMTP server" respectively. As things have evolved, it is 4651 possible that newer terminology is a source of confusion and that the 4652 terminology should be changed back, something that also needs 4653 discussion. 4654 Ticket #3. 4656 G.4. Originator, or Originating System, Authentication 4658 Should RFC 5321bis address authentication and related issues or 4659 should Section 3.4.2 or other text be reshaped (in addition to or 4660 instead of the comment on that section) to lay a better foundation 4661 for such work, either in the context of mailing lists or more 4662 generally? 4663 This may interact with Erratum 4055 and Ticket #30 below. 4665 G.5. Remove or deprecate the work-around from code 552 to 452 (closed) 4667 The suggestion in Section 4.5.3.1.10 may have outlived its usefulness 4668 and/or be inconsistent with current practice. Should it be removed 4669 and/or explicitly deprecated? 4670 Ticket #5 (fixed and closed). 4672 SHOULD requirement removed. 4674 G.6. Clarify where the protocol stands with respect to submission and 4675 TLS issues 4677 1. submission on port 587 4679 2. submission on port 465 4681 3. TLS relay on a port different from 25 (whenever) 4682 4. Recommendations about general use of transport layer (hop by hop) 4683 security, particularly encryption including consideration of RFC 4684 8314. 4686 G.7. Probably-substantive Discussion Topics Identified in Other Ways 4688 The following issues were identified as a group in the opening Note 4689 but called out specifically only in embedded CREF comments in 4690 versions of this draft prior to the first EMAILCORE version. 4692 G.7.1. Issues with 521, 554, and 556 codes (closed) 4694 See new Section 4.2.4.2. More text may be needed, there or 4695 elsewhere, about choices of codes in response to initial opening and 4696 to EHLO, especially to deal with selective policy rejections. In 4697 particular, should we more strongly discourage the use of 554 on 4698 initial opening. And should we make up a 421 code (or a new 4yz 4699 code, perhaps 454) code for situations where the server is 4700 temporarily out of service? 4701 Ticket #6 (closed). 4703 G.7.2. SMTP Model, terminology, and relationship to RFC 5598 4705 CREF comment in Section 2, CREF comment in Section 2.3.10, and 4706 comments in the introductory portion of Appendix G. 4708 G.7.3. Resolvable FQDNs and private domain names 4710 Multiple CREF comments in Section 2.3.5 4711 Tickets #9 (definition of domain name), #10 (meaning of "resolvable 4712 domain name"; closed 2021-06-12), and #41 (closed -- no change 4713 2021-04-05). 4715 G.7.4. Possible clarification about mail transactions and transaction 4716 state 4718 CREF comment in Section 3.3 and also reference in Section 4.1.4 4719 Ticket #11. 4721 // See correspondence on this ticket 2021-07-06 through 2021-07-09. 4723 G.7.5. Issues with mailing lists, aliases, and forwarding 4725 CREF comment in Section 3.4.2. May also want to note forwarding as 4726 an email address portability issue. Note that, if changes are made 4727 in this area, they should be kept consistent with the description and 4728 discussion of the 251 and 551 in Section 4.2 and Section 3.5 as well 4729 as Section 3.4.1 to avoid introducing inconsistencies. In addition, 4730 there are some terminology issues about the use of the term "lists", 4731 identified in erratum 1820, that should be reviewed after any more 4732 substantive changes are made to the relevant sections. 4733 Ticket #12 and Ticket #34 (Ticket #34/ erratum 1820 resolved in -06 4734 and closed). Ticket #61. 4736 G.7.6. Requirements for domain name and/or IP address in EHLO 4738 Text in Section 4.1.4; change made in -05. 4739 Ticket #19 (was ticket #47 -- done in rfc5321bis, more in A/S). 4741 G.7.7. Does the 'first digit only' and/or non-listed reply code text 4742 need clarification? (closed) 4744 Resolved. Text in Section 4.2 changed 2021-02-08 and CREF comment in 4745 Section 4.3.1 removed. 4747 Perhaps unresolved -- ongoing discussion on mailing list after IETF 4748 110. 4749 Ticket #13 (fixed and closed). 4751 G.7.8. Size limits (closed) 4753 Once a decision is made about line length rules for RFC 5322bis, 4754 review the size limit discussions in this document, particularly the 4755 CREF comment (Note in Draft) at the end of the introductory material 4756 to Section 4.5.3 to be sure this document says what we want it to 4757 say. (See the additional question about minimum quantities, etc., in 4758 Appendix G.7.19.) 4759 Ticket #14 (closed - no action) and maybe Ticket #38 (to A/S). 4761 G.7.9. Discussion of 'blind' copies and RCPT 4763 CREF comment in Section 7.2. May also need to discussion whether 4764 that terminology is politically incorrect and suggest a replacement. 4765 Ticket #15. 4767 G.7.10. Further clarifications needed to source routes? 4769 The current text largely deprecates the use of source routes but 4770 suggests that servers continue to support them. 4771 Ticket #17 (Closed 20220125). 4773 G.7.11. Should 1yz Be Revisited? (closed) 4775 RFC 5321 depreciated the "positive preliminary reply" response code 4776 category with first digit "1", so that the first digit of valid SMTP 4777 response codes must be 2, 3, 4, or 5. It has been suggested (see 4778 mail from Hector Santos with Subject "SMTP Reply code 1yz Positive 4779 Preliminary reply", March 5, 2020 12:56 -0500, on the SMTP list) that 4780 these codes should be reinstated to deal with some situations that 4781 became more plausible after 5321 was published. Do we need to take 4782 this up again? 4783 Ticket #18 (no, closed). 4785 G.7.12. Review Timeout Specifications 4787 RFC 5321 (and its predecessors going back to 821) specify minimum 4788 periods for client and server to wait before timing out. Are those 4789 intervals still appropriate in a world of faster processors and 4790 faster networks? Should they be updated and revised? Or should more 4791 qualifying language be added? 4792 Ticket #16. 4794 G.7.13. Possible SEND, SAML, SOML Loose End (closed) 4796 Per discussion (and Ticket #20), the text about SEND, SAML, and SOML 4797 has been removed from the main body of the document so that the only 4798 discussion of them now appears in Appendix F.6. Per the editor's 4799 note in that appendix, is any further discussion needed? 4800 Ticket #20 (closed) 4802 G.7.14. Abstract Update (closed) 4804 Does the Abstract need to be modified in the light of RFC 6409 or 4805 other changes? 4806 Ticket #52 (changes made; closed) 4808 G.7.15. Informative References to MIME and/or Message Submission 4809 (closed) 4811 Should RFC 2045 (MIME) and/or RFC 6409 (Message Submission) be 4812 referenced at the end of Section 1.2? 4813 Ticket #53 (more general reference to the A/S, closed). 4815 G.7.16. Mail Transaction Discussion 4817 Does the discussion of mail transactions need more work (see CREF in 4818 Section 3.3.)? 4820 G.7.17. Hop by hop Authentication and/or Encryption (closed) 4822 Should this document discuss hop-by-hop authentication or, for that 4823 matter, encryption? (See CREF in Section 2.) 4824 Propose "No, it shouldn't" (20211101 conversation with Todd, 4825 reaffirmed 20220121 plenary) 4826 Ticket #50 (work with in A/S. Closed). 4828 G.7.18. More Text About 554 Given 521, etc. 4830 Does reply code 554 need additional or different explanation in the 4831 light of the addition of the new 521 code and/or the new (in 5321bis 4832 Section 4.2.4.2? (See CREF in Section 4.2.3.) 4834 G.7.19. Minimum Lengths and Quantities 4836 Are the minimum lengths and quantities specified in Section 4.5.3 4837 still appropriate or do they need adjusting? (See CREF at the 4838 beginning of that section.) Also note potential interaction with the 4839 proposed LIMITS SMTP extension (draft-freed-smtp-limits) which may 4840 make this question OBE. 4842 G.8. Enhanced Reply Codes and DSNs 4844 Enhanced Mail System Status Codes (RFC 3463) [7] were added to SMTP 4845 before RFC 5321 was published and are now, together with a 4846 corresponding registry [43], widely deployed and in extensive use in 4847 the network. Similar, the structure and extensions options for 4848 Delivery Status Notifications [35] is implemented, deployed, and in 4849 wide use. Is it time to fold all or part of those mature 4850 specifications into the SMTP spec or at least to mention and 4851 normatively reference them? And, as an aside, do those specs need 4852 work or, if they are kept separate, is it time to move them to 4853 Internet Standard? 4855 At least one of the current references to RFC 3463 indicates that it 4856 SHOULD be used. That presumably makes the reference normative 4857 because one needs that specification to know what the present 4858 document requires. It has been moved in the -03 version of this 4859 draft, but, unless it is move to Internet Standard, it will require 4860 downref treatment. 4862 G.9. Revisiting Quoted Strings 4864 Recent discussions both in and out of the IETF have highlighted 4865 instances of non-compliance with the specification of a Local-part 4866 consisting of a Quoted-string, whether any content of QcontentSMTP 4867 that actually requires special treatment consists of qtextSMTP, 4868 quoted-pairSMTP, or both. Section 4.1.2 (of RFC 5321, repeated 4869 above) ends with a few paragraphs of warnings (essentially a partial 4870 applicability statement), the first of which cautions against 4871 cleverness with either Quoted-string or case sensitivity as a threat 4872 to interoperability. 4874 The Quoted-string portion of that discussion has apparently been 4875 widely not read or ignored. Do we need to do something else? If we 4876 do an Applicability Statement, would it be useful to either reference 4877 the discussion in this document from there or to move the discussion 4878 there and reference it (normatively?) from here? 4880 There has been a separate discussion of empty quoted strings in 4881 addresses, i.e., whether the production should be 4882 required to included at least one non-whitespace character. It is 4883 separate from this issue but would be further impacted or distorted 4884 from the considerations identified in this Section. 4886 Text modified in -07. 4887 Ticket #21. May also interact with Ticket #35. 4889 G.10. Internationalization 4891 RFC 5321 came long before work on internationalization of email 4892 addresses and headers (other than by use of encoded words in MINE) 4893 and specifically before the work of the EAI WG leading to the 4894 SMTPUTF8 specifications, specifically RFCs 6530ff. The second 4895 explanatory paragraph at the end of Section 4.1.2 ("Systems MUST NOT 4896 define mailboxes ...") is an extremely strong prohibition against the 4897 use of non-ASCII characters in SMTP commands and the requirements 4898 about message content in Section 2.3.1 an equally strong one for 4899 content. Would it be appropriate to add something like "in the 4900 absence of relevant extensions" there? Also, given [mis]behavior 4901 seen in the wild, does that paragraph (or an A/S) need an explicit 4902 caution about SMTP servers or clients assuming they can apply the 4903 popular web convention of using %NN sequences as a way to encode non- 4904 ASCII characters ( in RFC 3986) and assuming some later 4905 system will interpret it as they expect? Would it be appropriate to 4906 add an Internationalization Considerations section to the body of 4907 this document if only for the purpose of pointing people elsewhere? 4908 More broadly, while the EAI WG's extensions for non-ASCII headers and 4909 addresses are explicitly out of scope for the EMAILCORE WG (at least 4910 for 5321bis (and 5322bis), those documents make assumptions and 4911 interpretations of the core documents. Are there areas in which 4912 5321bis could and should be clarified to lay a more solid foundation 4913 for the EAI/SMTPUTF8 work and, if so, what are they? 4915 G.11. SMTP Clients, Servers, Senders, and Receivers 4917 RFC 821 used the terms "SMTP-sender" and "SMTP-receiver". In RFC 4918 2821 (and hence in 5321), we switched that to "client" and "server" 4919 (See the discussion in Section 1.2). In part because a relay is a 4920 server and then a client (in some recent practice, even interleaving 4921 the two functions by opening the connection to the next host in line 4922 and sending commands before the incoming transaction is complete), 4923 RFC 5321 continues to use the original terminology in some places. 4924 Should we revisit that usage, possibly even returning to consistent 4925 use of the original terminology? 4927 G.12. Extension Keywords Starting in 'X-' (closed) 4929 Section 2.2.2 contains a discussion of SMTP keywords starting in "X". 4930 Given general experience with such things and RFC 6648, is there any 4931 reason to not deprecate that practice entirely and remove that text? 4932 If we do so, should the former Section 4.1.5 be dropped or rewritten 4933 to make clear this is an obsolete practice? 4934 4.1.5 eliminated in rfc5321bis-06. 4935 Ticket #42 (resolved with -06 and closed). 4937 G.13. Deprecating HELO (closed) 4939 RFC 5321 (and 2821 before it) very carefully circle around the status 4940 of HELO, even recommending its use as a fallback when EHLO is sent 4941 and a "command not recognized" response is received. We are just a 4942 few months short of 20 years; is it time to deprecate the thing and 4943 clean out some or all of that text? And, given a recent (4Q2020) 4944 discussion on the EMAILCORE list, should EHLO be explicitly bound to 4945 SMTP over TCP with the older transports allowed only with HELO? 4946 While those questions may seem independent, separating them is fairly 4947 hard given the way the text is now constructed. 4949 Resolved 2021-01-19: No change 4950 Ticket #43 (closed). 4952 G.14. The FOR Clause in Trace Fields: Semantics, Security 4953 Considerations, and Other Issues 4955 The FOR clause in time-stamp ("Received:") fields is seriously under- 4956 defined. It is optional, the syntax is clear, but its semantics and 4957 use, while perhaps obvious from content and the application of common 4958 sense, have never been defined ("never" going back to 821). Do we 4959 want to better define it? Is there any chance that a definition 4960 would invalid existing, conforming and sensible, implementations? If 4961 we do want to define semantics, draft text and advice as to where it 4962 should go are invited. 4964 (Paragraph added 2021-08-18) 4965 In particular, recentdiscussions point strongly to the need for a 4966 statement to the effect that the value of the for clause must contain 4967 one of the addresses that caused the message to be routed to the 4968 recipient of this message copy (thanks Ned), that no mare than one 4969 address can appear, and that showing one address when there are 4970 multiple RCPT commands may be a security and/or privacy issue (thanks 4971 Ned and Viktor and see ). More detailed or specific 4973 guidance, including case analysis, are probably material for the A/s, 4974 but that is obviously up to the WG. 4976 Note the existing discussions in Section 7.2 and Section 7.6 as they 4977 may need adjustment, or at least cross-references, especially if FOR 4978 is more precisely defined. 4980 There is probably an error in Section 7.6. Its last sentence implies 4981 a possible interaction between messages with multiple recipients and 4982 the FOR clause of trace fields. However, because the syntax of the 4983 FOR clause only allows one Mailbox (or Path), it isn't clear if that 4984 statement is meaningful. Should it be revised to discuss other 4985 situations in which including FOR might not be desirable from a 4986 security or privacy standpoint? (See above -- this paragraph 4987 deliberately not changed in -04). 4988 Ticket #55 4990 G.15. Resistance to Attacks and Operational Necessity (closed) 4992 Section 7.8 is often cited as allowing an exception to the rules of 4993 the specification for reasons of operational necessity, not just 4994 attack resistance. I (JcK) believe the broader interpretation was 4995 intended by YAM (the section was new in RFC 5321). Recommendation: 4996 change the title to explicitly include "Local Operational 4997 Requirements" and add text to indicate that attack resistance is not 4998 the only possible source of such requirements. 4999 Ticket #48 (done, closed) 5001 G.16. Mandatory 8BITMIME 5003 There was extensive discussion on the mailing list in October 2021 5004 about messages with and without 8-bit (i.e., octets with the leading 5005 on) content and a tentative conclusion that support for 8BITMIME 5006 should be required. If that is the WG's conclusion, we need to 5007 figure out what to say and where to say it. 5008 Ticket #64. 5010 G.17. New tickets created between 2022-01-21 and 2022-03-01 5012 To keep issues synchronized between this document and the tracker 5013 (now at 5014 ) a list of new issues added between 5016 the January 2022 interim and the end of the week before the cutoff 5017 for completing and posting draft-ietf-emailcore-rfc5321bis-10 are 5018 listed below. 5020 * #58 Clarification of what is domain name alias and who can 5021 substitute them (see Section 2.3.5) 5022 * #59 Case sensitive commands? (See Section 2.4) 5023 * #60 Restricted-capability clients? (See Section 3.3) 5024 * #61 Explaining mailing lists (See Section 3.4.2). Note that 5025 Section also interactions with Tickets #4, #12, #30, and #34 and 5026 Appendix G.4 and Appendix G.7.5. 5027 * #62 null mx vs server domain in 4.2.4.2 (See Section 4.2.4.2) 5028 * #63 VRFY in required commands in 4.5.1 (See Section 4.5.1). 5029 Changing this would also impact Section 3.5.1, Section 3.5.2, and 5030 Section 7.3. 5031 * // Editor's note: the section number redundancies are to be sure 5032 // pointers remain accurate if section numbers change. They look 5033 // silly, but are not bugs and all of Appendix G disappears before 5034 // the RFC Editor gets the document. 5036 Appendix H. RFC 5321 Errata Summary and Tentative Change Log 5038 [[RFC Editor: Please remove this section before publication.]] 5040 H.1. RFC 5321 Errata Summary 5042 This document addresses the following errata filed against RFC 5321 5043 since its publication in October 2008 [51]. As with the previous 5044 appendix, ticket numbers included below reference 5045 https://trac.ietf.org/trac/emailcore/report/1 . 5046 // [[Note in Draft: Unless marked "closed", items with comments below 5047 // have not yet been resolved as errata.]] 5048 1683 ABNF error. (closed) Section 4.4 5049 Ticket #23 (fixed, closed). 5051 4198 Description error. (closed) Section 4.2. 5052 RESOLVED 2020-12-14, ticket #24 (closed). 5054 2578 Syntax description error. (closed) Section 4.1.2 5055 Ticket #25 (fixed, closed) 5057 1543 Wrong code in description (closed) Section 3.8 5058 Ticket #26 (fixed, closed) 5060 4315 ABNF - IPv6 Section 4.1.3 (closed). 5061 // [5321bis]The IPv6 syntax has been adjusted since 5321 was 5062 // published (the erratum mentions RFC 5952, but RFC 6874 and 5063 draft- 5064 // carpenter-6man-rfc6874bis should also be considered). See the 5065 // rewritten form and the comment in the section cited in the 5066 // previous sentence, at least for the RFC 5952 issues. The 5067 editor 5068 // awaits instructions. See https://www.rfc-editor.org/errata/ 5069 // eid4315 5070 Ticket #27 (closed 2021-01-19). 5072 5414 ABNF for Quoted-string (closed) Section 4.1.2 5073 Ticket #22 (fixed, closed). 5075 1851 Location of text on unexpected close Section 4.1.1.5 (closed). 5076 Text moved per email 2020-12-31. 5077 Ticket #28 (fixed, closed). 5079 3447 Use of normative language (e.g., more "MUST"s), possible 5080 confusion in some sections Section 4.4. 5081 Ticket #7 5083 // [5321bis]As Barry notes in his verifier comments on the erratum 5084 // (see https://www.rfc-editor.org/errata/eid3447), the comments 5085 and 5086 // suggestions here raise a number of interesting (and difficult) 5087 // issues. One of the issues is that the core of RFCs 5321 (and 5088 // 2821) is text carried over from Jon Postel's RFC 821, a 5089 document 5090 // that was not only written in a different style than the IETF 5091 uses 5092 // today but that was written at a time when no one had dreamt of 5093 RFC 5094 // 2119 or even the IETF itself. It appears to me that trying to 5095 // patch that style might easily result in a document that is 5096 harder 5097 // to read as well as being error prone. If we want to get the 5098 // document entirely into contemporary style, we really should 5099 bite 5100 // the bullet and do a complete rewrite. To respond to a 5101 different 5102 // point in Barry's discussion, I think an explicit statement that 5103 // 5321/5322 and their predecessors differ in places and why would 5104 be 5105 // helpful. Text, and suggestions about where to put it, are 5106 // solicited. A list of differences might be a good idea too, but 5107 // getting it right might be more work than there is available 5108 energy 5109 // to do correctly. 5111 5711 Missing leading spaces in example Appendix D.3 (closed). 5113 // [5321bis]Well, this is interesting because the XML is correct 5114 and 5115 // the spaces are there, embedded in artwork. So either the 5116 XML2RFC 5117 // processor at the time took those leading spaces out or the RFC 5118 // Editor improved on the document and the change was not caught 5119 in 5120 // AUTH48, perhaps because rfcdiff ignores white space. We just 5121 need 5122 // to watch for future iterations. 5123 As of 2021-03-15, both the txt and html-ized versions of draft- 5124 ietf-emailcore-rfc5321bis-02 were showing identical output for 5125 both parts of the example, so the problem appears to be OBE at 5126 worst. 5127 Ticket #29 (closed 2021-03-16) 5129 4055 (closed) Erratum claims the the description of SPF and DKIM is 5130 wrong. It is not clear what 5321bis should really say about them, 5131 but the current text probably needs work (or dropping, which is 5132 what the proposed erratum suggests). 5133 Text changed; ticket should probably be closed after WG reviews 5134 -04. 5135 Ticket #30 (resolved and closed). 5137 // [5321bis]Note that rejected errata have _not_ been reviewed to see 5138 // if they contain anything useful that should be discussed again 5139 // with the possibility of rethinking and changing text. Volunteers 5140 // sought. 5142 H.2. Changes from RFC 5321 (published October 2008) to the initial 5143 (-00) version of this draft 5145 // This appendix will eventually need to be replaced by a real 5146 // section or standalone appendix describing changes between 5321 and 5147 // the final 5321bis. 5149 * Acknowledgments section (Section 9) trimmed back for new document. 5151 * Introductory paragraph to Appendix F extended to make it clear 5152 that these features were deprecated a long time ago and really 5153 should not be in use any more. 5155 * Adjusted some language to clarify that source routes really, 5156 really, should not be used or depended upon. 5158 * IPv6 address syntax replaced by a copy of the IPv6 URI syntax and 5159 a note added. 5161 * Production index added as a first step in tying all productions to 5162 their sources. As part of the effort to make the document more 5163 easily navigable, table of contents entries have been created for 5164 the individual command descriptions. 5166 * Clarified the relationship between the SMTP "letters, digits, and 5167 hyphens" and DNS "preferred name syntax" (Section 2.3.5). 5169 * Revised the reply code sections to add new 521 and 556 codes, 5170 clarify relationships, and be explicit about the requirement for 5171 clients to rely on first digits rather than the sequences in 5172 Section 4.3.2. 5174 * In conjunction with the above, explicitly obsolete RFCs 1846 and 5175 7504 5177 // That might not be right -- see email 2021-10-03). 5179 * Incorporated a correction reflecting Errata ID 2578. 5181 * Some small editorial changes made to eliminate redundant 5182 statements that were very close together. Other, equally small, 5183 editorial changes have been made to improve grammar or clarity. 5185 * A few questions, marked "[[5321bis Editor's Note:", or "[[Note in 5186 Draft" have been added for the group to resolve. Other questions, 5187 especially those in the errata summary, are simply included in 5188 narrative comments in CREFs. 5190 * Checked and rationalized "response" (to a command) and "reply 5191 code" terminology. One can talk about a "999 response" but only a 5192 "999 reply code". There is no such thing as a "response code". 5194 * Added note about length limit on mailbox names ("email 5195 addresses"). 5197 * Added an "errata summary" subsection to this change log/ 5198 comparison to 5321 in this Appendix. The entire Appendix will, of 5199 course, disappear at the time of RFC publication unless someone 5200 wants to make a strong case for retaining it. 5202 * Rationalized CREFs to 2821, 5321, 5321bis etc.; added note to 5203 readers below the Abstract. 5205 * Temporarily added a "Note on Reading This Working Draft" after the 5206 Abstract. 5208 H.3. Changes Among Versions of Rfc5321bis 5210 H.3.1. Changes from draft-klensin-rfc5321bis-00 (posted 2012-12-02) to 5211 -01 5213 Substantively, these two versions differ only by suppression of the 5214 CREF and other discussion associated with the evolution from RFC 2821 5215 to RFC 5321. That change includes an update to the document's Note 5216 to Readers, the date, the file name, and the addition of this change 5217 log subsection. 5219 H.3.2. Changes from draft-klensin-rfc5321bis-01 (20191203) to -02 5221 * Minor clarifications to improve text, e.g., addition of NOOP to 5222 the list of non-mail transaction examples in Section 4.1.4. 5224 * Added topics exposed in the ietf-smtp list and the IETF list 5225 "dogfood" discussion during December 2019 and an index listing of 5226 substantive issues identified only in CREFs in the prior draft as 5227 a new Appendix G.. 5229 H.3.3. Changes from draft-klensin-rfc5321bis-02 (2019-12-27) to -03 5231 * Added more text to Appendix G.7.1 to specifically call out the 5232 session-opening policy issues surrounding these codes. 5234 * Added discussion of "1yz" reinstatement in Appendix G.7.11. 5236 * Added discussion of timeouts in Appendix G.7.12. 5238 * Added subsection on Enhanced Status Codes and DSNs to the 5239 outstanding issues list Appendix G.8. 5241 * Replaced reference to RFC 1652 (8BITMIME) with the Internet 5242 Standard version, RFC 6152. 5244 * With help from cketti, clarified the ABNF productions whose 5245 terminals appear in other documents. 5247 * Added discussions of Quoted-string, Internationalization, and 5248 client-server versus sender-receiver terminology to Appendix G. 5250 * Added note to the Abstract. 5252 H.3.4. Changes from draft-klensin-rfc5321bis-03 (2020-07-02) to draft- 5253 ietf-emailcore-rfc5321bis-00 5255 * Added a paragraph about non-null quoted strings to Appendix G.9. 5257 * Added an explicit pointer to email insecurity and TLS to 5258 Appendix G.6. Inspired by Ben Kaduk's comment on the WG Charter, 5259 2020-09-09. 5261 * Converted document from individual to emailcore WG effort. 5263 H.3.5. Changes from draft-ietf-emailcore-rfc5321bis-00 (2020-10-06) to 5264 -01 5266 * Editorial: Corrected "blackslash" to "backslash" 5268 * Rewrote the introduction to Appendix G slightly to reflect the 5269 creation of the EMAILCORE WG. 5271 * Applied fixes for repeated use of EHLO. See Appendix G.2. 5273 * Added two new questions, one about "X" extensions (Appendix G.12) 5274 and one about the status of HELO (Appendix G.13). 5276 * Removed mention of SEND, SAML, SOML from the main body of the text 5277 (Ticket #20). 5279 * Added a warning about side effects to Appendix G.7.5. 5281 * Added ticket numbers to descriptions of issues and changes, 5282 adjusted some text so relationships would be more clear, and added 5283 subsections to the Appendix G and H lists to pick up on tickets 5284 that were not easily identified in those sections of with the 5285 text. 5287 * Made several additions to the Index, including one to deal with 5288 SEND et al., as above. 5290 H.3.6. Changes from draft-ietf-emailcore-rfc5321bis-01 (2020-12-25) to 5291 -02 5293 * Corrected discussion mailing list to point to emailcore@ietf.org 5294 in the introductory note. 5296 * Added new subsection(s) to Appendix G to reflect newly discovered 5297 issues. 5299 * Changed "as discussed in" references in Section 4.5.5 per ticket 5300 #45. 5302 * Corrected a misleading use of the term "mailbox" in Section 3.3. 5304 * Changed descriptions of use of first digit in replies per ticket 5305 #13. See Appendix G.7.7. 5307 * Moved paragraph per ticket #28, erratum 1851. 5309 * Added more clarifying cross-references, clarified some CREFs, and 5310 cleaned out some of those that no longer seemed relevant. 5312 * Removed "updates 1123" is unnecessary and obsolete. 5314 * Updated several references. 5316 H.3.7. Changes from draft-ietf-emailcore-rfc5321bis-02 (2021-02-21) to 5317 -03 5319 * Editorial: Fixed some instances of constructions like "RCPT TO 5320 command". The name of the command is RCPT. Sloppy editing in 5321 2008. 5323 * Added text and cross-references to clarify the role of 452 and 552 5324 in "too many recipients" situations. 5326 * Added Appendix G.15 to discuss changes to better reflect 5327 "operational necessity" issue. 5329 * Added detail for erratum 5711, ticket #29. 5331 * Added new subsections of Appendix G.7 to keep some previously- 5332 unnoted CREF notes from getting lost. Also removed some CREFs 5333 that were notes on changes made before the WG was created or 5334 appeared to no longer have value and trimmed or rewrote some of 5335 the remaining ones. 5337 * More discussion of Ticket #13, See Appendix G.7.7. 5339 * Identified Ticket #41 as closed. See Appendix Appendix G.7.3; 5340 notes removed from Section 2.3.5. 5342 * "SHOULD" requirement for interpreting 552 "too many recipients" 5343 removed from Section 4.5.3.1.10, explanation added, and text 5344 cleaned up. Also removed the parenthetical historical notes on 5345 the return code definitions in Section 4.2. See Appendix G.5. 5346 (Ticket #5) 5348 * Modified Appendix G.8 to add a note about the normative status of 5349 RFC 3463 and moved that reference. 5351 * Several clarifications to initiation and termination of mail 5352 transactions in Section 4.1.4. 5354 * Several additional minor editorial improvements. 5356 * Note for drafts -03 and -04 only, modified somewhat for -05 but 5357 outdated from -06 forward: Some issues are still outstanding: 5358 Notes were posted to the list on 2021-07-09 about tickets #7 5359 (5322bis issue), #10 , #14 (closed), #20 (closed), #30 (closed), 5360 and #42 (closed). Even though some comments about them appeared 5361 in the subsequent day or so, there appears to have been 5362 insufficient time for discussions to stabilize sufficiently for 5363 changes to be included in this version of the I-D. 5365 H.3.8. Changes from draft-ietf-emailcore-rfc5321bis-03 (2021-07-10) to 5366 -04 5368 * Clarified that the "period" in . is really the ASCII 5369 one in Section 3.3. 5371 // Editor's note: change treated as Editorial without a ticket. 5372 If 5373 // there are objections, speak up. 5375 * Several other small editorial corrections. 5377 * Added several notes about the possible need to add text to reflect 5378 the presence of MSAs and to clarify whether MUAs send messages 5379 directly to MTAs or whether, in that case, the MUAs are just 5380 incorporating MSA functions. 5382 * Added new text to Appendix G.14 reflecting discussions of the 5383 Received...FOR issue. 5385 * Adjusted discussion of erratum 4315 (Ticket #27) to reflect more 5386 recent IPv6 syntax developments. 5388 * Adjusted discussion of the various "mail not accepted" codes, 5389 rewrote Section 4.2.4.2, annotated and inserted cross-references 5390 in relevant response code descriptions and (tentatively) 5391 identified this document as obsoleting RFC 7505. Editor's guess, 5392 reinforced by a brief conversation with John Levine (lead author 5393 of 7505), is that we should incorporate text as needed and 5394 obsolete it. The changes include replacing the reference to the 5395 "nullMX" I-D with RFC 7505, which I am appalled that neither I nor 5396 anyone else noticed earlier. Cf. Appendix G.7.1, Section 4.2.4.2, 5397 and Ticket #6. 5399 H.3.9. Changes from draft-ietf-emailcore-rfc5321bis-04 (2021-10-03) to 5400 -05 5402 * Took a first step toward rewriting and updating the introductory 5403 material. It is only a first step; suggestions welcome. 5405 * Minor editorial fixes. 5407 * Correct text about domain name checking in Section 4.1.4, probably 5408 fixing ticket #19. See CREF added there. 5410 * Added Appendix G.16 a placeholder for the 8BITMIME discussion and 5411 possible action. 5413 * Additional changes to the description and organization of trace 5414 field materials. Intended to resolve the 5321bis part of Ticket 5415 #7. 5417 * Remaining patch to SEND, etc., discussion in Appendix F.6 applied 5418 and CREF removed. 5420 * Removed discussion of "X-" and edited associated text. The fix 5421 may or may not be sufficient to resolve Ticket #42 (later closed). 5423 * Verified that the problems of getting four-level sections (e.g., 5424 "4.1.1.1" and other command-specific ones) into the table of 5425 contents and the index reflecting page numbers still exist and 5426 updated the introductory note. 5428 H.3.10. Changes from draft-ietf-emailcore-rfc5321bis-05 (2021-10-24) to 5429 -06 5431 * Finished making changes for "X-" and commands starting in "X". 5432 Changes made in -05 were incomplete. This should allow closing 5433 Ticket #42. 5435 * Removed spurious "for use in delivery notifications" from 3.6.2. 5436 Was just a pasting-type error. 5438 * Changed "In other words" to "In particular" in Section 2.3.5 per 5439 Ticket #10 and July 2021 mailing list discussion. Removed 5440 associated CREF. 5442 * Converted to xml2rfc v3 (thanks to John Levine for doing the hard 5443 parts) and then modified the introductory note accordingly. 5445 * Started reworking the Abstract -- see revised CREF there. 5447 * Rewrote Section 2.3.3 slightly to note the existence of submission 5448 servers and removed the CREF. 5450 * Updated Appendix G.7.17 and slightly modified CREF note in 5451 Section 2 -- proposed to not get 5321bis involved with this 5452 (Ticket #50). 5454 * Rewrote parts of Section 3.4.2 to clarify text amd respond to 5455 Ticket #34. 5457 * Inserted suggested text info CREF at end of Section 1.2. Comments 5458 welcome. Soon. 5460 H.3.11. Changes from draft-ietf-emailcore-rfc5321bis-06 (2021-11-07) to 5461 -07 5463 * Reviewed closed tickets and discussion with co-chairs after IETF 5464 112 and updated text. Sections or items that are, according to 5465 the ticket list, completely closed have been identified by 5466 "(closed)" in or near their titles. 5468 * Changed the suggestion for references to other documents mentioned 5469 in G.7.14 and Section 1.2 to actual text. Cleaned things up and, 5470 per note from Alexey 2021-11-17, have marked Ticket #53 as closed. 5472 * New text added and old text replaced about quotes in 5473 Section 4.1.2, text rearranged and edited a bit per Appendix G.9, 5474 and CREF added about alternatives. Changes reflect mailing list 5475 comments through 5477 * Last sentence (about source routing) removed from Section 2.1. 5478 Also adjusted text in Section 3.3, Section 4.1.1.3 but work is 5479 still needed there (see new CREFs in that section) and 5480 Section 6.1. The former Appendix C and references to it have been 5481 removed, leaving a placeholder to avoid changing subsequent 5482 appendix numbering before IETF Last Call (and maybe its 5483 completion) No changes have yet been made to Appendix F.2 but it 5484 is likely to require some work in the next version of the 5485 document. This is entirely about Ticket #17, which should not be 5486 closed until that appendix is updated. 5488 H.3.12. Changes from draft-ietf-emailcore-rfc5321bis-07 (2021-12-04) to 5489 -08 5491 Other than the partial cleanup for "forwarding" and "aliasing" and 5492 miscellaneous editorial fixes and corrections (including cleaning out 5493 unused references), changes in this version reflect the conclusions 5494 of the EMAILCORE interim meeting held 2021-12-09. References to 5495 "slides" are to the deck at https://datatracker.ietf.org/doc/slides- 5496 interim-2021-emailcore-01-sessa-chairs-slides/ and the minutes at 5497 https://notes.ietf.org/notes-emailcore-interim-dec-2021 5499 * (Slides 9 through 12): Removed source route examples from 5500 Section 4.1.1.3 and added a new paragraph explaining what happened 5501 to them. For slides 11 and 12, see below for more general 5502 Appendix F.2 discussion. 5503 (Cf Appendix G.7.10 and Ticket #17.) 5505 * (Slides 13 through 14): Domain names, Section 2.3.5. Removed 5506 "resolvable". Changed "alias" to "host alias" (although, after 5507 looking at the actual text, the intent seems clear from the CNAME 5508 label comment and, of course, the term "host" has been 5509 controversial in DNS circles and the minutes are not clear on the 5510 desirability of this change). Inserted "MUST" for the FQDN. A 5511 cross-reference to the domain name discussion in this section has 5512 been added to Section 4.1.1.1 in an attempt to resolve that 5513 discussion. 5514 In going carefully through this material, it became obvious that 5515 the discussions in Section 2.3.5 and Section 5 were confusing and 5516 somewhat redundant. Those sections have been rewritten to clarify 5517 intent, hint that extensions may modify (or have modified) a few 5518 of the rules, improve cross-references, and remove redundant text. 5519 Domain name issues are still under discussion on the WG mailing 5520 list as of 2021-12-18 and it is possible that the above changes 5521 may have introduced new issues, so additional changes are 5522 possible. 5523 (Cf target="G-domain"/> and Tickets #9 and maybe #10.) 5525 * Aliasing and forwarding: 5526 Consolidated former sections 3.4 and 3.9 into a new Section 3.4, 5527 making them subsections. The new subsection probably still needs 5528 work and maybe an introductory paragraph, but even bringing the 5529 two subsections together may reduce some sources of confusion 5530 identified on the mailing list. Added cross-reference to security 5531 considerations from the new Section 3.4.1. 5533 All other issues discussed during the interim appear to be unresolved 5534 and were deferred to the mailing list. 5536 As what should be the third and final step in deprecation of source 5537 routes and removal of them from the main text, the appendix that 5538 discusses them (Appendix F.2) has been rewritten, adjusting language 5539 and incorporating some materials from the former Appendix C. 5541 H.3.13. Changes from draft-ietf-emailcore-rfc5321bis-08 (2021-12-31) to 5542 -09 5544 * Multiple small editorial changes. 5546 * Started tuning Appendix H.2 preparatory to an actual "Changes 5547 from" section. 5549 * Moved and rewrote a paragraph that seemed to be out of place from 5550 Section 4.4.1 to Section 4.1.1.3 per November discussion. See the 5551 note in the latter section for discussion. 5553 * Removed "for initial submission of messages" from Section 2.3.5 5554 and changed "may" to "MAY" in the last bullet point there, per 5555 Interim. Removed comment/ Editor's Note from that section: 5556 further instructions and evidence of consensus needed to do 5557 anything additional with it. 5558 Ticket #9 5560 * In Section 3.4.2, rewrote the first sentence to make it 5561 descriptive rather than normative. Also removed the last sentence 5562 of that paragraph. Both per the editor's understanding of the 5563 Interim's conclusions, but the latter was put in because of 5564 problems with people thinking changing the argument to the MAIL 5565 command also required changing "From:" in the headers, so this 5566 should be carefully reviewed on list. Comment removed from that 5567 section -- the dead horse has been kicked past recognition. 5568 Ticket #4. 5570 * In Appendix F.2, changed the requirement for server support to 5571 MAY, and prohibited client support, for source routing. Also made 5572 a small wording change. Per Interim. 5573 Ticket #17 5575 With this draft, comments in the running text ("//" at the beginning 5576 of lines) that seem to no longer be relevant either generally or 5577 after the discussions during the 2022-01-21 Interim are being 5578 removed. The "Notes on Reading..." at the beginning of the document 5579 (just below the Abstract) have been revised accordingly. Sections 5580 from which comments were removed this time include: 5582 * Abstract, comment introduced in -06 (No comments on it through -08 5583 are interpreted as consent; 5585 * Section 2 (any discussion needed will be in A/S); 5587 * Section 2.3.10 (discussion seems to have ended); 5589 * Section 4.1.1.3 (no further discussion during Interim, so assume 5590 comment is no longer needed); 5592 * Section 4.1.2 (no further discussion since -08 appeared or during 5593 Interim, assumed to not require further work); 5595 * Section 4.5.3.1 (further discussion will be in A/S); 5597 * Section 4.2.2 (this comment obsolete since revision -04 of this 5598 document). 5600 * Cross-checked ticket notes and annotations in this document 5601 against the ticket system. Consistent for closed tickets as of 5602 2022-01-31. 5604 H.3.14. Changes from draft-ietf-emailcore-rfc5321bis-09 (2022-02-01 to 5605 -10 5607 * Small editorial fixes, including a lingering typographical error 5608 or two. 5610 * Captured some additional sections into the TOC. 5612 * Added an additional index subsection for terminology, including 5613 the terms of Section 2.3 and a few others. More entries may be 5614 needed. 5616 * Modified Section 3.4.2 to flag continuing uncertainty about 5617 decisions in the January Interim and subsequent list discussion 5618 about some text in that Section. 5620 * Modified Section 4.2.4.2 to correct confusing phrasing and make a 5621 placeholder for a possible addition raised on email 2022-03-05. 5623 * Added Appendix G.16 and Appendix G.17 so all open (and most 5624 closed) applicable ticket numbers are identified in this document. 5626 Index 5628 A C S T 5630 A 5632 Argument Syntax 5633 ALPHA Section 4.1.2, Paragraph 2, Item 1 5634 Additional-Registered-Clauses Section 4.4.1 5635 Addtl-Link Section 4.4.1 5636 Addtl-Protocol Section 4.4.1 5637 Argument Section 4.1.2 5638 Atom Section 4.1.2 5639 By-domain Section 4.4.1 5640 CFWS Section 4.1.2, Paragraph 2, Item 2 5641 CRLF Section 4.1.2, Paragraph 2, Item 1 5642 DIGIT Section 4.1.2, Paragraph 2, Item 1 5643 Domain Section 4.1.2 5644 Dot-string Section 4.1.2 5645 Extended-Domain Section 4.4.1 5646 FWS Section 4.1.2, Paragraph 2, Item 2 5647 For Section 4.4.1 5648 Forward-Path Section 4.1.2 5649 From-domain Section 4.4.1 5650 General-address-literal Section 4.1.3 5651 Greeting Section 4.2 5652 HEXDIG Section 4.1.2, Paragraph 2, Item 1 5653 ID Section 4.4.1 5654 IPv4-address-literal Section 4.1.3 5655 IPv6-addr Section 4.1.3 5656 IPv6-address-literal Section 4.1.3 5657 Keyword Section 4.1.2 5658 Ldh-str Section 4.1.2 5659 Let-dig Section 4.1.2 5660 Link Section 4.4.1 5661 Local-part Section 4.1.2 5662 Mail-parameters Section 4.1.2 5663 Mailbox Section 4.1.2 5664 Opt-info Section 4.4.1 5665 Path Section 4.1.2 5666 Protocol Section 4.4.1 5667 QcontentSMTP Section 4.1.2 5668 Quoted-string Section 4.1.2 5669 Rcpt-parameters Section 4.1.2 5670 Reply-code Section 4.2 5671 Reply-line Section 4.2 5672 Return-path-line Section 4.4.1 5673 Reverse-Path Section 4.1.2 5674 SP Section 4.1.2, Paragraph 2, Item 1 5675 Snum Section 4.1.3 5676 Stamp Section 4.4.1 5677 Standardized-tag Section 4.1.3 5678 String Section 4.1.2 5679 TCP-info Section 4.4.1 5680 Time-stamp-line Section 4.4.1 5681 Via Section 4.4.1 5682 With Section 4.4.1 5683 address-literal Section 4.1.2 5684 atext Section 4.1.2, Paragraph 2, Item 2 5685 dcontent Section 4.1.3 5686 esmtp-keyword Section 4.1.2 5687 esmtp-param Section 4.1.2 5688 esmtp-value Section 4.1.2 5689 h16 Section 4.1.3 5690 ls32 Section 4.1.3 5691 qtextSMTP Section 4.1.2 5692 quoted-pairSMTP Section 4.1.2 5693 sub-domain Section 4.1.2 5694 textstring Section 4.2 5696 C 5698 Command Syntax 5699 data Section 4.1.1.4, Paragraph 8, Item 1 5700 ehlo Section 3.2, Paragraph 1; Section 4.1.1.1, Paragraph 1 5701 expn Section 4.1.1.7, Paragraph 4, Item 1 5702 helo Section 4.1.1.1, Paragraph 1 5703 help Section 4.1.1.8, Paragraph 5, Item 1 5704 mail Section 4.1.1.2 5705 noop Section 4.1.1.9, Paragraph 4, Item 1 5706 quit Section 4.1.1.10, Paragraph 5, Item 1 5707 rcpt Section 4.1.1.3, Paragraph 16 5708 rset Section 4.1.1.5, Paragraph 4, Item 1 5709 send, saml, soml Appendix G.7.13, Paragraph 1 5710 vrfy Section 4.1.1.6, Paragraph 4, Item 1 5712 S 5714 Source Routes Appendix F.2 5715 A-d-l Appendix F.2 5716 At-domain Appendix F.2 5717 Path Appendix F.2 5719 T 5721 Terminology 5722 Address Section 2.3.11, Paragraph 1 5723 Buffer Section 2.3.6, Paragraph 1 5724 Commands and Replies Section 2.3.7, Paragraph 1 5725 Delivery SMTP Section 2.3.10, Paragraph 1 5726 Domain Names Section 2.3.5, Paragraph 1 5727 Gateway Section 2.3.10, Paragraph 2 5728 Host Section 2.3.4, Paragraph 1 5729 Lines Section 2.3.8, Paragraph 1 5730 Mail Agent Section 2.3.3, Paragraph 1 5731 Mail Data Section 2.3.9, Paragraph 1 5732 Mail object Section 2.3.1, Paragraph 1 5733 Mailbox Section 2.3.11, Paragraph 1 5734 Message Content Section 2.3.9, Paragraph 1 5735 Message Store Section 2.3.3, Paragraph 1 5736 Originator Section 2.3.10, Paragraph 1 5737 Relay SMTP Section 2.3.10, Paragraph 1 5738 Senders and Receivers Section 2.3.2, Paragraph 1 5739 State Table Section 2.3.6, Paragraph 1 5740 address RR Section 2.3.5, Paragraph 3 5741 primary host name Section 2.3.5, Paragraph 4, Item 1 5743 Author's Address 5745 John C. Klensin 5746 1770 Massachusetts Ave, Suite 322 5747 Cambridge, MA 02140 5748 United States of America 5750 Email: john-ietf@jck.com