idnits 2.17.1 draft-ietf-spfbis-4408bis-15.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 1 instance of lines with non-RFC2606-compliant FQDNs in the document. == There are 6 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. == There are 1 instance of lines with private range IPv4 addresses in the document. If these are generic example addresses, they should be changed to use any of the ranges defined in RFC 6890 (or successor): 192.0.2.x, 198.51.100.x or 203.0.113.x. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 1680 has weird spacing: '...pe-from the e...' == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (May 23, 2013) is 3988 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'CFWS' is mentioned on line 2359, but not defined ** Obsolete normative reference: RFC 5451 (Obsoleted by RFC 7001) ** Downref: Normative reference to an Informational RFC: RFC 5598 ** Downref: Normative reference to an Informational RFC: RFC 5782 -- Possible downref: Non-RFC (?) normative reference: ref. 'US-ASCII' -- Obsolete informational reference (is this intentional?): RFC 4408 (Obsoleted by RFC 7208) -- Obsolete informational reference (is this intentional?): RFC 5751 (Obsoleted by RFC 8551) Summary: 3 errors (**), 0 flaws (~~), 7 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group S. Kitterman 3 Internet-Draft Kitterman Technical Services 4 Obsoletes: 4408 (if approved) May 23, 2013 5 Intended status: Standards Track 6 Expires: November 24, 2013 8 Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, 9 Version 1 10 draft-ietf-spfbis-4408bis-15 12 Abstract 14 Email on the Internet can be forged in a number of ways. In 15 particular, existing protocols place no restriction on what a sending 16 host can use as the "MAIL FROM" of a message or the domain given on 17 the SMTP HELO/EHLO commands. This document describes version 1 of 18 the Sender Policy Framework (SPF) protocol, whereby a ADMDs 19 (ADministrative Management Domains) can explicitly authorize the 20 hosts that are allowed to use its domain names, and a receiving host 21 can check such authorization. 23 This document obsoletes RFC4408. 25 Status of this Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at http://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on November 24, 2013. 42 Copyright Notice 44 Copyright (c) 2013 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (http://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 This document may contain material from IETF Documents or IETF 58 Contributions published or made publicly available before November 59 10, 2008. The person(s) controlling the copyright in some of this 60 material may not have granted the IETF Trust the right to allow 61 modifications of such material outside the IETF Standards Process. 62 Without obtaining an adequate license from the person(s) controlling 63 the copyright in such materials, this document may not be modified 64 outside the IETF Standards Process, and derivative works of it may 65 not be created outside the IETF Standards Process, except to format 66 it for publication as an RFC or to translate it into languages other 67 than English. 69 Table of Contents 71 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 6 72 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 6 73 1.1.1. Keywords . . . . . . . . . . . . . . . . . . . . . . . 6 74 1.1.2. Imported Definitions . . . . . . . . . . . . . . . . . 6 75 1.1.3. MAIL FROM Definition . . . . . . . . . . . . . . . . . 7 76 1.1.4. HELO Definition . . . . . . . . . . . . . . . . . . . 7 77 1.2. check_host() . . . . . . . . . . . . . . . . . . . . . . . 7 78 2. Operational Overview . . . . . . . . . . . . . . . . . . . . . 8 79 2.1. The "HELO" Identity . . . . . . . . . . . . . . . . . . . 8 80 2.2. The "MAIL FROM" Identity . . . . . . . . . . . . . . . . . 8 81 2.3. Publishing Authorization . . . . . . . . . . . . . . . . . 8 82 2.4. Checking Authorization . . . . . . . . . . . . . . . . . . 9 83 2.5. Location of Checks . . . . . . . . . . . . . . . . . . . . 10 84 2.6. Results of Evaluation . . . . . . . . . . . . . . . . . . 10 85 2.6.1. None . . . . . . . . . . . . . . . . . . . . . . . . . 11 86 2.6.2. Neutral . . . . . . . . . . . . . . . . . . . . . . . 11 87 2.6.3. Pass . . . . . . . . . . . . . . . . . . . . . . . . . 11 88 2.6.4. Fail . . . . . . . . . . . . . . . . . . . . . . . . . 11 89 2.6.5. Softfail . . . . . . . . . . . . . . . . . . . . . . . 11 90 2.6.6. Temperror . . . . . . . . . . . . . . . . . . . . . . 11 91 2.6.7. Permerror . . . . . . . . . . . . . . . . . . . . . . 11 92 3. SPF Records . . . . . . . . . . . . . . . . . . . . . . . . . 12 93 3.1. DNS Resource Records . . . . . . . . . . . . . . . . . . . 12 94 3.2. Multiple DNS Records . . . . . . . . . . . . . . . . . . . 13 95 3.3. Multiple Strings in a Single DNS record . . . . . . . . . 13 96 3.4. Record Size . . . . . . . . . . . . . . . . . . . . . . . 13 97 3.5. Wildcard Records . . . . . . . . . . . . . . . . . . . . . 13 98 4. The check_host() Function . . . . . . . . . . . . . . . . . . 15 99 4.1. Arguments . . . . . . . . . . . . . . . . . . . . . . . . 15 100 4.2. Results . . . . . . . . . . . . . . . . . . . . . . . . . 15 101 4.3. Initial Processing . . . . . . . . . . . . . . . . . . . . 16 102 4.4. Record Lookup . . . . . . . . . . . . . . . . . . . . . . 16 103 4.5. Selecting Records . . . . . . . . . . . . . . . . . . . . 16 104 4.6. Record Evaluation . . . . . . . . . . . . . . . . . . . . 17 105 4.6.1. Term Evaluation . . . . . . . . . . . . . . . . . . . 17 106 4.6.2. Mechanisms . . . . . . . . . . . . . . . . . . . . . . 17 107 4.6.3. Modifiers . . . . . . . . . . . . . . . . . . . . . . 18 108 4.6.4. DNS Lookup Limits . . . . . . . . . . . . . . . . . . 18 109 4.7. Default Result . . . . . . . . . . . . . . . . . . . . . . 19 110 4.8. Domain Specification . . . . . . . . . . . . . . . . . . . 19 111 5. Mechanism Definitions . . . . . . . . . . . . . . . . . . . . 21 112 5.1. "all" . . . . . . . . . . . . . . . . . . . . . . . . . . 22 113 5.2. "include" . . . . . . . . . . . . . . . . . . . . . . . . 22 114 5.3. "a" . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 115 5.4. "mx" . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 116 5.5. "ptr" (do not use) . . . . . . . . . . . . . . . . . . . . 24 117 5.6. "ip4" and "ip6" . . . . . . . . . . . . . . . . . . . . . 26 118 5.7. "exists" . . . . . . . . . . . . . . . . . . . . . . . . . 26 119 6. Modifier Definitions . . . . . . . . . . . . . . . . . . . . . 28 120 6.1. redirect: Redirected Query . . . . . . . . . . . . . . . . 28 121 6.2. exp: Explanation . . . . . . . . . . . . . . . . . . . . . 29 122 7. Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 123 7.1. Formal Specification . . . . . . . . . . . . . . . . . . . 31 124 7.2. Macro Definitions . . . . . . . . . . . . . . . . . . . . 31 125 7.3. Macro Processing Details . . . . . . . . . . . . . . . . . 32 126 7.4. Expansion Examples . . . . . . . . . . . . . . . . . . . . 34 127 8. Result Handling . . . . . . . . . . . . . . . . . . . . . . . 36 128 8.1. None . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 129 8.2. Neutral . . . . . . . . . . . . . . . . . . . . . . . . . 36 130 8.3. Pass . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 131 8.4. Fail . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 132 8.5. Softfail . . . . . . . . . . . . . . . . . . . . . . . . . 37 133 8.6. Temperror . . . . . . . . . . . . . . . . . . . . . . . . 38 134 8.7. Permerror . . . . . . . . . . . . . . . . . . . . . . . . 38 135 9. Recording the Result . . . . . . . . . . . . . . . . . . . . . 39 136 9.1. The Received-SPF Header Field . . . . . . . . . . . . . . 39 137 9.2. SPF Results in the Authentication-Results Header Field . . 41 138 10. Effects on Infrastructure . . . . . . . . . . . . . . . . . . 43 139 10.1. Sending Domains . . . . . . . . . . . . . . . . . . . . . 43 140 10.1.1. DNS Resource Considerations . . . . . . . . . . . . . 43 141 10.1.2. Administrator's Considerations . . . . . . . . . . . . 44 142 10.1.3. Bounces . . . . . . . . . . . . . . . . . . . . . . . 45 143 10.2. Receivers . . . . . . . . . . . . . . . . . . . . . . . . 45 144 10.3. Mediators . . . . . . . . . . . . . . . . . . . . . . . . 45 145 11. Security Considerations . . . . . . . . . . . . . . . . . . . 47 146 11.1. Processing Limits . . . . . . . . . . . . . . . . . . . . 47 147 11.2. SPF-Authorized Email May Contain Other False Identities . 48 148 11.3. Spoofed DNS and IP Data . . . . . . . . . . . . . . . . . 48 149 11.4. Cross-User Forgery . . . . . . . . . . . . . . . . . . . . 48 150 11.5. Untrusted Information Sources . . . . . . . . . . . . . . 49 151 11.5.1. Recorded Results . . . . . . . . . . . . . . . . . . . 49 152 11.5.2. External Explanations . . . . . . . . . . . . . . . . 49 153 11.5.3. Macro Expansion . . . . . . . . . . . . . . . . . . . 50 154 11.6. Privacy Exposure . . . . . . . . . . . . . . . . . . . . . 50 155 11.7. Delivering Mail Producing a 'Fail' Result . . . . . . . . 50 156 12. Contributors and Acknowledgements . . . . . . . . . . . . . . 51 157 13. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 52 158 13.1. The SPF DNS Record Type . . . . . . . . . . . . . . . . . 52 159 13.2. The Received-SPF Mail Header Field . . . . . . . . . . . . 52 160 13.3. SPF Modifier Registry . . . . . . . . . . . . . . . . . . 52 161 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 53 162 14.1. Normative References . . . . . . . . . . . . . . . . . . . 53 163 14.2. Informative References . . . . . . . . . . . . . . . . . . 54 164 Appendix A. Collected ABNF . . . . . . . . . . . . . . . . . . . 56 165 Appendix B. Extended Examples . . . . . . . . . . . . . . . . . . 59 166 B.1. Simple Examples . . . . . . . . . . . . . . . . . . . . . 59 167 B.2. Multiple Domain Example . . . . . . . . . . . . . . . . . 60 168 B.3. DNSBL Style Example . . . . . . . . . . . . . . . . . . . 61 169 B.4. Multiple Requirements Example . . . . . . . . . . . . . . 61 170 Appendix C. Changes in implementation requirements from RFC 171 4408 . . . . . . . . . . . . . . . . . . . . . . . . 62 172 Appendix D. Further Testing Advice . . . . . . . . . . . . . . . 63 173 Appendix E. SPF/Mediator Interactions . . . . . . . . . . . . . . 64 174 E.1. Originating ADMDs . . . . . . . . . . . . . . . . . . . . 64 175 E.2. Mediators . . . . . . . . . . . . . . . . . . . . . . . . 65 176 E.3. Receving ADMDs . . . . . . . . . . . . . . . . . . . . . . 65 177 Appendix F. Mail Services . . . . . . . . . . . . . . . . . . . . 66 178 Appendix G. MTA Relays . . . . . . . . . . . . . . . . . . . . . 67 179 Appendix H. Local Policy Considerations . . . . . . . . . . . . . 68 180 H.1. Policy For SPF Pass . . . . . . . . . . . . . . . . . . . 68 181 H.2. Policy For SPF Fail . . . . . . . . . . . . . . . . . . . 68 182 H.3. Policy For SPF Permerror . . . . . . . . . . . . . . . . . 69 183 H.4. Policy For SPF Temperror . . . . . . . . . . . . . . . . . 69 184 Appendix I. Protocol Status . . . . . . . . . . . . . . . . . . . 71 185 Appendix J. Change History . . . . . . . . . . . . . . . . . . . 72 186 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 75 188 1. Introduction 190 The current email infrastructure has the property that any host 191 injecting mail into the system can use any DNS domain name it wants 192 in each of the various identifiers specified by [RFC5321] and 193 [RFC5322]. Although this feature is desirable in some circumstances, 194 it is a major obstacle to reducing Unsolicited Bulk Email (UBE, aka 195 spam). Furthermore, many domain owning ADMDs (as described in 196 [RFC5598]) are understandably concerned about the ease with which 197 other entities can make use of their domain names, often with 198 malicious intent. 200 This document defines a protocol by which ADMDs can authorize hosts 201 to use their domain names in the "MAIL FROM" or "HELO" identities. 202 Compliant ADMDs publish Sender Policy Framework (SPF) records in the 203 DNS specifying which hosts are permitted to use their names, and 204 compliant mail receivers use the published SPF records to test the 205 authorization of sending Mail Transfer Agents (MTAs) using a given 206 "HELO" or "MAIL FROM" identity during a mail transaction. 208 An additional benefit to mail receivers is that after the use of an 209 identity is verified, local policy decisions about the mail can be 210 made based on the sender's domain, rather than the host's IP address. 211 This is advantageous because reputation of domain names is likely to 212 be more accurate than reputation of host IP addresses since domains 213 are likely to be more stable over a longer period. Furthermore, if a 214 claimed identity fails verification, local policy can take stronger 215 action against such email, such as rejecting it. 217 1.1. Terminology 219 1.1.1. Keywords 221 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 222 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 223 "OPTIONAL" in this document are to be interpreted as described in 224 [RFC2119]. 226 1.1.2. Imported Definitions 228 ABNF (Augmented Backus-Naur Form) ABNF is defined in [RFC5234], as 229 are the tokens "ALPHA", "DIGIT", and "SP" (space). 231 The token "local-part" is defined in [RFC5321]. 233 "dot-atom", "quoted-string", "comment", "CFWS" (comment folded white 234 space), "FWS" (folded white space), and "CRLF" (carriage-return/ 235 line-feed) are defined in [RFC5322]. 237 1.1.3. MAIL FROM Definition 239 This document is concerned with the portion of a mail message 240 commonly called "envelope sender", "return path", "reverse path", 241 "bounce address", "5321 FROM", "MAIL FROM", or RFC5321.MailFrom. 242 Since these terms are either not well defined or often used casually, 243 this document uses "MAIL FROM" for consistency. This means the 244 RFC5321.MailFrom as defined in [RFC5598]. Note that other terms that 245 might superficially look like the common terms, such as 'reverse- 246 path', are used only as they are specified in their defining 247 documents. 249 1.1.4. HELO Definition 251 This document also makes use of the HELO/EHLO identity. The "HELO" 252 identity derives from either the SMTP HELO or EHLO command (see 253 [RFC5321]). Since HELO and EHLO can, in many cases, be used 254 interchangeably, they are identified commonly as "HELO" in this 255 document. This means RFC5321.HELO/.EHLO as defined in [RFC5598]. 256 These commands supply the identity of the SMTP client (sending host) 257 for the SMTP session. 259 1.2. check_host() 261 Section 4 introduces an algorithm to evaluate an SPF policy against 262 an arriving email transaction. In an early implementation, this 263 algorithm was encoded in a function called check_host(). That name 264 is used in this document as symbolic of the SPF evaluation algorithm, 265 but of course implementers are not required to use this name. 267 2. Operational Overview 269 2.1. The "HELO" Identity 271 It is RECOMMENDED that SPF verifiers not only check the "MAIL FROM" 272 identity, but also separately check the "HELO" identity by applying 273 the check_host() function (Section 4) to the "HELO" identity as the 274 . Checking "HELO" promotes consistency of results and can 275 reduce DNS resource usage. If a conclusive determination about the 276 message can be made based on a check of "HELO", then the use of DNS 277 resources to process the typically more complex "MAIL FROM" can be 278 avoided. Additionally, since SPF records published for "HELO" 279 identities refer to a single host, when available, they are a very 280 reliable source of host authorization status. Checking "HELO" before 281 "MAIL FROM" is the RECOMMENDED sequence if both are checked. 283 Note that requirements for the domain presented in the EHLO or HELO 284 command are not always clear to the sending party, and SPF verifiers 285 have to be prepared for is identity to be an IP address literal (see 286 [RFC5321] section 4.1.3), or simply be malformed. This SPF check can 287 only be performed when the "HELO" string is a valid, multi-label 288 domain name. 290 2.2. The "MAIL FROM" Identity 292 SPF verifiers MUST check the "MAIL FROM" identity if a "HELO" check 293 has either not been performed or has not reached a definitive policy 294 result by applying the check_host() function to the "MAIL FROM" 295 identity as the . 297 [RFC5321] allows the reverse-path to be null (see Section 4.5.5 in 298 [RFC5321]). In this case, there is no explicit sender mailbox, and 299 such a message can be assumed to be a notification message from the 300 mail system itself. When the reverse-path is null, this document 301 defines the "MAIL FROM" identity to be the mailbox composed of the 302 local-part "postmaster" and the "HELO" identity (which might or might 303 not have been checked separately before). 305 2.3. Publishing Authorization 307 An SPF-compliant domain publishes valid SPF records as described in 308 Section 3. These records authorize the use of the relevant domain 309 names in the "HELO" and "MAIL FROM" identities by the MTAs specified 310 therein. 312 SPF results can be used to make both positive (source is authorized) 313 and negative (source is not authorized) determinations. If ADMDs 314 choose to publish SPF records and want to support receivers making 315 negative authorization determinations, it is necessary for them to 316 publish records that end in "-all", or redirect to other records that 317 do, otherwise, no definitive determination of authorization can be 318 made. Potential issues and mitigations associated with negative 319 determinations are discussed in Section 10. 321 ADMDs that wish to declare that no hosts are authorized to use their 322 DNS domain names in the HELO or MAIL FROM commands during SMTP 323 sessions can publish SPF records that say so for domain names that 324 are neither used in the domain part of email addresses nor expected 325 to originate mail. 327 When changing SPF records, care has to be taken to ensure that there 328 is a transition period so that the old policy remains valid until all 329 legitimate email can reasonably expect to have been checked. 330 [RFC5321] Section 4.5.4.1 discusses how long a message might be in 331 transit. While offline checks are possible, the closer to the 332 original transmission time checks are performed, the more likely they 333 are to get an SPF result that matches the sending ADMD intent at the 334 time the message was sent. 336 2.4. Checking Authorization 338 A mail receiver can perform a set of SPF checks for each mail message 339 it receives. An SPF check tests the authorization of a client host 340 to emit mail with a given identity. Typically, such checks are done 341 by a receiving MTA, but can be performed elsewhere in the mail 342 processing chain so long as the required information is available and 343 reliable. The "MAIL FROM" and "HELO" identities are checked as 344 described in Section 2.2 and Section 2.1 respectively. 346 Without explicit approval of the publishing ADMD, checking other 347 identities against SPF version 1 records is NOT RECOMMENDED because 348 there are cases that are known to give incorrect results. For 349 example, almost all mailing lists rewrite the "MAIL FROM" identity 350 (see Section 10.3), but some do not change any other identities in 351 the message. Documents that define other identities will have to 352 define the method for explicit approval. 354 It is possible that mail receivers will use the SPF check as part of 355 a larger set of tests on incoming mail. The results of other tests 356 might influence whether or not a particular SPF check is performed. 357 For example, finding the sending host's IP address on a local white 358 list might cause all other tests to be skipped and all mail from that 359 host to be accepted. 361 When a mail receiver decides to perform an SPF check, it has to use a 362 correctly-implemented check_host() function (Section 4) evaluated 363 with the correct parameters. Although the test as a whole is 364 optional, once it has been decided to perform a test it has to be 365 performed as specified so that the correct semantics are preserved 366 between publisher and receiver. 368 To make the test, the mail receiver MUST evaluate the check_host() 369 function with the arguments described in Section 4.1. 371 Although invalid, malformed, or non-existent domains cause SPF checks 372 to return "none" because no SPF record can be found, it has long been 373 the policy of many MTAs to reject email from such domains, especially 374 in the case of invalid "MAIL FROM". Rejecting email will prevent one 375 method of circumventing of SPF records. 377 Implementations have to take care to correctly extract the 378 from the data given with the SMTP MAIL FROM command as many MTAs will 379 still accept such things as source routes (see [RFC5321], Appendix 380 C), the %-hack (see [RFC1123]), and bang paths (see [RFC1983]). 381 These archaic features have been maliciously used to bypass security 382 systems. 384 2.5. Location of Checks 386 The authorization check SHOULD be performed during the processing of 387 the SMTP transaction that recieves the mail. This reduces the 388 complexity of determining the correct IP address to use as an input 389 to check_host() and allows errors to be returned directly to the 390 sending MTA by way of SMTP replies. Appencix C of [RFC5451] provides 391 a more thorough discussion of this topic. 393 Performing the authorization check other than using the MAIL FROM and 394 client address at the time of the MAIL command during the SMTP 395 transaction can cause problems, such as the following: (1) It might 396 be difficult to accurately extract the required information from 397 potentially deceptive headers; (2) legitimate email might fail 398 because the sender's policy had since changed. 400 Generating non-delivery notifications to forged identities that have 401 failed the authorization check often constitutes backscatter, i.e., 402 inactionable, nuisance rejection notices. Operators are strongly 403 advised to avoid such practices. Section 2 of [RFC3834] describes 404 backscatter and the problems it causes. 406 2.6. Results of Evaluation 408 Section 4 defines check_host(), a model function definition that uses 409 the inputs defined above and the sender's policy published in the DNS 410 to reach a conclusion about client authorization. An SPF verifier 411 implements something semantically equivalent to the function defined 412 there. 414 This section enumerates and briefly defines the possible outputs of 415 that function. Note, however, that the protocol establishes no 416 normative requirements for handling any particular result. 417 Discussion of handling options for each result can be found in 418 Section 8. 420 2.6.1. None 422 A result of "none" means either (a) no syntactically valid DNS domain 423 name was extracted from the SMTP session that could be used as the 424 one to be authorized, or (b) no TXT records were retrieved from the 425 DNS that appeared to be intended for use by SPF verifiers. 427 2.6.2. Neutral 429 The ADMD has explicitly stated that it is not asserting whether the 430 IP address is authorized. 432 2.6.3. Pass 434 A "pass" result means that the client is authorized to inject mail 435 with the given identity. 437 2.6.4. Fail 439 A "fail" result is an explicit statement that the client is not 440 authorized to use the domain in the given identity. 442 2.6.5. Softfail 444 The ADMD has published a weak statement that the host is probably not 445 authorized. It has not published a stronger, more definitive policy 446 that results in a "fail". 448 2.6.6. Temperror 450 A "temperror" result means the SPF verifier encountered a transient 451 (generally DNS) error while performing the check. A later retry may 452 succeed without further operator action. 454 2.6.7. Permerror 456 A "permerror" result means the domain's published records could not 457 be correctly interpreted. This signals an error condition that 458 definitely requires operator intervention to be resolved. 460 3. SPF Records 462 An SPF record is a DNS record that declares which hosts are, and are 463 not, authorized to use a domain name for the "HELO" and "MAIL FROM" 464 identities. Loosely, the record partitions all hosts into permitted 465 and not-permitted sets (though some hosts might fall into neither 466 category). 468 The SPF record is expressed as a single string of text found in the 469 RDATA of a single DNS TXT resource record. The record format and the 470 process for selecting records is described below in Section 4. An 471 example record is the following: 473 v=spf1 +mx a:colo.example.com/28 -all 475 This record has a version of "spf1" and three directives: "+mx", 476 "a:colo.example.com/28" (the + is implied), and "-all". 478 Each SPF record is placed in the DNS tree at the host name it 479 pertains to, not a subdomain under it, such as is done with SRV 480 records [RFC2782]. 482 The example in this section might be published via these lines in a 483 domain zone file: 485 example.com. TXT "v=spf1 +mx a:colo.example.com/28 -all" 486 smtp-out.example.com. TXT "v=spf1 a -all" 488 Since TXT records have multiple uses, beware of other TXT records 489 published there for other purposes. They might cause problems with 490 size limits (see Section 3.4) and care has to be taken to ensure only 491 SPF records are used for SPF processing. 493 ADMDs publishing SPF records ought to keep the amount of DNS 494 information needed to evaluate a record to a minimum. Section 4.6.4 495 and Section 10.1.1 provide some suggestions about "include" 496 mechanisms and chained "redirect" modifiers. 498 3.1. DNS Resource Records 500 SPF records MUST be published as a DNS TXT (type 16) Resource Record 501 (RR) [RFC1035] only. The character content of the record is encoded 502 as [US-ASCII]. Use of alternative DNS RR types was supported in 503 SPF's experimental phase, but has been discontinued. See Appendix A 504 of [RFC6686] for further information. 506 3.2. Multiple DNS Records 508 A domain name MUST NOT have multiple records that would cause an 509 authorization check to select more than one record. See Section 4.5 510 for the selection rules. 512 3.3. Multiple Strings in a Single DNS record 514 As defined in [RFC1035] sections 3.3 and 3.3.14, a single text DNS 515 record can be composed of more than one string. If a published 516 record contains multiple character-strings, then the record MUST be 517 treated as if those strings are concatenated together without adding 518 spaces. For example: 520 IN TXT "v=spf1 .... first" "second string..." 522 is equivalent to: 524 IN TXT "v=spf1 .... firstsecond string..." 526 TXT records containing multiple strings are useful in constructing 527 records that would exceed the 255-octet maximum length of a 528 character-string within a single TXT record. 530 3.4. Record Size 532 The published SPF record for a given domain name SHOULD remain small 533 enough that the results of a query for it will fit within 512 octets. 534 This UDP limit is defined in [RFC1035] section 2.3.4. This will keep 535 even older DNS implementations from falling over to TCP. Since the 536 answer size is dependent on many things outside the scope of this 537 document, it is only possible to give this guideline: If the combined 538 length of the DNS name and the text of all the records of a given 539 type is under 450 octets, then DNS answers ought to fit in UDP 540 packets. Records that are too long to fit in a single UDP packet 541 could be silently ignored by SPF verifiers due to firewall and other 542 issues that cause DNS over TCP to be less reliable than DNS over UDP. 544 Note that when computing the sizes for replies to queries of the TXT 545 format, one has to take into account any other TXT records published 546 at the domain name. Similarly, the sizes for replies to all queries 547 related to SPF have to be evaluated to fit in a single UDP packet. 549 3.5. Wildcard Records 551 Use of wildcard records for publishing is discouraged and care has to 552 be taken if they are used. If a zone includes wildcard MX records, 553 it might want to publish wildcard declarations, subject to the same 554 requirements and problems. In particular, the declaration MUST be 555 repeated for any host that has any RR records at all, and for 556 subdomains thereof. Consider the example in [RFC1034], Section 557 4.3.3. Based on that, we can do the following: 559 EXAMPLE.COM. MX 10 A.EXAMPLE.COM 560 EXAMPLE.COM. TXT "v=spf1 a:A.EXAMPLE.COM -all" 562 *.EXAMPLE.COM. MX 10 A.EXAMPLE.COM 563 *.EXAMPLE.COM. TXT "v=spf1 a:A.EXAMPLE.COM -all" 565 A.EXAMPLE.COM. A 203.0.113.1 566 A.EXAMPLE.COM. MX 10 A.EXAMPLE.COM 567 A.EXAMPLE.COM. TXT "v=spf1 a:A.EXAMPLE.COM -all" 569 *.A.EXAMPLE.COM. MX 10 A.EXAMPLE.COM 570 *.A.EXAMPLE.COM. TXT "v=spf1 a:A.EXAMPLE.COM -all" 572 SPF records have to be listed twice for every name within the zone: 573 once for the name, and once with a wildcard to cover the tree under 574 the name, in order to cover all domains in use in outgoing mail. 576 4. The check_host() Function 578 This description is not an API (Application Program Interface) 579 definition, but rather a function description used to illustrate the 580 algorithm. A compliant SPF implementation MUST produce results 581 semantically equivalent to this description. 583 The check_host() function fetches SPF records, parses them, and 584 evaluates them to determine whether a particular host is or is not 585 permitted to send mail with a given identity. Receiving ADMDs that 586 perform this check MUST correctly evaluate the check_host() function 587 as described here. 589 Implementations MAY use a different algorithm than the canonical 590 algorithm defined here, so long as the results are the same in all 591 cases. 593 4.1. Arguments 595 The check_host() function takes these arguments: 597 - the IP address of the SMTP client that is emitting the 598 mail, either IPv4 or IPv6. 600 - the domain that provides the sought-after authorization 601 information; initially, the domain portion of the "MAIL 602 FROM" or "HELO" identity. 604 - the "MAIL FROM" or "HELO" identity. 606 For recursive evaluations, the domain portion of might not 607 be the same as the argument when check_host() is initially 608 evaluated. In most other cases it will be the same. (See 609 Section 5.2 below). 611 Note that the argument might not be a well-formed domain 612 name. For example, if the reverse-path was null, then the EHLO/HELO 613 domain is used, with its associated problems (see Section 2.1). In 614 these cases, check_host() is defined in Section 4.3 to return a 615 "none" result. 617 4.2. Results 619 The function check_host() can return one of several results described 620 in Section 2.6. Based on the result, the action to be taken is 621 determined by the local policies of the receiver. This is discussed 622 in Section 8. 624 4.3. Initial Processing 626 If the is malformed (e.g. label longer than 63 characters, 627 zero-length label not at the end, etc.) or is not a multi-label 628 domain name, or if the DNS lookup returns "domain does not exist" 629 (RCODE 3), check_host() immediately returns the result "none". DNS 630 RCODES are defined in [RFC1035]. Properly formed domains are fully 631 qualified domains as defined in [RFC1983]. Internationalized domain 632 names MUST be encoded as A-labels, as described in Section 2.3 of 633 [RFC5890]. 635 If the has no local-part, substitute the string "postmaster" 636 for the local-part. 638 4.4. Record Lookup 640 In accordance with how the records are published (see Section 3 641 above), a DNS query needs to be made for the name, querying 642 for type TXT only. 644 If the DNS lookup returns a server failure (RCODE 2), or other error 645 (RCODE other than 0 or 3), or time out, then check_host() terminates 646 immediately with the result "temperror". 648 This alternative is intended to shorten the queue time of messages 649 that cannot be accepted, by returning a permanent negative completion 650 reply code to the client, instead of a transient one. [RFC2308] 651 suggests an algorithm for doing such tracking and handling of server 652 failure codes. 654 4.5. Selecting Records 656 Records begin with a version section: 658 record = version terms *SP 659 version = "v=spf1" 661 Starting with the set of records that were returned by the lookup, 662 discard records that do not begin with a version section of exactly 663 "v=spf1". Note that the version section is terminated either by an 664 SP character or the end of the record. A record with a version 665 section of "v=spf10" does not match and is discarded. 667 If the resultant record set includes no records, check_host() 668 produces the "none" result. If the resultant record set includes 669 more than one record, check_host() produces the "permerror" result. 671 4.6. Record Evaluation 673 The check_host() function parses and interprets the SPF record to 674 find a result for the current test. If there are any syntax errors 675 anywhere in the record, check_host() returns immediately with the 676 result "permerror", without further interpretation. 678 4.6.1. Term Evaluation 680 There are two types of terms: mechanisms and modifiers. A record 681 contains an ordered list of these as specified in the following 682 Augmented Backus-Naur Form (ABNF). 684 terms = *( 1*SP ( directive / modifier ) ) 686 directive = [ qualifier ] mechanism 687 qualifier = "+" / "-" / "?" / "~" 688 mechanism = ( all / include 689 / a / mx / ptr / ip4 / ip6 / exists ) 690 modifier = redirect / explanation / unknown-modifier 691 unknown-modifier = name "=" macro-string 692 ; where name is not any known modifier 694 name = ALPHA *( ALPHA / DIGIT / "-" / "_" / "." ) 696 Most mechanisms allow a ":" or "/" character after the name. 698 Modifiers always contain an equals ('=') character immediately after 699 the name, and before any ":" or "/" characters that might be part of 700 the macro-string. 702 Terms that do not contain any of "=", ":", or "/" are mechanisms, as 703 defined in Section 5. 705 As per the definition of the ABNF notation in [RFC5234], mechanism 706 and modifier names are case-insensitive. 708 4.6.2. Mechanisms 710 Each mechanism is considered in turn from left to right. If there 711 are no more mechanisms, the result is the default result as described 712 in Section 4.7. 714 When a mechanism is evaluated, one of three things can happen: it can 715 match, not match, or return an exception. 717 If it matches, processing ends and the qualifier value is returned as 718 the result of that record. If it does not match, processing 719 continues with the next mechanism. If it returns an exception, 720 mechanism processing ends and the exception value is returned. 722 The possible qualifiers, and the results they cause check_host() to 723 return are as follows: 725 "+" pass 726 "-" fail 727 "~" softfail 728 "?" neutral 730 The qualifier is optional and defaults to "+". 732 When a mechanism matches and the qualifier is "-", then a "fail" 733 result is returned and the explanation string is computed as 734 described in Section 6.2. 736 The specific mechanisms are described in Section 5. 738 4.6.3. Modifiers 740 Modifiers are not mechanisms. They do not return match or not-match. 741 Instead, they provide additional information. Although modifiers do 742 not directly affect the evaluation of the record, the "redirect" 743 modifier has an effect after all the mechanisms have been evaluated. 745 4.6.4. DNS Lookup Limits 747 SPF implementations MUST limit the total number of mechanisms and 748 modifiers ("terms") that cause any DNS query to 10 during SPF 749 evaluation. Specifically, the "include", "a", "mx", "ptr", and 750 "exists" mechanisms as well as the "redirect" modifier count against 751 this collective limit. The "all", "ip4", and "ip6" mechanisms do not 752 count against this limit. If this number is exceeded during a check, 753 a "permerror" MUST be returned. The "exp" modifier does not count 754 against this limit because the DNS lookup to fetch the explanation 755 string occurs after the SPF record evaluation has been completed. 757 When evaluating the "mx" mechanism, the number of "MX" resource 758 records queried is included in the overall limit of 10 mechanisms/ 759 modifiers that cause DNS lookups described above. The evaluation of 760 each "MX" record MUST NOT result in querying more than 10 "A" 761 resource records. If this limit is exceeded, the "mx" mechanism MUST 762 produce a "permerror" result. 764 When evaluating the "ptr" mechanism or the %{p} macro, the number of 765 "PTR" resource records queried is included in the overall limit of 10 766 mechanisms/modifiers that cause DNS lookups described above. The 767 evaluation of each "PTR" record MUST NOT result in querying more than 768 10 "A" resource records. If this limit is exceeded, all records 769 other than the first 10 MUST be ignored. 771 The reason for the disparity is that the set of and contents of the 772 MX record are under control of the publishing ADMD, while the set of 773 and contents of PTR records are under control of the owner of the IP 774 address actually making the connection. 776 These limits are per mechanism or macro in the record, and are in 777 addition to the lookup limits specified above. 779 MTAs or other processors SHOULD impose a limit on the maximum amount 780 of elapsed time to evaluate check_host(). Such a limit SHOULD allow 781 at least 20 seconds. If such a limit is exceeded, the result of 782 authorization SHOULD be "temperror". 784 As described at the end of Section 11.1, there may be cases where it 785 is useful to limit the number of "terms" for which DNS queries return 786 either a positive answer (RCODE 0) with an answer count of 0, or a no 787 such record (RCODE 3) answer. These are sometimes collectively 788 referred to as "void lookups". SPF implementations SHOULD limit 789 "void lookups" to two. An implementation MAY choose to make such a 790 limit configurable. In this case, a default of two is RECOMMENDED. 792 4.7. Default Result 794 If none of the mechanisms match and there is no "redirect" modifier, 795 then the check_host() returns a result of "neutral", just as if 796 "?all" were specified as the last directive. If there is a 797 "redirect" modifier, check_host() proceeds as defined in Section 6.1. 799 It is better to use either a "redirect" modifier or an "all" 800 mechanism to explicitly terminate processing. Although the latter 801 has a default (specifically "?all"), it aids debugging efforts if it 802 is explicitly provided. 804 For example: 806 v=spf1 +mx -all 807 or 808 v=spf1 +mx redirect=_spf.example.com 810 4.8. Domain Specification 812 Several of these mechanisms and modifiers have a domain-spec section. 813 The domain-spec string is subject to macro expansion (see Section 7). 814 The resulting string is the common presentation form of a fully- 815 qualified DNS name: a series of labels separated by periods. This 816 domain is called the in the rest of this document. 818 Note: The result of the macro expansion is not subject to any further 819 escaping. Hence, this facility cannot produce all characters that 820 are legal in a DNS label (e.g., the control characters). However, 821 this facility is powerful enough to express legal host names and 822 common utility labels (such as "_spf") that are used in DNS. 824 For several mechanisms, the domain-spec is optional. If it is not 825 provided, the from the check_host() arguments (see 826 Section 4.1) is used as the . "domain" and domain-spec 827 are syntactically identical after macro expansion. "domain" is an 828 input value for check_host() while domain-spec is computed by 829 check_host(). 831 The result of evaluating check_host() with a syntactically invalid 832 domain is undefined. 834 5. Mechanism Definitions 836 This section defines two types of mechanisms: basic language 837 framework mechanisms and designated sender mechanisms. 839 Basic mechanisms contribute to the language framework. They do not 840 specify a particular type of authorization scheme. 842 all 843 include 845 Designated sender mechanisms are used to identify a set of 846 addresses as being permitted or not permitted to use the for 847 sending mail. 849 a 850 mx 851 ptr (do not use) 852 ip4 853 ip6 854 exists 856 The following conventions apply to all mechanisms that perform a 857 comparison between and an IP address at any point: 859 If no CIDR prefix length is given in the directive, then and the 860 IP address are compared for equality. (Here, CIDR is Classless 861 Inter-Domain Routing, described in [RFC4632].) 863 If a CIDR prefix length is specified, then only the specified number 864 of high-order bits of and the IP address are compared for 865 equality. 867 When any mechanism fetches host addresses to compare with , when 868 is an IPv4, "A" records are fetched; when is an IPv6 869 address, "AAAA" records are fetched. SPF implementations on IPv6 870 servers need to handle both "AAAA" and "A" records, for clients on 871 IPv4 mapped IPv6 addresses [RFC4291]. IPv4 addresses are only 872 listed in an SPF record using the "ip4" mechanism. 874 Several mechanisms rely on information fetched from the DNS. For 875 these DNS queries, except where noted, if the DNS server returns an 876 error (RCODE other than 0 or 3) or the query times out, the mechanism 877 stops and the topmost check_host() returns "temperror". If the 878 server returns "domain does not exist" (RCODE 3), then evaluation of 879 the mechanism continues as if the server returned no error (RCODE 0) 880 and zero answer records. 882 5.1. "all" 884 all = "all" 886 The "all" mechanism is a test that always matches. It is used as the 887 rightmost mechanism in a record to provide an explicit default. 889 For example: 891 v=spf1 a mx -all 893 Mechanisms after "all" will never be tested. Mechanisms listed after 894 "all" MUST be ignored. Any "redirect" modifier (Section 6.1) MUST be 895 ignored when there is an "all" mechanism in the record. 897 5.2. "include" 899 include = "include" ":" domain-spec 901 The "include" mechanism triggers a recursive evaluation of 902 check_host(). 904 1. The domain-spec is expanded as per Section 7. 906 2. check_host() is evaluated with the resulting string as the 907 . The and arguments remain the same as in 908 the current evaluation of check_host(). 910 3. The recursive evaluation returns either match, not match, or an 911 error. If it matches, then the appropriate result for the 912 include: mechanism is used (e.g. include or +include produces a 913 "pass" result and -include produces "fail"). 915 4. If there is no match, the parent check_host() resumes processing 916 as per the table below, with the previous value of 917 restored. 919 In hindsight, the name "include" was poorly chosen. Only the 920 evaluated result of the referenced SPF record is used, rather than 921 literally including the mechanisms of the referenced record in the 922 first. For example, evaluating a "-all" directive in the referenced 923 record does not terminate the overall processing and does not 924 necessarily result in an overall "fail". (Better names for this 925 mechanism would have been "if-match", "on-match", etc.) 927 The "include" mechanism makes it possible for one domain to designate 928 multiple administratively-independent domains. For example, a vanity 929 domain "example.net" might send mail using the servers of 930 administratively-independent domains example.com and example.org. 932 Example.net could say 934 IN TXT "v=spf1 include:example.com include:example.org -all" 936 This would direct check_host() to, in effect, check the records of 937 example.com and example.org for a "pass" result. Only if the host 938 were not permitted for either of those domains would the result be 939 "fail". 941 Whether this mechanism matches, does not match, or returns an 942 exception depends on the result of the recursive evaluation of 943 check_host(): 945 +---------------------------------+---------------------------------+ 946 | A recursive check_host() result | Causes the "include" mechanism | 947 | of: | to: | 948 +---------------------------------+---------------------------------+ 949 | pass | match | 950 | | | 951 | fail | not match | 952 | | | 953 | softfail | not match | 954 | | | 955 | neutral | not match | 956 | | | 957 | temperror | return temperror | 958 | | | 959 | permerror | return permerror | 960 | | | 961 | none | return permerror | 962 +---------------------------------+---------------------------------+ 964 The "include" mechanism is intended for crossing administrative 965 boundaries. For example, if example.com and example.org were managed 966 by the same entity, and if the permitted set of hosts for both 967 domains was "mx:example.com", it would be possible for example.org to 968 specify "include:example.com", but it would be preferable to specify 969 "redirect=example.com" or even "mx:example.com". 971 With the "include" mechanism an administratively external set of 972 hosts can be authorized, but determination of sender policy is still 973 a function of the original domain's SPF record (as determined by the 974 "all" mechanism in that record). The redirect modifier is more 975 suitable for consolidating both authorizations and policy into a 976 common set to be shared within an ADMD. Redirect is much more like a 977 common code element to be shared among records in a single ADMD. It 978 is possible to control both authorized hosts and policy for an 979 arbitrary number of domains from a single record. 981 5.3. "a" 983 This mechanism matches if is one of the 's IP 984 addresses. 986 a = "a" [ ":" domain-spec ] [ dual-cidr-length ] 988 An address lookup is done on the using the type of 989 lookup (A or AAAA) appropriate for the connection type (IPv4 or 990 IPv6). The is compared to the returned address(es). If any 991 address matches, the mechanism matches. 993 5.4. "mx" 995 This mechanism matches if is one of the MX hosts for a domain 996 name. 998 mx = "mx" [ ":" domain-spec ] [ dual-cidr-length ] 1000 check_host() first performs an MX lookup on the . Then 1001 it performs an address lookup on each MX name returned. The is 1002 compared to each returned IP address. To prevent Denial of Service 1003 (DoS) attacks, the processing limits defined in Section 4.6.4 MUST be 1004 followed. If the MX lookup limit is exceeded, then "permerror" is 1005 returned and the evaluation is terminated. If any address matches, 1006 the mechanism matches. 1008 Note regarding implicit MXes: If the has no MX record, 1009 check_host() MUST NOT apply the implicit MX rules of[RFC5321] by 1010 querying for an A or AAAA record for the same name. 1012 5.5. "ptr" (do not use) 1014 This mechanism tests whether the DNS reverse-mapping for exists 1015 and correctly points to a domain name within a particular domain. 1016 This mechanism SHOULD NOT be used. See below for discussion. 1018 ptr = "ptr" [ ":" domain-spec ] 1020 The 's name is looked up using this procedure: 1022 o Perform a DNS reverse-mapping for : Look up the corresponding 1023 PTR record in "in-addr.arpa." if the address is an IPv4 one and in 1024 "ip6.arpa." if it is an IPv6 address. 1026 o For each record returned, validate the domain name by looking up 1027 its IP addresses. To prevent DoS attacks, the PTR processing 1028 limits defined in Section 4.6.4 MUST be applied. If they are 1029 exceeded, processing is terminated and the mechanism does not 1030 match. 1032 o If is among the returned IP addresses, then that domain name 1033 is validated. 1035 Check all validated domain names to see if they either match the 1036 domain or are a subdomain of the domain. 1037 If any do, this mechanism matches. If no validated domain name can 1038 be found, or if none of the validated domain names match or are a 1039 subdomain of the , this mechanism fails to match. If a 1040 DNS error occurs while doing the PTR RR lookup, then this mechanism 1041 fails to match. If a DNS error occurs while doing an A RR lookup, 1042 then that domain name is skipped and the search continues. 1044 Pseudocode: 1046 sending-domain_names := ptr_lookup(sending-host_IP); 1047 if more than 10 sending-domain_names are found, use at most 10. 1048 for each name in (sending-domain_names) { 1049 IP_addresses := a_lookup(name); 1050 if the sending-domain_IP is one of the IP_addresses { 1051 validated-sending-domain_names += name; 1052 } 1053 } 1055 for each name in (validated-sending-domain_names) { 1056 if name ends in , return match. 1057 if name is , return match. 1058 } 1059 return no-match. 1061 This mechanism matches if the is either a subdomain of 1062 a validated domain name or if the and a validated 1063 domain name are the same. For example: "mail.example.com" is within 1064 the domain "example.com", but "mail.bad-example.com" is not. 1066 Note: This mechanism is slow, it is not as reliable as other 1067 mechanisms in cases of DNS errors, and it places a large burden on 1068 the .arpa name servers. If used, proper PTR records have to be in 1069 place for the domain's hosts and the "ptr" mechanism SHOULD be one of 1070 the last mechanisms checked. After many years of SPF deployment 1071 experience, it has been concluded it is unnecessary and more reliable 1072 alternatives should be used instead. It is, however, still in use as 1073 part of the SPF protocol, so compliant check_host() implementations 1074 MUST support it. 1076 5.6. "ip4" and "ip6" 1078 These mechanisms test whether is contained within a given IP 1079 network. 1081 ip4 = "ip4" ":" ip4-network [ ip4-cidr-length ] 1082 ip6 = "ip6" ":" ip6-network [ ip6-cidr-length ] 1084 ip4-cidr-length = "/" 1*DIGIT 1085 ip6-cidr-length = "/" 1*DIGIT 1086 dual-cidr-length = [ ip4-cidr-length ] [ "/" ip6-cidr-length ] 1088 ip4-network = qnum "." qnum "." qnum "." qnum 1089 qnum = DIGIT ; 0-9 1090 / %x31-39 DIGIT ; 10-99 1091 / "1" 2DIGIT ; 100-199 1092 / "2" %x30-34 DIGIT ; 200-249 1093 / "25" %x30-35 ; 250-255 1094 ; as per conventional dotted quad notation. e.g., 192.0.2.0 1095 ip6-network = 1096 ; e.g., 2001:DB8::CD30 1098 The is compared to the given network. If CIDR prefix length 1099 high-order bits match, the mechanism matches. 1101 If ip4-cidr-length is omitted, it is taken to be "/32". If 1102 ip6-cidr-length is omitted, it is taken to be "/128". It is not 1103 permitted to omit parts of the IP address instead of using CIDR 1104 notations. That is, use 192.0.2.0/24 instead of 192.0.2. 1106 5.7. "exists" 1108 This mechanism is used to construct an arbitrary domain name that is 1109 used for a DNS A record query. It allows for complicated schemes 1110 involving arbitrary parts of the mail envelope to determine what is 1111 permitted. 1113 exists = "exists" ":" domain-spec 1115 The domain-spec is expanded as per Section 7. The resulting domain 1116 name is used for a DNS A RR lookup (even when the connection type is 1117 IPv6). If any A record is returned, this mechanism matches. 1119 Domains can use this mechanism to specify arbitrarily complex 1120 queries. For example, suppose example.com publishes the record: 1122 v=spf1 exists:%{ir}.%{l1r+-}._spf.%{d} -all 1124 The might expand to 1125 "1.2.0.192.someuser._spf.example.com". This makes fine-grained 1126 decisions possible at the level of the user and client IP address. 1128 6. Modifier Definitions 1130 Modifiers are name/value pairs that provide additional information. 1131 Modifiers always have an "=" separating the name and the value. 1133 The modifiers defined in this document ("redirect" and "exp") MAY 1134 appear anywhere in the record, but SHOULD appear at the end, after 1135 all mechanisms. Ordering of these two modifiers does not matter. 1136 These two modifiers MUST NOT appear in a record more than once each. 1137 If they do, then check_host() exits with a result of "permerror". 1139 Unrecognized modifiers MUST be ignored no matter where in a record, 1140 or how often. This allows implementations of this document to 1141 gracefully handle records with modifiers that are defined in other 1142 specifications. 1144 6.1. redirect: Redirected Query 1146 The redirect modifier is intended for consolidating both 1147 authorizations and policy into a common set to be shared within a 1148 single ADMD. It is possible to control both authorized hosts and 1149 policy for an arbitrary number of domains from a single record. 1151 redirect = "redirect" "=" domain-spec 1153 If all mechanisms fail to match, and a "redirect" modifier is 1154 present, then processing proceeds as follows: 1156 The domain-spec portion of the redirect section is expanded as per 1157 the macro rules in Section 7. Then check_host() is evaluated with 1158 the resulting string as the . The and 1159 arguments remain the same as in the current evaluation of 1160 check_host(). 1162 The result of this new evaluation of check_host() is then considered 1163 the result of the current evaluation with the exception that if no 1164 SPF record is found, or if the is malformed, the result 1165 is a "permerror" rather than "none". 1167 Note that the newly-queried domain can itself specify redirect 1168 processing. 1170 This facility is intended for use by organizations that wish to apply 1171 the same record to multiple domains. For example: 1173 la.example.com. TXT "v=spf1 redirect=_spf.example.com" 1174 ny.example.com. TXT "v=spf1 redirect=_spf.example.com" 1175 sf.example.com. TXT "v=spf1 redirect=_spf.example.com" 1177 _spf.example.com. TXT "v=spf1 mx:example.com -all" 1179 In this example, mail from any of the three domains is described by 1180 the same record. This can be an administrative advantage. 1182 Note: In general, the domain "A" cannot reliably use a redirect to 1183 another domain "B" not under the same administrative control. Since 1184 the stays the same, there is no guarantee that the record at 1185 domain "B" will correctly work for mailboxes in domain "A", 1186 especially if domain "B" uses mechanisms involving local-parts. An 1187 "include" directive will generally be more appropriate. 1189 For clarity, it is RECOMMENDED that any "redirect" modifier appear as 1190 the very last term in a record. 1192 6.2. exp: Explanation 1194 explanation = "exp" "=" domain-spec 1196 If check_host() results in a "fail" due to a mechanism match (such as 1197 "-all"), and the "exp" modifier is present, then the explanation 1198 string returned is computed as described below. If no "exp" modifier 1199 is present, then either a default explanation string or an empty 1200 explanation string MUST be returned to the calling application. 1202 The domain-spec is macro expanded (see Section 7) and becomes the 1203 . The DNS TXT record for the is fetched. 1205 If there are any DNS processing errors (any RCODE other than 0), or 1206 if no records are returned, or if more than one record is returned, 1207 or if there are syntax errors in the explanation string, then proceed 1208 as if no "exp" modifier was given. 1210 The fetched TXT record's strings are concatenated with no spaces, and 1211 then treated as an explain-string, which is macro-expanded. This 1212 final result is the explanation string. Implementations MAY limit 1213 the length of the resulting explanation string to allow for other 1214 protocol constraints and/or reasonable processing limits. Since the 1215 explanation string is intended for an SMTP response and [RFC5321] 1216 Section 2.4 says that responses are in [US-ASCII], the explanation 1217 string MUST be limited to [US-ASCII]. 1219 Software evaluating check_host() can use this string to communicate 1220 information from the publishing domain in the form of a short message 1221 or URL. Software SHOULD make it clear that the explanation string 1222 comes from a third party. For example, it can prepend the macro 1223 string "%{o} explains: " to the explanation, such as shown in 1224 Section 8.4. 1226 Suppose example.com has this record: 1228 v=spf1 mx -all exp=explain._spf.%{d} 1230 Here are some examples of possible explanation TXT records at 1231 explain._spf.example.com: 1233 "Mail from example.com should only be sent by its own servers." 1234 -- a simple, constant message 1236 "%{i} is not one of %{d}'s designated mail servers." 1237 -- a message with a little more information, including the IP 1238 address that failed the check 1240 "See http://%{d}/why.html?s=%{S}&i=%{I}" 1241 -- a complicated example that constructs a URL with the 1242 arguments to check_host() so that a web page can be 1243 generated with detailed, custom instructions 1245 Note: During recursion into an "include" mechanism, an "exp" modifier 1246 from the MUST NOT be used. In contrast, when executing 1247 a "redirect" modifier, an "exp" modifier from the original domain 1248 MUST NOT be used. This is because "include" is meant to cross 1249 administrative boundaries and the explanation provided should be the 1250 one from the receiving ADMD, while "redirect" is meant to operate as 1251 a tool to consolidate policy records within an ADMD an so the 1252 redirected explanation is the one that ought to have priority. 1254 7. Macros 1256 When evaluating an SPF policy record, certain character sequences are 1257 intended to be replaced by parameters of the message or of the 1258 connection. These character sequences are referred to as "macros". 1260 7.1. Formal Specification 1262 The ABNF description for a macro is as follows: 1264 domain-spec = macro-string domain-end 1265 domain-end = ( "." toplabel [ "." ] ) / macro-expand 1267 toplabel = ( *alphanum ALPHA *alphanum ) / 1268 ( 1*alphanum "-" *( alphanum / "-" ) alphanum ) 1269 alphanum = ALPHA / DIGIT 1271 explain-string = *( macro-string / SP ) 1273 macro-string = *( macro-expand / macro-literal ) 1274 macro-expand = ( "%{" macro-letter transformers *delimiter "}" ) 1275 / "%%" / "%_" / "%-" 1276 macro-literal = %x21-24 / %x26-7E 1277 ; visible characters except "%" 1278 macro-letter = "s" / "l" / "o" / "d" / "i" / "p" / "h" / 1279 "c" / "r" / "t" / "v" 1280 transformers = *DIGIT [ "r" ] 1281 delimiter = "." / "-" / "+" / "," / "/" / "_" / "=" 1283 The "toplabel" construction is subject to the LDH rule plus 1284 additional top-level domain (TLD) restrictions. See Section 2 of 1285 [RFC3696] for background. 1287 Some special cases: 1289 o A literal "%" is expressed by "%%". 1291 o "%_" expands to a single " " space. 1293 o "%-" expands to a URL-encoded space, viz., "%20". 1295 7.2. Macro Definitions 1297 The following macro letters are expanded in term arguments: 1299 s = 1300 l = local-part of 1301 o = domain of 1302 d = 1303 i = 1304 p = the validated domain name of (do not use) 1305 v = the string "in-addr" if is ipv4, or "ip6" if is ipv6 1306 h = HELO/EHLO domain 1308 , , and are defined in Section 2.4. 1310 The following macro letters are allowed only in "exp" text: 1312 c = SMTP client IP (easily readable format) 1313 r = domain name of host performing the check 1314 t = current timestamp 1316 7.3. Macro Processing Details 1318 A '%' character not followed by a '{', '%', '-', or '_' character is 1319 a syntax error. So: 1321 -exists:%(ir).sbl.example.org 1323 is incorrect and will cause check_host() to yield a "permerror". 1324 Instead, the following is legal: 1326 -exists:%{ir}.sbl.example.org 1328 Optional transformers are the following: 1330 *DIGIT = zero or more digits 1331 r = reverse value, splitting on dots by default 1333 If transformers or delimiters are provided, the replacement value for 1334 a macro letter is split into parts separated by one or more of the 1335 specified delimiter characters. After performing any reversal 1336 operation and/or removal of left-hand parts, the parts are rejoined 1337 using "." and not the original splitting characters. 1339 By default, strings are split on "." (dots). Note that no special 1340 treatment is given to leading, trailing, or consecutive delimiters in 1341 input strings, and so the list of parts might contain empty strings. 1342 Some older implementations of SPF prohibit trailing dots in domain 1343 names, so trailing dots SHOULD NOT be published, although they MUST 1344 be accepted by implementations conforming to this document. Macros 1345 can specify delimiter characters that are used instead of ".". 1347 The "r" transformer indicates a reversal operation: if the client IP 1348 address were 192.0.2.1, the macro %{i} would expand to "192.0.2.1" 1349 and the macro %{ir} would expand to "1.2.0.192". 1351 The DIGIT transformer indicates the number of right-hand parts to 1352 use, after optional reversal. If a DIGIT is specified, the value 1353 MUST be nonzero. If no DIGITs are specified, or if the value 1354 specifies more parts than are available, all the available parts are 1355 used. If the DIGIT was 5, and only 3 parts were available, the macro 1356 interpreter would pretend the DIGIT was 3. Implementations MUST 1357 support at least a value of 128, as that is the maximum number of 1358 labels in a domain name. 1360 The "s" macro expands to the argument. It is an email 1361 address with a local-part, an "@" character, and a domain. The "l" 1362 macro expands to just the local-part. The "o" macro expands to just 1363 the domain part. Note that these values remain the same during 1364 recursive and chained evaluations due to "include" and/or "redirect". 1365 Note also that if the original had no local-part, the local- 1366 part was set to "postmaster" in initial processing (see Section 4.3). 1368 For IPv4 addresses, both the "i" and "c" macros expand to the 1369 standard dotted-quad format. 1371 For IPv6 addresses, the "i" macro expands to a dot-format address; it 1372 is intended for use in %{ir}. The "c" macro can expand to any of the 1373 hexadecimal colon-format addresses specified in [RFC4291], Section 1374 2.2. It is intended for humans to read. 1376 The "p" macro expands to the validated domain name of . The 1377 procedure for finding the validated domain name is defined in 1378 Section 5.5. If the is present in the list of validated 1379 domains, it SHOULD be used. Otherwise, if a subdomain of the 1380 is present, it SHOULD be used. Otherwise, any name from the 1381 list can be used. If there are no validated domain names or if a DNS 1382 error occurs, the string "unknown" is used. 1384 This macro SHOULD NOT be used (see Section 5.5 for the discussion). 1386 The "h" macro expands to the parameter that was provided to the SMTP 1387 server via the HELO or EHLO SMTP verb. For sessions where that verb 1388 was provided more than once, the most recent instance is used. 1390 The "r" macro expands to the name of the receiving MTA. This SHOULD 1391 be a fully qualified domain name, but if one does not exist (as when 1392 the checking is done by a MUA) or if policy restrictions dictate 1393 otherwise, the word "unknown" SHOULD be substituted. The domain name 1394 can be different from the name found in the MX record that the client 1395 MTA used to locate the receiving MTA. 1397 The "t" macro expands to the decimal representation of the 1398 approximate number of seconds since the Epoch (Midnight, January 1, 1399 1970, UTC) at the time of the evaluation. This is the same value as 1400 is returned by the POSIX time() function in most standards-compliant 1401 libraries. 1403 When the result of macro expansion is used in a domain name query, if 1404 the expanded domain name exceeds 253 characters (the maximum length 1405 of a domain name), the left side is truncated to fit, by removing 1406 successive domain labels (and their following dots) until the total 1407 length does not exceed 253 characters. 1409 Uppercased macros expand exactly as their lowercased equivalents, and 1410 are then URL escaped. URL escaping MUST be performed for characters 1411 not in the "unreserved" set, which is defined in [RFC3986]. 1413 Care has to be taken by the sending ADMD so that macro expansion for 1414 legitimate email does not exceed the 63-character limit on DNS 1415 labels. The local-part of email addresses, in particular, can have 1416 more than 63 characters between dots. 1418 To minimize DNS lookup resource requirements, it is better if sending 1419 ADMDs avoid using the "s", "l", "o", or "h" macros in conjunction 1420 with any mechanism directive. Although these macros are powerful and 1421 allow per-user records to be published, they severely limit the 1422 ability of implementations to cache results of check_host() and they 1423 reduce the effectiveness of DNS caches. 1425 If no directive processed during the evaluation of check_host() 1426 contains an "s", "l", "o", or "h" macro, then the results of the 1427 evaluation can be cached on the basis of and alone for 1428 as long as the DNS record involved with the shortest TTL has not 1429 expired. 1431 7.4. Expansion Examples 1433 The is strong-bad@email.example.com. 1434 The IPv4 SMTP client IP is 192.0.2.3. 1435 The IPv6 SMTP client IP is 2001:DB8::CB01. 1436 The PTR domain name of the client IP is mx.example.org. 1438 macro expansion 1439 ------- ---------------------------- 1440 %{s} strong-bad@email.example.com 1441 %{o} email.example.com 1442 %{d} email.example.com 1443 %{d4} email.example.com 1444 %{d3} email.example.com 1445 %{d2} example.com 1446 %{d1} com 1447 %{dr} com.example.email 1448 %{d2r} example.email 1449 %{l} strong-bad 1450 %{l-} strong.bad 1451 %{lr} strong-bad 1452 %{lr-} bad.strong 1453 %{l1r-} strong 1455 macro-string expansion 1456 -------------------------------------------------------------------- 1457 %{ir}.%{v}._spf.%{d2} 3.2.0.192.in-addr._spf.example.com 1458 %{lr-}.lp._spf.%{d2} bad.strong.lp._spf.example.com 1460 %{lr-}.lp.%{ir}.%{v}._spf.%{d2} 1461 bad.strong.lp.3.2.0.192.in-addr._spf.example.com 1463 %{ir}.%{v}.%{l1r-}.lp._spf.%{d2} 1464 3.2.0.192.in-addr.strong.lp._spf.example.com 1466 %{d2}.trusted-domains.example.net 1467 example.com.trusted-domains.example.net 1469 IPv6: 1470 %{ir}.%{v}._spf.%{d2} 1.0.B.C.0.0.0.0. 1471 0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.B.D.0.1.0.0.2.ip6._spf.example.com 1473 8. Result Handling 1475 This section provides guidance for operators in response to the 1476 various possible outputs of check_host() on a message. Definitions 1477 of SPF results are presented in Section 2.6; this section provides 1478 more detail on each for use in developing local policy for message 1479 handling. 1481 Every operating environment is different. There are some receivers 1482 for whom strict adherence to SPF is appropriate, and definitive 1483 treatment of messages that are evaluated to be explicitly 1484 unauthorized ("fail" and sometimes "softfail") is the norm. There 1485 are others for which the "false negative" cases are more of a 1486 concern. This concern is typically handled by merely recording the 1487 result in the header and allowing the message to pass on for 1488 additional processing. There are still others where SPF is one of 1489 several inputs to the message handling decision. As such, there is 1490 no comprehensive normative requirement for message handling in 1491 response to any particular result. This section is provided to 1492 present a complete picture of the likely cause of each result and, 1493 where available, the experience gained during experimental 1494 deployment. 1496 There are essentially two classes of handling choices: 1498 o Handling within the SMTP session that attempted to deliver the 1499 message, such as by returning a permanent SMTP error (rejection) 1500 or temporary SMTP error ("try again later"); 1502 o Permitting the message to pass (a successful SMTP reply code) and 1503 adding an additional header field that indicates the result 1504 returned by check_host() and other salient details; this is 1505 discussed in more detail in Section 9. 1507 8.1. None 1509 With a "none" result, the SPF verifier has no information at all 1510 about the authorization or lack thereof of the client to use the 1511 checked identity or identities. The check_host() function completed 1512 without errors but was not able to reach any conclusion. 1514 8.2. Neutral 1516 A "neutral" result indicates that although a policy for the identity 1517 was discovered, there is no definite assertion (positive or negative) 1518 about the client. 1520 A "neutral" result MUST be treated exactly like the "none" result; 1521 the distinction exists only for informational purposes. Treating 1522 "neutral" more harshly than "none" would discourage ADMDs from 1523 testing the use of SPF records (see Section 10.1). 1525 8.3. Pass 1527 A "pass" result means that the client is authorized to inject mail 1528 with the given identity. The domain can now, in the sense of 1529 reputation, be considered responsible for sending the message. 1530 Further policy checks can now proceed with confidence in the 1531 legitimate use of the identity. This is further discussed in 1532 Appendix H.1. 1534 8.4. Fail 1536 A "fail" result is an explicit statement that the client is not 1537 authorized to use the domain in the given identity. Disposition of 1538 SPF fail messages is a matter of local policy. See Appendix H.2 for 1539 considerations on developing local policy. 1541 If the checking software chooses to reject the mail during the SMTP 1542 transaction, then it SHOULD use an SMTP reply code of 550 (see 1543 [RFC5321]) and, if supported, the 5.7.1 enhanced status code (see 1544 [RFC3463], Section 3.8), in addition to an appropriate reply text. 1545 The check_host() function will return either a default explanation 1546 string or one from the domain that published the SPF records (see 1547 Section 6.2). If the information does not originate with the 1548 checking software, it is good to make it clear that the text is 1549 provided by the sender's domain. For example: 1551 550-5.7.1 SPF MAIL FROM check failed: 1552 550-5.7.1 The domain example.com explains: 1553 550 5.7.1 Please see http://www.example.com/mailpolicy.html 1555 If the checking software chooses not to reject the mail during the 1556 SMTP transaction, then it SHOULD add a Received-SPF or 1557 Authentication-Results header field (see Section 9) to communicate 1558 this result to downstream message processors. While this is true for 1559 all SPF results, it is of particular importance for "fail" results 1560 since the message is explicitly not authorized by the ADMD. 1562 8.5. Softfail 1564 A "softfail" result ought to be treated as somewhere between "fail" 1565 and "neutral"/"none". The ADMD believes the host is not authorized 1566 but is not willing to make a strong policy statement. Receiving 1567 software SHOULD NOT reject the message based solely on this result, 1568 but MAY subject the message to closer scrutiny than normal. 1570 The ADMD wants to discourage the use of this host and thus desires 1571 limited feedback when a "softfail" result occurs. For example, the 1572 recipient's Mail User Agent (MUA) could highlight the "softfail" 1573 status, or the receiving MTA could give the sender a message using 1574 greylisting, [RFC6647], with a note the first time the message is 1575 received, but accept it on a later attempt based on receiver policy. 1577 8.6. Temperror 1579 A "temperror" result means the SPF verifier encountered a transient 1580 (generally DNS) error while performing the check. Checking software 1581 can choose to accept or temporarily reject the message. If the 1582 message is rejected during the SMTP transaction for this reason, the 1583 software SHOULD use an SMTP reply code of 451 and, if supported, the 1584 4.4.3 enhanced status code (see [RFC3463], Section 3.5). These 1585 errors can be caused by problems in either the sender's or receiver's 1586 DNS software. See Appendix H.4 for considerations on developing 1587 local policy. 1589 8.7. Permerror 1591 A "permerror" result means the domain's published records could not 1592 be correctly interpreted. This signals an error condition that 1593 definitely requires operator intervention to be resolved. If the 1594 message is rejected during the SMTP transaction for this reason, the 1595 software SHOULD use an SMTP reply code of 550 and, if supported, the 1596 5.5.2 enhanced status code (see [RFC3463], Section 3.6). Be aware 1597 that if the ADMD uses macros (Section 7), it is possible that this 1598 result is due to the checked identities having an unexpected format. 1599 It is also possible that this result is generated by certain SPF 1600 verifiers due to the input arguments having an unexpected format; see 1601 Section 4.8. See Appendix H.3 for considerations on developing local 1602 policy. 1604 9. Recording the Result 1606 To provide downstream agents, such as MUAs, with the information they 1607 might need in terms of evaluating or representing the apparent safety 1608 of the message content, it is RECOMMENDED that SMTP receivers record 1609 the result of SPF processing in the message header. For operators 1610 that choose to record SPF results in the header of the message for 1611 processing by internal filters or MUAs, two methods are presented. 1612 Section 9.1 defines the Received-SPF field, which is the results 1613 field originally defined for SPF use. Section 9.2 discusses 1614 Authentication-Results [RFC5451] which was specified more recently 1615 and is designed for use by SPF and other authentication methods. 1617 Both are in common use, and hence both are included here. However, 1618 it is important to note that they were designed to serve slightly 1619 different purposes. Received-SPF is intended to include enough 1620 forensic information to enable reconstruction of the SPF evaluation 1621 of the message, while Authentication-Results is designed only to 1622 relay the result itself and related output details of likely use to 1623 end users (e.g., what property of the message was actually 1624 authenticated and what it contained), leaving forensic work to the 1625 purview of system logs and the Received field contents. Also, 1626 Received-SPF relies on compliance of agents within the receiving ADMD 1627 to adhere to the header field ordering rules of [RFC5321] and 1628 [RFC5322], while Authentication-Results includes some provisions to 1629 protect against non-compliant implementations. 1631 An operator could choose to use both to serve different downstream 1632 agents. In such cases, care needs to be taken to ensure both fields 1633 are conveying the same details, or unexpected results can occur. 1635 9.1. The Received-SPF Header Field 1637 The Received-SPF header field is a trace field (see [RFC5322] Section 1638 3.6.7) and SHOULD be prepended to the existing header, above the 1639 Received: field that is generated by the SMTP receiver. It MUST 1640 appear above all other Received-SPF fields in the message. The 1641 header field has the following format: 1643 header-field = "Received-SPF:" [CFWS] result FWS [comment FWS] 1644 [ key-value-list ] CRLF 1646 result = "pass" / "fail" / "softfail" / "neutral" / 1647 "none" / "temperror" / "permerror" 1649 key-value-list = key-value-pair *( ";" [CFWS] key-value-pair ) 1650 [";"] 1652 key-value-pair = key [CFWS] "=" ( dot-atom / quoted-string ) 1654 key = "client-ip" / "envelope-from" / "helo" / 1655 "problem" / "receiver" / "identity" / 1656 "mechanism" / name 1658 identity = "mailfrom" ; for the "MAIL FROM" identity 1659 / "helo" ; for the "HELO" identity 1660 / name ; other identities 1662 dot-atom = 1663 quoted-string = 1664 comment = 1665 CFWS = 1666 FWS = 1667 CRLF = 1669 The header field SHOULD include a "(...)" style comment after the 1670 result, conveying supporting information for the result, such as 1671 , , and . 1673 The following key-value pairs are designed for later machine parsing. 1674 SPF verifiers SHOULD give enough information so that the SPF results 1675 can be verified. That is, at least "client-ip", "helo", and, if the 1676 "MAIL FROM" identity was checked, "envelope-from". 1678 client-ip the IP address of the SMTP client 1680 envelope-from the envelope sender mailbox 1682 helo the host name given in the HELO or EHLO command 1684 mechanism the mechanism that matched (if no mechanisms matched, 1685 substitute the word "default") 1687 problem if an error was returned, details about the error 1688 receiver the host name of the SPF verifier 1690 identity the identity that was checked; see the ABNF 1691 rule 1693 Other keys MAY be defined by SPF verifiers. 1695 SPF verifiers MUST make sure that the Received-SPF header field does 1696 not contain invalid characters, is not excessively long (See 1697 [RFC5322] Section 2.1.1), and does not contain malicious data that 1698 has been provided by the sender. 1700 Examples of various header field styles that could be generated are 1701 the following: 1703 Received-SPF: pass (mybox.example.org: domain of 1704 myname@example.com designates 192.0.2.1 as permitted sender) 1705 receiver=mybox.example.org; client-ip=192.0.2.1; 1706 envelope-from="myname@example.com"; helo=foo.example.com; 1708 Received-SPF: fail (mybox.example.org: domain of 1709 myname@example.com does not designate 1710 192.0.2.1 as permitted sender) 1711 identity=mailfrom; client-ip=192.0.2.1; 1712 envelope-from="myname@example.com"; 1714 Received-SPF: pass (mybox.example.org: domain of 1715 myname@example.com designates 192.0.2.1 as permitted sender) 1716 receiver=mybox.example.org; client-ip=192.0.2.1; 1717 mechanism=ip4:192.0.2.1; envelope-from="myname@example.com"; 1718 helo=foo.example.com; 1720 9.2. SPF Results in the Authentication-Results Header Field 1722 As mentioned in Section 9, the Authentication-Results header field is 1723 designed to communicate lists of tests a border MTA did and their 1724 results. The specified elements of the field provide less 1725 information than the Received-SPF field: 1727 Authentication-Results: myhost.example.org; spf=pass 1728 smtp.mailfrom=example.net 1730 Received-SPF: pass (myhost.example.org: domain of 1731 myname@example.com designates 192.0.2.1 as permitted sender) 1732 receiver=mybox.example.org; client-ip=192.0.2.1; 1733 envelope-from="myname@example.com"; helo=foo.example.com; 1735 It is, however, possible to add CFWS in the "reason" part of an 1736 Authentication-Results header field and provide the equivalent 1737 information, if desired. 1739 As an example, an expanded Authentication-Results header field might 1740 look like (for a "MAIL FROM" check in this example): 1742 Authentication-Results: myhost.example.org; spf=pass 1743 reason="client-ip=192.0.2.1; smtp.helo=foo.example.com" 1744 smtp.mailfrom=user@example.net 1746 10. Effects on Infrastructure 1748 This section outlines the major implications that adoption of this 1749 protocol will have on various entities involved in Internet email. 1750 It is intended to make clear to the reader where this protocol 1751 knowingly affects the operation of such entities. This section is 1752 not a "how-to" manual, or a "best practices" document, and it is not 1753 a comprehensive list of what such entities ought do in light of this 1754 specification. 1756 This section provides operational advice and instruction only. It is 1757 non-normative. 1759 [RFC5598] describes the Internet email architecture. This section is 1760 organized based on the different segments of the architecture. 1762 10.1. Sending Domains 1764 Originating ADMDs (ADministrative Management Domains - [RFC5598] 1765 Section 2.2.1 and Section 2.3) that wish to be compliant with this 1766 specification will need to determine the list of relays ([RFC5598] 1767 Section 2.2.2) that they allow to use their domain name in the "HELO" 1768 and "MAIL FROM" identities when relaying to other ADMDs. It is 1769 recognized that forming such a list is not just a simple technical 1770 exercise, but involves policy decisions with both technical and 1771 administrative considerations. 1773 10.1.1. DNS Resource Considerations 1775 Minimizing the DNS resources needed for SPF lookups can be done by 1776 choosing directives that require less DNS information and by placing 1777 lower-cost mechanisms earlier in the SPF record. 1779 Section 4.6.4 specifies the limits receivers have to use. It is 1780 essential to publish records that do not exceed these requirements. 1781 It is also required to carefully weigh the cost and the 1782 maintainability of licit solutions. 1784 For example, consider a domain set up as follows: 1786 example.com. IN MX 10 mx.example.com. 1787 IN MX 20 mx2.example.com. 1788 mx.example.com. IN A 192.0.2.1 1789 mx2.example.com. IN A 192.0.2.129 1791 Assume the administrative point is to authorize (pass) mx and mx2 1792 while failing every other host. Compare the following solutions: 1794 Best record: 1795 example.com. IN TXT "v=spf1 ip4:192.0.2.1 ip4:192.0.2.129 -all" 1797 Good record: 1798 $ORIGIN example.com. 1799 @ IN TXT "v=spf1 a:authorized-spf.example.com -all" 1800 authorized-spf IN A 192.0.2.1 1801 IN A 192.0.2.129 1803 Expensive record: 1804 example.com. IN TXT "v=spf1 mx:example.com -all" 1806 Wasteful, bad record: 1807 example.com. IN TXT "v=spf1 ip4:192.0.2.0/24 mx -all" 1809 10.1.2. Administrator's Considerations 1811 There might be administrative considerations: using "a" over "ip4" or 1812 "ip6" allows hosts to be renumbered easily at the cost of a DNS query 1813 per receiver. Using "mx" over "a" allows the set of mail hosts to be 1814 changed easily. Unless such changes are common, it is better to use 1815 the less resource intensive mechanisms like "ip4" and "ip6" over "a" 1816 or "a" over "mx". 1818 In some specific cases, standard advice on record content is 1819 appropriate. Publishing SPF records for domains that send no mail is 1820 a well established best practice. The record for a domain that sends 1821 no mail is: 1823 www.example.com. IN TXT "v=spf1 -all" 1825 Publishing SPF records for individual hosts is also best practice. 1826 The hostname is generally the identity used in the 5321.HELO/.EHLO 1827 command. In the case of messages with a null 5321.MailFrom, this is 1828 used as the domain for 5321.MailFrom SPF checks, in addition to being 1829 used in 5321.HELO/.EHLO based SPF checks. The standard SPF record 1830 for an individual host that is involved in mail processing is: 1832 relay.example.com. IN TXT "v=spf1 a -all" 1834 Validating correct deployment is difficult. [RFC6652] describes one 1835 mechanism for soliciting feedback on SPF failures. Another 1836 suggestion can be found in Appendix D. 1838 Regardless of the method used, understanding the ADMD's outbound mail 1839 architecture is essential to effective deployment. 1841 10.1.3. Bounces 1843 As explained in Section 1.1.3, [RFC5321] allows the MAIL FROM to be 1844 null, which is typical of some Delivery Status Notification 1845 [RFC3464], commonly called email bounces. In this case the only 1846 entity available for performing an SPF check is the "HELO" identity 1847 defined in Section 1.1.4. SPF functionality is enhanced by 1848 administrators ensuring this identity is set correctly and has an 1849 appropriate SPF record. It is normal to have the HELO identity set 1850 to the hostname instead of the domain. Zone file generation for 1851 significant numbers of hosts can be consolidated using the redirect 1852 modifier and scripted for initial deployment. Specific deployment 1853 advice is given above in Section 10.1.2. 1855 10.2. Receivers 1857 SPF results can be used in combination with other methods to 1858 determine the final local disposition (either positive or negative) 1859 of a message. It can also be considered dispositive on its own. 1861 An attempt to have one organization (sender) direct the email 1862 handling policies of another (receiver) is inherently challenging and 1863 often controversial. As stated elsewhere in this document, there is 1864 no comprehensive normative requirement for specific handling of a 1865 message based on SPF results. The information presented in Section 8 1866 and in Appendix H is offered for receiver consideration when forming 1867 local handling policies. 1869 The primary considerations are that SPF might return "pass" for mail 1870 that is ultimately harmful (e.g., spammers that arrange for SPF to 1871 pass using disposable domain names, or virus or spam outbreaks from 1872 within trusted sources), and might also return "fail" for mail that 1873 is ultimately legitimate (e.g., legitimate mail that has traversed a 1874 mail alias). It is important take both of these cases under 1875 consideration when establishing local handling policy. 1877 10.3. Mediators 1879 Mediators are a type of User actor [RFC5598]. That is, a mediator 1880 takes 'delivery' of a message and posts a 'submission' of a new 1881 message. The mediator can make the newly-posted message be as 1882 similar or as different from the original message as they wish. 1883 Examples include mailing lists (see [RFC5598] Section 5.3) and 1884 ReSenders ([RFC5598] Section 5.2). This is discussed in [RFC5321], 1885 Section 3.9. For the operation of SPF, the essential concern is the 1886 email address in the 5321.MailFrom command for the new message. 1888 Because SPF evaluation is based on the IP address of the "last" 1889 sending SMTP server, the address of the mediator will be used, rather 1890 than the address of the SMTP server that sent the message to the 1891 mediator. Some mediators retain the email address from the original 1892 message, while some use a new address. 1894 If the address is the same as for the original message, and the 1895 original message had an associated SPF record, then the SPF 1896 evaluation will fail unless mitigations such as those described in 1897 Appendix E are used. 1899 11. Security Considerations 1901 11.1. Processing Limits 1903 As with most aspects of email, there are a number of ways that 1904 malicious parties could use the protocol as an avenue for a 1905 Denial-of-Service (DoS) attack. The processing limits outlined in 1906 Section 4.6.4 are designed to prevent attacks such as the following: 1908 o A malicious party could create an SPF record with many references 1909 to a victim's domain and send many emails to different SPF 1910 verifiers; those SPF verifiers would then create a DoS attack. In 1911 effect, the SPF verifiers are being used to amplify the attacker's 1912 bandwidth by using fewer octets in the SMTP session than are used 1913 by the DNS queries. Using SPF verifiers also allows the attacker 1914 to hide the true source of the attack. This potential attach is 1915 based on large volumes of mail being transmitted. 1917 o Whereas implementations of check_host() are supposed to limit the 1918 number of DNS lookups, malicious domains could publish records 1919 that exceed these limits in an attempt to waste computation effort 1920 at their targets when they send them mail. Malicious domains 1921 could also design SPF records that cause particular 1922 implementations to use excessive memory or CPU usage, or to 1923 trigger bugs. If a receiver is configured to accept mail with an 1924 SPF result of "temperror", such an attack might result in mail 1925 that would otherwise have been rejected due to an SPF "fail" 1926 result being accepted. This potential attack is based on 1927 specially crafted SPF records being used to exhaus DNS resources 1928 of the victim. 1930 o Malicious parties could send a large volume of mail purporting to 1931 come from the intended target to a wide variety of legitimate mail 1932 hosts. These legitimate machines would then present a DNS load on 1933 the target as they fetched the relevant records. 1935 o Malicious parties could, in theory, use SPF records as a vehicle 1936 for DNS lookup amplification for a denial-of-service-attack. In 1937 this scenario, the attacker publishes an SPF record in its own DNS 1938 that uses "a" and "mx" mechanisms directed toward the intended 1939 victim, e.g. "a:example.com a:foo.example.com a:bar.example.com 1940 ..." and then distributes mail with a MAIL FROM value including 1941 its own domain in large volume to a wide variety of destinations. 1942 Any such destination operating an SPF verifier will begin querying 1943 all of the names associated with the "a" mechanisms in that 1944 record. The names used in the record needn't exist for the attack 1945 to be effective. Operational experience since publication of 1946 [RFC4408] suggests that mitigation of this class of attack can be 1947 accomplished with minimal impact on the deployed base by having 1948 the verifier abort processing and return "permerror" 1949 (Section 2.6.7) once more than two "void lookups" have been 1950 encountered (defined in Section 4.6.4). 1952 Of these, the case of a third party referenced in the SPF record is 1953 the easiest for a DoS attack to effectively exploit. As a result, 1954 limits that might seem reasonable for an individual mail server can 1955 still allow an unreasonable amount of bandwidth amplification. 1956 Therefore, the processing limits need to be quite low. 1958 11.2. SPF-Authorized Email May Contain Other False Identities 1960 Do not construe the "MAIL FROM" and "HELO" identity authorizations to 1961 provide more assurance than they do. It is entirely possible for a 1962 malicious sender to inject a message using his own domain in the 1963 identities used by SPF, to have that domain's SPF record authorize 1964 the sending host, and yet the message can easily list other 1965 identities in its header. Unless the user or the MUA takes care to 1966 note that the authorized identity does not match the other more 1967 commonly-presented identities (such as the From: header field), the 1968 user might be lulled into a false sense of security. 1970 11.3. Spoofed DNS and IP Data 1972 There are two aspects of this protocol that malicious parties could 1973 exploit to undermine the validity of the check_host() function: 1975 o The evaluation of check_host() relies heavily on DNS. A malicious 1976 attacker could attack the DNS infrastructure and cause 1977 check_host() to see spoofed DNS data, and then return incorrect 1978 results. This could include returning "pass" for an value 1979 where the actual domain's record would evaluate to "fail". See 1980 [RFC3833] for a description of DNS weaknesses. 1982 o The client IP address, , is assumed to be correct. In a 1983 modern, correctly configured system the risk of this not being 1984 true is nil. 1986 11.4. Cross-User Forgery 1988 By definition, SPF policies just map domain names to sets of 1989 authorized MTAs, not whole email addresses to sets of authorized 1990 users. Although the "l" macro (Section 7) provides a limited way to 1991 define individual sets of authorized MTAs for specific email 1992 addresses, it is generally impossible to verify, through SPF, the use 1993 of specific email addresses by individual users of the same MTA. 1995 It is up to mail services and their MTAs to directly prevent 1996 cross-user forgery: based on SMTP AUTH ([RFC4954]), users have to be 1997 restricted to using only those email addresses that are actually 1998 under their control (see [RFC6409], Section 6.1). Another means to 1999 verify the identity of individual users is message cryptography such 2000 as PGP ([RFC4880]) or S/MIME ([RFC5751]). 2002 11.5. Untrusted Information Sources 2004 An SPF compliant receiver gathers information from the SMTP commands 2005 it receives and from the published DNS records of the sending domain 2006 holder, (e.g., "HELO" domain name, the "MAIL FROM" address from the 2007 envelope, and SPF DNS records published by the domain holder). These 2008 parameters are not validated in the SMTP process. 2010 All of these pieces of information are generated by actors outside of 2011 the authority of the receiver, and thus are not guaranteed to be 2012 accurate or legitimate. 2014 11.5.1. Recorded Results 2016 This information, passed to the receiver in the Received-SPF: or 2017 Authentication-Results: trace fields, can be returned to the client 2018 MTA as an SMTP rejection message. If such an SMTP rejection message 2019 is generated, the information from the trace fields has to be checked 2020 for such problems as invalid characters and excessively long lines. 2022 11.5.2. External Explanations 2024 When the authorization check fails, an explanation string could be 2025 included in the reject response. Both the sender and the rejecting 2026 receiver need to be aware that the explanation was determined by the 2027 publisher of the SPF record checked and, in general, not the 2028 receiver. The explanation can contain malicious URLs, or it might be 2029 offensive or misleading. 2031 Explanations returned to sender domains due to "exp" modifiers 2032 (Section 6.2) were generated by the sender policy published by the 2033 domain holders themselves. As long as messages are only returned 2034 with non-delivery notification ([RFC3464]) to domains publishing the 2035 explanation strings from their own DNS SPF records, the only affected 2036 parties are the original publishers of the domain's SPF records. 2038 In practice, such non-delivery notifications can be misdirected, such 2039 as when an MTA accepts an email and only later generates the 2040 notification to a forged address, or when an email forwarder does not 2041 direct the bounce back to the original sender. 2043 11.5.3. Macro Expansion 2045 Macros (Section 7) allow senders to inject arbitrary text (any non- 2046 null [US-ASCII] character) into receiver DNS queries. It is 2047 necessary to be prepared for hostile or unexpected content. 2049 11.6. Privacy Exposure 2051 Checking SPF records causes DNS queries to be sent to the domain 2052 owner. These DNS queries, especially if they are caused by the 2053 "exists" mechanism, can contain information about who is sending 2054 email and likely to which MTA the email is being sent. This can 2055 introduce some privacy concerns, which are more or less of an issue 2056 depending on local laws and the relationship between the ADMD and the 2057 person sending the email. 2059 11.7. Delivering Mail Producing a 'Fail' Result 2061 Operators that choose to deliver mail for which SPF produces a "fail" 2062 result need to understand that they are admitting content that is 2063 explicitly not authorized by the purported sender. While there are 2064 known failure modes that can be considered "false negatives", the 2065 distinct choice to admit those messages increases end-user exposure 2066 to likely harm. This is especially true for domains belonging to 2067 known good actors that are typically well-behaved; unauthorized mail 2068 from those sources might well be subjected to much higher skepticism 2069 and content analysis. 2071 SPF does not, however, include the capacity for identifying good 2072 actors from bad ones, nor does it handle the concept of known actors 2073 versus unknown ones. Those notions are out of scope for this 2074 specification. 2076 12. Contributors and Acknowledgements 2078 This document is largely based on the work of Meng Weng Wong, Mark 2079 Lentczner, and Wayne Schlitt. Although, as this section 2080 acknowledges, many people have contributed to this document, a very 2081 large portion of the writing and editing are due to Meng, Mark, and 2082 Wayne. 2084 This design owes a debt of parentage to [RMX] by Hadmut Danisch and 2085 to [DMP] by Gordon Fecyk. The idea of using a DNS record to check 2086 the legitimacy of an email address traces its ancestry further back 2087 through messages on the namedroppers mailing list by Paul Vixie 2088 [Vixie] (based on suggestion by Jim Miller) and by David Green 2089 [Green]. 2091 Philip Gladstone contributed the concept of macros to the 2092 specification, multiplying the expressiveness of the language and 2093 making per-user and per-IP lookups possible. 2095 The authors of both this document and [RFC4408] would also like to 2096 thank the literally hundreds of individuals who have participated in 2097 the development of this design. They are far too numerous to name, 2098 but they include the following: 2100 The participants in the SPFbis working group. 2101 The folks on the spf-discuss mailing list. 2102 The folks on the SPAM-L mailing list. 2103 The folks on the IRTF ASRG mailing list. 2104 The folks on the IETF MARID mailing list. 2105 The folks on #perl. 2107 13. IANA Considerations 2109 13.1. The SPF DNS Record Type 2111 Per [RFC4408], the IANA assigned the Resource Record Type and Qtype 2112 from the DNS Parameters Registry for the SPF RR type with code 99. 2113 The format of this type is identical to the TXT RR [RFC1035]. The 2114 character content of the record is encoded as [US-ASCII]. 2116 Studies have shown that RRTYPE 99 has not seen any substantial use, 2117 and in fact its existence and mechanism defined in [RFC4408] has led 2118 to some interoperability issues. Accordingly, its use is now 2119 obsolete, and new implementations are not to use it. 2121 IANA is requested to update the Resource Record (RR) TYPEs registry 2122 to indicate that this document is the reference document for that 2123 RRTYPE. 2125 [NOTE TO RFC EDITOR: (to be changed to " ... has updated ..." upon 2126 publication)] 2128 13.2. The Received-SPF Mail Header Field 2130 Per [RFC3864], the "Received-SPF:" header field is added to the IANA 2131 Permanent Message Header Field Registry. The following is the 2132 registration template: 2134 Header field name: Received-SPF 2135 Applicable protocol: mail ([RFC5322]) 2136 Status: standard 2137 Author/Change controller: IETF 2138 Specification document(s): RFC XXXX 2139 [NOTE TO RFC EDITOR: (this document)] 2141 13.3. SPF Modifier Registry 2143 [RFC6652] created a new SPF Modifier Registration. IANA is requested 2144 to change the reference for the exp and redirect modifiers from 2145 [RFC4408] to this document. Their status is unchanged. 2147 14. References 2149 14.1. Normative References 2151 [RFC1035] Mockapetris, P., "Domain names - implementation and 2152 specification", STD 13, RFC 1035, November 1987. 2154 [RFC1123] Braden, R., "Requirements for Internet Hosts - Application 2155 and Support", STD 3, RFC 1123, October 1989. 2157 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2158 Requirement Levels", BCP 14, RFC 2119, March 1997. 2160 [RFC3463] Vaudreuil, G., "Enhanced Mail System Status Codes", 2161 RFC 3463, January 2003. 2163 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 2164 Procedures for Message Header Fields", BCP 90, RFC 3864, 2165 September 2004. 2167 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2168 Resource Identifier (URI): Generic Syntax", STD 66, 2169 RFC 3986, January 2005. 2171 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 2172 Architecture", RFC 4291, February 2006. 2174 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 2175 Specifications: ABNF", STD 68, RFC 5234, January 2008. 2177 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 2178 October 2008. 2180 [RFC5322] Resnick, P., Ed., "Internet Message Format", RFC 5322, 2181 October 2008. 2183 [RFC5451] Kucherawy, M., "Message Header Field for Indicating 2184 Message Authentication Status", RFC 5451, April 2009. 2186 [RFC5598] Crocker, D., "Internet Mail Architecture", RFC 5598, 2187 July 2009. 2189 [RFC5782] Levine, J., "DNS Blacklists and Whitelists", RFC 5782, 2190 February 2010. 2192 [RFC5890] Klensin, J., "Internationalized Domain Names for 2193 Applications (IDNA): Definitions and Document Framework", 2194 RFC 5890, August 2010. 2196 [US-ASCII] 2197 American National Standards Institute (formerly United 2198 States of America Standards Institute), "USA Code for 2199 Information Interchange, X3.4", 1968. 2201 ANSI X3.4-1968 has been replaced by newer versions with 2202 slight modifications, but the 1968 version remains 2203 definitive for the Internet. 2205 14.2. Informative References 2207 [DMP] Fecyk, G., "Designated Mailers Protocol". 2209 Work In Progress 2211 [Green] Green, D., "Domain-Authorized SMTP Mail", 2002. 2213 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 2214 STD 13, RFC 1034, November 1987. 2216 [RFC1983] Malkin, G., "Internet Users' Glossary", RFC 1983, 2217 August 1996. 2219 [RFC2308] Andrews, M., "Negative Caching of DNS Queries (DNS 2220 NCACHE)", RFC 2308, March 1998. 2222 [RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 2223 specifying the location of services (DNS SRV)", RFC 2782, 2224 February 2000. 2226 [RFC3464] Moore, K. and G. Vaudreuil, "An Extensible Message Format 2227 for Delivery Status Notifications", RFC 3464, 2228 January 2003. 2230 [RFC3696] Klensin, J., "Application Techniques for Checking and 2231 Transformation of Names", RFC 3696, February 2004. 2233 [RFC3833] Atkins, D. and R. Austein, "Threat Analysis of the Domain 2234 Name System (DNS)", RFC 3833, August 2004. 2236 [RFC3834] Moore, K., "Recommendations for Automatic Responses to 2237 Electronic Mail", RFC 3834, August 2004. 2239 [RFC4408] Wong, M. and W. Schlitt, "Sender Policy Framework (SPF) 2240 for Authorizing Use of Domains in E-Mail, Version 1", 2241 RFC 4408, April 2006. 2243 [RFC4632] Fuller, V. and T. Li, "Classless Inter-domain Routing 2244 (CIDR): The Internet Address Assignment and Aggregation 2245 Plan", BCP 122, RFC 4632, August 2006. 2247 [RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. 2248 Thayer, "OpenPGP Message Format", RFC 4880, November 2007. 2250 [RFC4954] Siemborski, R. and A. Melnikov, "SMTP Service Extension 2251 for Authentication", RFC 4954, July 2007. 2253 [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 2254 Mail Extensions (S/MIME) Version 3.2 Message 2255 Specification", RFC 5751, January 2010. 2257 [RFC6409] Gellens, R. and J. Klensin, "Message Submission for Mail", 2258 STD 72, RFC 6409, November 2011. 2260 [RFC6647] Kucherawy, M. and D. Crocker, "Email Greylisting: An 2261 Applicability Statement for SMTP", RFC 6647, June 2012. 2263 [RFC6648] Saint-Andre, P., Crocker, D., and M. Nottingham, 2264 "Deprecating the "X-" Prefix and Similar Constructs in 2265 Application Protocols", BCP 178, RFC 6648, June 2012. 2267 [RFC6652] Kitterman, S., "Sender Policy Framework (SPF) 2268 Authentication Failure Reporting Using the Abuse Reporting 2269 Format", RFC 6652, June 2012. 2271 [RFC6686] Kucherawy, M., "Resolution of the Sender Policy Framework 2272 (SPF) and Sender ID Experiments", RFC 6686, July 2012. 2274 [RMX] Danisch, H., "The RMX DNS RR Type for light weight sender 2275 authentication". 2277 Work In Progress 2279 [Vixie] Vixie, P., "Repudiating MAIL FROM", 2002. 2281 Appendix A. Collected ABNF 2283 This section is normative and any discrepancies with the ABNF 2284 fragments in the preceding text are to be resolved in favor of this 2285 grammar. 2287 See [RFC5234] for ABNF notation. Please note that as per this ABNF 2288 definition, literal text strings (those in quotes) are case- 2289 insensitive. Hence, "mx" matches "mx", "MX", "mX", and "Mx". 2291 record = version terms *SP 2292 version = "v=spf1" 2294 terms = *( 1*SP ( directive / modifier ) ) 2296 directive = [ qualifier ] mechanism 2297 qualifier = "+" / "-" / "?" / "~" 2298 mechanism = ( all / include 2299 / a / mx / ptr / ip4 / ip6 / exists ) 2301 all = "all" 2302 include = "include" ":" domain-spec 2303 a = "a" [ ":" domain-spec ] [ dual-cidr-length ] 2304 mx = "mx" [ ":" domain-spec ] [ dual-cidr-length ] 2305 ptr = "ptr" [ ":" domain-spec ] 2306 ip4 = "ip4" ":" ip4-network [ ip4-cidr-length ] 2307 ip6 = "ip6" ":" ip6-network [ ip6-cidr-length ] 2308 exists = "exists" ":" domain-spec 2310 modifier = redirect / explanation / unknown-modifier 2311 redirect = "redirect" "=" domain-spec 2312 explanation = "exp" "=" domain-spec 2313 unknown-modifier = name "=" macro-string 2314 ; where name is not any known modifier 2316 ip4-cidr-length = "/" 1*DIGIT 2317 ip6-cidr-length = "/" 1*DIGIT 2318 dual-cidr-length = [ ip4-cidr-length ] [ "/" ip6-cidr-length ] 2320 ip4-network = qnum "." qnum "." qnum "." qnum 2321 qnum = DIGIT ; 0-9 2322 / %x31-39 DIGIT ; 10-99 2323 / "1" 2DIGIT ; 100-199 2324 / "2" %x30-34 DIGIT ; 200-249 2325 / "25" %x30-35 ; 250-255 2326 ; conventional dotted quad notation. e.g., 192.0.2.0 2327 ip6-network = 2328 ; e.g., 2001:DB8::CD30 2330 domain-spec = macro-string domain-end 2331 domain-end = ( "." toplabel [ "." ] ) / macro-expand 2333 toplabel = ( *alphanum ALPHA *alphanum ) / 2334 ( 1*alphanum "-" *( alphanum / "-" ) alphanum ) 2335 ; LDH rule plus additional TLD restrictions 2336 ; (see [RFC3696], Section 2 for background) 2337 alphanum = ALPHA / DIGIT 2339 explain-string = *( macro-string / SP ) 2341 macro-string = *( macro-expand / macro-literal ) 2342 macro-expand = ( "%{" macro-letter transformers *delimiter "}" ) 2343 / "%%" / "%_" / "%-" 2344 macro-literal = %x21-24 / %x26-7E 2345 ; visible characters except "%" 2346 macro-letter = "s" / "l" / "o" / "d" / "i" / "p" / "h" / 2347 "c" / "r" / "t" / "v" 2348 transformers = *DIGIT [ "r" ] 2349 delimiter = "." / "-" / "+" / "," / "/" / "_" / "=" 2351 name = ALPHA *( ALPHA / DIGIT / "-" / "_" / "." ) 2353 header-field = "Received-SPF:" [CFWS] result FWS [comment FWS] 2354 [ key-value-list ] CRLF 2356 result = "pass" / "fail" / "softfail" / "neutral" / 2357 "none" / "temperror" / "permerror" 2359 key-value-list = key-value-pair *( ";" [CFWS] key-value-pair ) 2360 [";"] 2362 key-value-pair = key [CFWS] "=" ( dot-atom / quoted-string ) 2364 key = "client-ip" / "envelope-from" / "helo" / 2365 "problem" / "receiver" / "identity" / 2366 "mechanism" / name 2368 identity = "mailfrom" ; for the "MAIL FROM" identity 2369 / "helo" ; for the "HELO" identity 2370 / name ; other identities 2372 ALPHA = 2373 DIGIT = <0-9 as per [RFC5234]> 2374 SP = 2375 domain = 2376 dot-atom = 2377 quoted-string = 2378 comment = 2379 CFWS = 2380 FWS = 2381 CRLF = 2382 authserv-id = 2383 reasonspec = 2385 Appendix B. Extended Examples 2387 These examples are based on the following DNS setup: 2389 ; A domain with two mail servers, two hosts 2390 ; and two servers at the domain name 2391 $ORIGIN example.com. 2392 @ MX 10 mail-a 2393 MX 20 mail-b 2394 A 192.0.2.10 2395 A 192.0.2.11 2396 amy A 192.0.2.65 2397 bob A 192.0.2.66 2398 mail-a A 192.0.2.129 2399 mail-b A 192.0.2.130 2400 www CNAME example.com. 2402 ; A related domain 2403 $ORIGIN example.org. 2404 @ MX 10 mail-c 2405 mail-c A 192.0.2.140 2407 ; The reverse IP for those addresses 2408 $ORIGIN 2.0.192.in-addr.arpa. 2409 10 PTR example.com. 2410 11 PTR example.com. 2411 65 PTR amy.example.com. 2412 66 PTR bob.example.com. 2413 129 PTR mail-a.example.com. 2414 130 PTR mail-b.example.com. 2415 140 PTR mail-c.example.org. 2417 ; A rogue reverse IP domain that claims to be 2418 ; something it's not 2419 $ORIGIN 0.0.10.in-addr.arpa. 2420 4 PTR bob.example.com. 2422 B.1. Simple Examples 2424 These examples show various possible published records for 2425 example.com and which values if would cause check_host() to 2426 return "pass". Note that is "example.com". 2428 v=spf1 +all 2429 -- any passes 2431 v=spf1 a -all 2432 -- hosts 192.0.2.10 and 192.0.2.11 pass 2434 v=spf1 a:example.org -all 2435 -- no sending hosts pass since example.org has no A records 2437 v=spf1 mx -all 2438 -- sending hosts 192.0.2.129 and 192.0.2.130 pass 2440 v=spf1 mx:example.org -all 2441 -- sending host 192.0.2.140 passes 2443 v=spf1 mx mx:example.org -all 2444 -- sending hosts 192.0.2.129, 192.0.2.130, and 192.0.2.140 pass 2446 v=spf1 mx/30 mx:example.org/30 -all 2447 -- any sending host in 192.0.2.128/30 or 192.0.2.140/30 passes 2449 v=spf1 ptr -all 2450 -- sending host 192.0.2.65 passes (reverse DNS is valid and is in 2451 example.com) 2452 -- sending host 192.0.2.140 fails (reverse DNS is valid, but not 2453 in example.com) 2454 -- sending host 10.0.0.4 fails (reverse IP is not valid) 2456 v=spf1 ip4:192.0.2.128/28 -all 2457 -- sending host 192.0.2.65 fails 2458 -- sending host 192.0.2.129 passes 2460 B.2. Multiple Domain Example 2462 These examples show the effect of related records: 2464 example.org: "v=spf1 include:example.com include:example.net -all" 2466 This record would be used if mail from example.org actually came 2467 through servers at example.com and example.net. Example.org's 2468 designated servers are the union of example.com's and example.net's 2469 designated servers. 2471 la.example.org: "v=spf1 redirect=example.org" 2472 ny.example.org: "v=spf1 redirect=example.org" 2473 sf.example.org: "v=spf1 redirect=example.org" 2475 These records allow a set of domains that all use the same mail 2476 system to make use of that mail system's record. In this way, only 2477 the mail system's record needs to be updated when the mail setup 2478 changes. These domains' records never have to change. 2480 B.3. DNSBL Style Example 2482 Imagine that, in addition to the domain records listed above, there 2483 are these (see [RFC5782]): 2485 $ORIGIN _spf.example.com. 2486 mary.mobile-users A 127.0.0.2 2487 fred.mobile-users A 127.0.0.2 2488 15.15.168.192.joel.remote-users A 127.0.0.2 2489 16.15.168.192.joel.remote-users A 127.0.0.2 2491 The following records describe users at example.com who mail from 2492 arbitrary servers, or who mail from personal servers. 2494 example.com: 2496 v=spf1 mx 2497 include:mobile-users._spf.%{d} 2498 include:remote-users._spf.%{d} 2499 -all 2501 mobile-users._spf.example.com: 2503 v=spf1 exists:%{l1r+}.%{d} 2505 remote-users._spf.example.com: 2507 v=spf1 exists:%{ir}.%{l1r+}.%{d} 2509 B.4. Multiple Requirements Example 2511 Say that your sender policy requires both that the IP address is 2512 within a certain range and that the reverse DNS for the IP matches. 2513 This can be done several ways, including the following: 2515 example.com. SPF ( "v=spf1 " 2516 "-include:ip4._spf.%{d} " 2517 "-include:ptr._spf.%{d} " 2518 "+all" ) 2519 ip4._spf.example.com. SPF "v=spf1 -ip4:192.0.2.0/24 +all" 2520 ptr._spf.example.com. SPF "v=spf1 -ptr +all" 2522 This example shows how the "-include" mechanism can be useful, how an 2523 SPF record that ends in "+all" can be very restrictive, and the use 2524 of De Morgan's Law. 2526 Appendix C. Changes in implementation requirements from RFC 4408 2528 The modifications to implementation requirements from [RFC4408] are 2529 all either (a) corrections to errors in [RFC4408], or (b) additional 2530 documentation based on consensus of operational experience acquired 2531 since publication of [RFC4408]. 2533 o Use of DNS RR type SPF (99) has been removed from the protocol, 2534 see [RFC6686] for background. 2536 o A new DNS related processing limit based on "void lookups" has 2537 been added (Section 4.6.4). 2539 o Use of the ptr mechanism and the %p macro have been strongly 2540 discouraged Section 5.5 and Section 7.2. They remain part of the 2541 protocol because they were found to be in use, but records ought 2542 to be updated to avoid them. 2544 o Use of the "Authentication-Results" header field [RFC5451] as a 2545 possible alternative to use of the "Received-SPF" header field is 2546 discussed (Section 9.2). 2548 o There have been a number of minor corrections to the ABNF to make 2549 it more clear and correct Appendix A. SPF library implementers 2550 should give the revised ABNF a careful review to determine if 2551 implementation changes are needed. 2553 o Use of X- fields in the ABNF has been removed see [RFC6648] for 2554 background. 2556 o Ambiguity about how to deal with invalid domain-spec after macro 2557 expansion has been documented. Depending on one specific behavior 2558 has to be avoided (Section 4.8). 2560 o General operational information has been updated and expanded 2561 based on eight years of post [RFC4408] operations experience. See 2562 Section 10 and Appendices D - H below. 2564 o Security considerations have been reviewed and updated 2565 (Section 11). 2567 Appendix D. Further Testing Advice 2569 Another approach that can be helpful to publish records that include 2570 a "tracking exists:" mechanism. By looking at the name server logs, 2571 a rough list can then be generated. For example: 2573 v=spf1 exists:_h.%{h}._l.%{l}._o.%{o}._i.%{i}._spf.%{d} ?all 2575 Appendix E. SPF/Mediator Interactions 2577 There are three places that techniques can be used to ameliorate 2578 unintended SPF failures with mediators. 2580 E.1. Originating ADMDs 2582 The beginning, when email is first sent: 2584 o "Neutral" results could be given for IP addresses that might be 2585 forwarders, instead of "fail" results based on a list of known 2586 reliable forwarders. For example: 2588 "v=spf1 mx ?exists:%{ir}.whitlist.example.org -all" 2590 This would cause a lookup on an DNS white list (DNSWL) and cause a 2591 result of "fail" only for email not either coming from the 2592 domain's mx host(s) (SPF pass) or white listed sources (SPF 2593 neutral). This, in effect, outsources an element of sender policy 2594 to the maintainer of the whitelist. 2596 o The "MAIL FROM" identity could have additional information in the 2597 local-part that cryptographically identifies the mail as coming 2598 from an authorized source. In this case, such an SPF record could 2599 be used: 2601 "v=spf1 mx exists:%{l}._spf_verify.%{d} -all" 2603 Then, a specialized DNS server can be set up to serve the 2604 _spf_verify subdomain that validates the local-part. Although 2605 this requires an extra DNS lookup, this happens only when the 2606 email would otherwise be rejected as not coming from a known good 2607 source. 2608 Note that due to the 63-character limit for domain labels, this 2609 approach only works reliably if the local-part signature scheme is 2610 guaranteed either to only produce local-parts with a maximum of 63 2611 characters or to gracefully handle truncated local-parts. 2613 o Similarly, a specialized DNS server could be set up that will 2614 rate-limit the email coming from unexpected IP addresses. 2616 "v=spf1 mx exists:%{ir}._spf_rate.%{d} -all" 2618 o SPF allows the creation of per-user policies for special cases. 2619 For example, the following SPF record and appropriate wildcard DNS 2620 records can be used: 2622 "v=spf1 mx redirect=%{l1r+}._at_.%{o}._spf.%{d}" 2624 E.2. Mediators 2626 The middle, when email is forwarded:. 2628 o Mediators can solve the problem by rewriting the "MAIL FROM" to be 2629 in their own domain. This means mail rejected from the external 2630 mailbox will have to be forwarded back to the original sender by 2631 the forwarding service. Various schemes to do this exist though 2632 they vary widely in complexity and resource requirements on the 2633 part of the mediator. 2635 o Several popular MTAs can be forced from "alias" semantics to 2636 "mailing list" semantics by configuring an additional alias with 2637 "owner-" prepended to the original alias name (e.g., an alias of 2638 "friends: george@example.com, fred@example.org" would need another 2639 alias of the form "owner-friends: localowner"). 2641 o Mediators could reject mail that would "fail" SPF if forwarded 2642 using an SMTP reply code of 551, User not local, (see [RFC5321] 2643 section 3.4) to communicate the correct target address to resend 2644 the mail to. 2646 E.3. Receving ADMDs 2648 The end, when email is received: 2650 o If the owner of the external mailbox wishes to trust the mediator, 2651 he can direct the external mailbox's MTA to skip SPF tests when 2652 the client host belongs to the mediator. 2654 o Tests against other identities, such as the "HELO" identity, MAY 2655 be used to override a failed test against the "MAIL FROM" 2656 identity. 2658 o For larger domains, it might not be possible to have a complete or 2659 accurate list of forwarding services used by the owners of the 2660 domain's mailboxes. In such cases, whitelists of generally- 2661 recognized forwarding services could be employed. 2663 Appendix F. Mail Services 2665 MSPs (Mail Service Providers - [RFC5598] Section 2.3) that offer mail 2666 services to third-party domains, such as sending of bulk mail, might 2667 want to adjust their configurations in light of the authorization 2668 check described in this document. If the domain part of the "MAIL 2669 FROM" identity used for such email uses the domain of one of the MSPs 2670 domain, then the provider needs only to ensure that its sending host 2671 is authorized by its own SPF record, if any. 2673 If the "MAIL FROM" identity does not use the MSP's domain, then extra 2674 care has to be taken. The SPF record format has several options for 2675 the third-party domain to authorize the service provider's MTAs to 2676 send mail on its behalf. For MSPs, such as ISPs, that have a wide 2677 variety of customers using the same MTA, steps are required to 2678 mitiate the risk of cross-customer forgery (see Section 11.4). 2680 Appendix G. MTA Relays 2682 Relays are described in [RFC5598] Section 2.2.2. The authorization 2683 check generally precludes the use of arbitrary MTA relays between 2684 sender and receiver of an email message. 2686 Within an organization, MTA relays can be effectively deployed. 2687 However, for purposes of this document, such relays are effectively 2688 transparent. The SPF authorization check is a check between border 2689 MTAs of different ADMDs. 2691 For mail senders, this means that published SPF records have to 2692 authorize any MTAs that actually send across the Internet. Usually, 2693 these are just the border MTAs as internal MTAs simply forward mail 2694 to these MTAs for relaying. 2696 The receiving ADMD will generally want to perform the authorization 2697 check at the boundary MTAs, including all secondary MXs. Internal 2698 MTAs (including MTAs that might serve both as boundary MTAs and 2699 internal relays from secondary MXs when they are processing the 2700 relayed mail stream) then do not perform the authorization test. To 2701 perform the authorization test other than at the boundary, the host 2702 that first transferred the message to the receiving ADMD have to be 2703 determined, which can be difficult to extract from the message header 2704 because (a) header fields can be forged or malformed, and (b) there's 2705 no standard way to encode that information such that it can be 2706 reliably extracted. Testing other than at the boundary is likely to 2707 produce unreliable results. This is described further in Appencix C 2708 of [RFC5451]. 2710 Appendix H. Local Policy Considerations 2712 SPF results can be used in combination with other methods to 2713 determine the final local disposition (either positive or negative of 2714 a message. It can also be considered dispositive on its own. 2716 H.1. Policy For SPF Pass 2718 SPF pass results can be used in combination with "white lists" of 2719 known "good" domains to bypass some or all additional pre-delivery 2720 email checks. Exactly which checks and how to determine appropriate 2721 white list entries has to be based on local conditions and 2722 requirements. 2724 H.2. Policy For SPF Fail 2726 SPF fail results can be used to reject messages during the SMTP 2727 transaction based on either "MAIL FROM" or "HELO" identity results. 2728 This reduces resource requirements for various content filtering 2729 methods and conserves bandwidth since rejection can be done before 2730 the SMTP content is transferred. It also gives immediate feedback to 2731 the sender who might then be able to resolve the issue. Due to some 2732 of the issues described above in this section (Section 10), SPF based 2733 rejection does present some risk of rejecting legitimate email when 2734 rejecting based on "MAIL FROM" results. 2736 SPF fail results can alternately be used as one input into a larger 2737 set of evaluations which might, based on a combination with other 2738 evaluation techniques, result in the email being marked negatively in 2739 some way (this might be via delivery to a special spam folder, 2740 modifying subject lines, or other locally determined means). 2741 Developing the details of such an approach have to be based on local 2742 conditions and requirements. Using SPF results in this way does not 2743 have the advantages of resource conservation and immediate feedback 2744 to the sender associated with SMTP rejection, but could produce fewer 2745 undesirable rejections in a well designed system. Such an approach 2746 might result in email that was not authorized by the sending ADMD 2747 being unknowingly delivered to end users. 2749 Either general approach can be used as they both leave a clear 2750 disposition of emails. They are either delivered in some manner or 2751 the sender is notified of the failure. Other dispositions such as 2752 "dropping" or deleting email after acceptance are inappropriate 2753 because they leave uncertainty and reduce the overall reliabilility 2754 and utility of email across the Internet. 2756 H.3. Policy For SPF Permerror 2758 The "permerror" result (see Section 2.6.7) indicates the SPF 2759 processing module at the receiver determined that the retrieved SPF 2760 policy record could not be interpreted. This gives no true 2761 indication about the authorized use of the data found in the 2762 envelope. 2764 As with all results, implementers have a choice to make regarding 2765 what to do with a message that yields this result. SMTP allows only 2766 a few basic options. 2768 Rejection of the message is an option, in that it is the one thing a 2769 receiver can do to draw attention to the difficulty encountered while 2770 protecting itself from messages that do not have a definite SPF 2771 result of some kind. However, if the SPF implementation is defective 2772 and returns spurious "permerror" results, only the sender is actively 2773 notified of the defect (in the form of rejected mail), and not the 2774 receiver making use of SPF. 2776 The less intrusive handling choice is to deliver the message, perhaps 2777 with some kind of annotation of the difficulty encountered and/or 2778 logging of a similar nature. However, this will not be desirable to 2779 operators that wish to implement SPF checking as strictly as 2780 possible, nor is this sort of passive problem reporting typically 2781 effective. 2783 There is of course the option placing this choice in the hands of the 2784 operator rather than the implementer since this kind of choice is 2785 often a matter of local policy rather than a condition with a 2786 universal solution, but this adds one more piece of complexity to an 2787 already non-trivial environment. 2789 Both implementers and operators need to be cautious of all choices 2790 and outcomes when handling SPF results. 2792 H.4. Policy For SPF Temperror 2794 The "temperror" result (see Section 2.6.6) indicates the SPF 2795 processing module at the receiver could not retrieve and SPF policy 2796 record due to a (probably) transient condition. This gives no true 2797 indication about the authorized use of the data found in the 2798 envelope. 2800 As with all results, implementers have a choice to make regarding 2801 what to do with a message that yields this result. SMTP allows only 2802 a few basic options. 2804 Deferring the message is an option, in that it is the one thing a 2805 receiver can do to draw attention to the difficulty encountered while 2806 protecting itself from messages that do not have a definite SPF 2807 result of some kind. However, if the SPF implementation is defective 2808 and returns spurious "temperror" results, only the sender is actively 2809 notified of the defect (in the form of mail rejected after it times 2810 out of the sending queue), and not the receiver making use of SPF. 2812 Because of long queue lifetimes, it is possible that mail will be 2813 repeatedly deferred for several days and so any awareness by the 2814 sender of a problem could be quite delayed. If "temperrors" persist 2815 for multiple delivery attempts, it might be perferable to treat the 2816 error as permanent and reduce the amount of time the message is in 2817 transit. 2819 The less intrusive handling choice is to deliver the message, perhaps 2820 with some kind of annotation of the difficulty encountered and/or 2821 logging of a similar nature. However, this will not be desirable to 2822 operators that wish to implement SPF checking as strictly as 2823 possible, nor is this sort of passive problem reporting typically 2824 effective. 2826 There is of course the option placing this choice in the hands of the 2827 operator rather than the implementer since this kind of choice is 2828 often a matter of local policy rather than a condition with a 2829 universal solution, but this adds one more piece of complexity to an 2830 already non-trivial environment. 2832 Both implementers and operators need to be cautious of all choices 2833 and outcomes when handling SPF results. 2835 Appendix I. Protocol Status 2837 To be removed prior to publication. 2839 SPF has been in development since the summer of 2003 and has seen 2840 deployment beyond the developers beginning in December 2003. The 2841 design of SPF slowly evolved until the spring of 2004 and has since 2842 stabilized. There have been quite a number of forms of SPF, some 2843 written up as documents, some submitted as Internet Drafts, and many 2844 discussed and debated in development forums. The protocol was 2845 originally defined in [RFC4408], which this document replaces. 2847 [RFC4408] was designed to clearly document the protocol defined by 2848 earlier draft specifications of SPF as used in existing 2849 implementations. This updated specification is intended to clarify 2850 identified ambiguities in [RFC4408], resolve technical issues 2851 identified in post-RFC 4408 deployment experience, and document 2852 widely deployed extensions to SPF that have been developed since 2853 [RFC4408] was published. 2855 This document updates and replaces RFC 4408 that was part of a group 2856 of simultaneously published Experimental RFCs (RFC 4405, RFC 4406, 2857 RFC 4407, and RFC 4408) in 2006. At that time the IESG requested the 2858 community observe the success or failure of the two approaches 2859 documented in these RFCs during the two years following publication, 2860 in order that a community consensus could be reached in the future. 2862 SPF is widely deployed by large and small email providers alike. 2863 There are multiple, interoperable implementations. 2865 For SPF (as documented in RFC 4408) a careful effort was made to 2866 collect and document lessons learned and errata during the two year 2867 period. The errata list has been stable (no new submissions) and 2868 only minor protocol lessons learned were identified. Resolution of 2869 the IESG's experiment is documented in [RFC6686]. 2871 Appendix J. Change History 2873 Changes since RFC 4408 (to be removed prior to publication) 2875 Moved to standards track 2877 Authors updated 2879 IESG Note regarding experimental use replaced with discussion of 2880 results 2882 Process errata: 2884 Resolved Section 2.5.7 PermError on invalid domains after macro 2885 expansion errata in favor of documenting that different verifiers 2886 produce different results. 2888 Add %v macro to ABNF grammar 2890 Replace "uric" by "unreserved" 2892 Recommend an SMTP reply code for optional permerror rejections 2894 Correct syntax in Received-SPF examples 2896 Fix unknown-modifier clause is too greedy in ABNF 2898 Correct use of empty domain-spec on exp modifier 2900 Fix minor typo errata 2902 Convert to spfbis working group draft, 2903 draft-ietf-spfbis-4408bis-00 2905 Clarified text about IPv4 mapped addresses to resolve test suite 2906 ambiguity 2908 Clarified ambiguity about result when more than 10 "mx" or "ptr" 2909 records are returned for lookup to specify permerror. This 2910 resolves one of the test suite ambiguities 2912 Made all references to result codes lower case per issue #7 2914 Adjusted section 2.2 Requirement to check mail from per issue #15 2916 Added missing "v" element in macro-letter in the collected ABNF 2917 per issue #16 - section 8.1 was already fixed in the pre-WG draft 2918 Marked ptr and "p" macro SHOULD NOT use per issue #27 2920 Expunged lower case may from the draft per issue #8 2922 Expunged "x-" name as an obsolete concept 2924 Updated obslete references: RFC2821 to RFC5321, RFC2822 to 2925 RFC5322, and RFC4234 to RFC5234 2927 Refer to RFC6647 to describe greylisting instead of trying to 2928 describe it directly. 2930 Updated informative references to the current versions. 2932 Start to rework section 9 with some RFC5598 terms. 2934 Added mention of RFC 6552 feedback reports in section 9. 2936 Added draft-ietf-spfbis-experiment as an informational reference. 2938 Drop Type SPF. 2940 Try and clarify informational nature of RFC3696 2942 Fix ABNF nits and add missing definitions per Bill's ABNF checker. 2944 Make DNS lookup time limit SHOULD instead of MAY. 2946 Reorganize and clarify processing limits. Move hard limits to new 2947 section 4.6.4, Evaluation Limits. Move advice to non-normative 2948 section 10. 2950 Removed paragraph in section 11.1 about limiting total data 2951 volumes as it is unused (and removable per the charter) and serves 2952 no purpose (it isn't something that actually can be implemented in 2953 any reasonable way). 2955 Added text from Alessandro Vesely in section 10.1 to better 2956 explain DNS resource limits. 2958 Multiple editorial fixes from Murray Kucherawy's review. 2960 Also based on Murray's review, reworked SMTP identity definitions 2961 and made RFC 5598 a normative reference instead of informative. 2962 This is a downref that will have to be mentioned in the last call. 2964 Added RFC 3834 as an informative reference about backscatter. 2966 Added IDN requirements and normative reference to RFC 5890 to deal 2967 with the question "like DKIM did it.: 2969 Added informative reference to RFC 4632 for CIDR and use CIDR 2970 prefix length instead of CIDR-length to match its terminology. 2972 Simplified the exists description. 2974 Added text on creating a Authentication-Results header field that 2975 matches the Received-SPF header field information and added a 2976 normative reference to RFC 5451. 2978 Added informative reference to RFC 2782 due to SRV mention. 2980 Added informative reference to RFC 3464 due to DSN mention. 2982 Added informative reference to RFC 5617 for its DNS wildcard use. 2984 Clarified the intended match/no-match method for exists. 2986 Added new sections on Receiver policy for SPF pass, fail, and 2987 permerror. 2989 Added new section 10 discussion on treatment of bounces and the 2990 significance of HELO records. 2992 Added request to IANA to update the SPF modifier registry. 2994 Substantially reorganized the document for improved readability 2995 for new users based on WG consensus. 2997 Added new DNS "void lookup" processing limit to mitigate potential 2998 future risk of SPF being used as a DDoS vector. 3000 Author's Address 3002 Scott Kitterman 3003 Kitterman Technical Services 3004 3611 Scheel Dr 3005 Ellicott City, MD 21042 3006 United States of America 3008 Email: scott@kitterman.com