idnits 2.17.1 draft-ietf-spfbis-4408bis-14.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 (April 2, 2013) is 4042 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 2354, but not defined ** Obsolete normative reference: RFC 5451 (Obsoleted by RFC 7001) ** Downref: Normative reference to an Informational RFC: RFC 5598 -- 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: 2 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) April 2, 2013 5 Intended status: Standards Track 6 Expires: October 4, 2013 8 Sender Policy Framework (SPF) for Authorizing Use of Domains in Email, 9 Version 1 10 draft-ietf-spfbis-4408bis-14.txt 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 an ADMD can 19 explicitly authorize the hosts that are allowed to use its domain 20 names, and a receiving host can check such authorization. 22 This document obsoletes RFC4408. 24 Status of this Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at http://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on October 4, 2013. 41 Copyright Notice 43 Copyright (c) 2013 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents 48 (http://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 This document may contain material from IETF Documents or IETF 57 Contributions published or made publicly available before November 58 10, 2008. The person(s) controlling the copyright in some of this 59 material may not have granted the IETF Trust the right to allow 60 modifications of such material outside the IETF Standards Process. 61 Without obtaining an adequate license from the person(s) controlling 62 the copyright in such materials, this document may not be modified 63 outside the IETF Standards Process, and derivative works of it may 64 not be created outside the IETF Standards Process, except to format 65 it for publication as an RFC or to translate it into languages other 66 than English. 68 Table of Contents 70 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 6 71 1.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 6 72 1.1.1. Keywords . . . . . . . . . . . . . . . . . . . . . . . 6 73 1.1.2. Imported Definitions . . . . . . . . . . . . . . . . . 6 74 1.1.3. MAIL FROM Definition . . . . . . . . . . . . . . . . . 7 75 1.1.4. HELO Definition . . . . . . . . . . . . . . . . . . . 7 76 1.2. check_host() . . . . . . . . . . . . . . . . . . . . . . . 7 77 2. Operational Overview . . . . . . . . . . . . . . . . . . . . . 8 78 2.1. The "HELO" Identity . . . . . . . . . . . . . . . . . . . 8 79 2.2. The "MAIL FROM" Identity . . . . . . . . . . . . . . . . . 8 80 2.3. Publishing Authorization . . . . . . . . . . . . . . . . . 8 81 2.4. Checking Authorization . . . . . . . . . . . . . . . . . . 9 82 2.5. Location of Checks . . . . . . . . . . . . . . . . . . . . 10 83 2.6. Results of Evaluation . . . . . . . . . . . . . . . . . . 10 84 2.6.1. None . . . . . . . . . . . . . . . . . . . . . . . . . 11 85 2.6.2. Neutral . . . . . . . . . . . . . . . . . . . . . . . 11 86 2.6.3. Pass . . . . . . . . . . . . . . . . . . . . . . . . . 11 87 2.6.4. Fail . . . . . . . . . . . . . . . . . . . . . . . . . 11 88 2.6.5. Softfail . . . . . . . . . . . . . . . . . . . . . . . 11 89 2.6.6. Temperror . . . . . . . . . . . . . . . . . . . . . . 11 90 2.6.7. Permerror . . . . . . . . . . . . . . . . . . . . . . 11 91 3. SPF Records . . . . . . . . . . . . . . . . . . . . . . . . . 12 92 3.1. DNS Resource Records . . . . . . . . . . . . . . . . . . . 12 93 3.2. Multiple DNS Records . . . . . . . . . . . . . . . . . . . 13 94 3.3. Multiple Strings in a Single DNS record . . . . . . . . . 13 95 3.4. Record Size . . . . . . . . . . . . . . . . . . . . . . . 13 96 3.5. Wildcard Records . . . . . . . . . . . . . . . . . . . . . 13 97 4. The check_host() Function . . . . . . . . . . . . . . . . . . 15 98 4.1. Arguments . . . . . . . . . . . . . . . . . . . . . . . . 15 99 4.2. Results . . . . . . . . . . . . . . . . . . . . . . . . . 15 100 4.3. Initial Processing . . . . . . . . . . . . . . . . . . . . 16 101 4.4. Record Lookup . . . . . . . . . . . . . . . . . . . . . . 16 102 4.5. Selecting Records . . . . . . . . . . . . . . . . . . . . 16 103 4.6. Record Evaluation . . . . . . . . . . . . . . . . . . . . 17 104 4.6.1. Term Evaluation . . . . . . . . . . . . . . . . . . . 17 105 4.6.2. Mechanisms . . . . . . . . . . . . . . . . . . . . . . 17 106 4.6.3. Modifiers . . . . . . . . . . . . . . . . . . . . . . 18 107 4.6.4. DNS Lookup Limits . . . . . . . . . . . . . . . . . . 18 108 4.7. Default Result . . . . . . . . . . . . . . . . . . . . . . 19 109 4.8. Domain Specification . . . . . . . . . . . . . . . . . . . 19 110 5. Mechanism Definitions . . . . . . . . . . . . . . . . . . . . 21 111 5.1. "all" . . . . . . . . . . . . . . . . . . . . . . . . . . 22 112 5.2. "include" . . . . . . . . . . . . . . . . . . . . . . . . 22 113 5.3. "a" . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 114 5.4. "mx" . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 115 5.5. "ptr" (do not use) . . . . . . . . . . . . . . . . . . . . 24 116 5.6. "ip4" and "ip6" . . . . . . . . . . . . . . . . . . . . . 26 117 5.7. "exists" . . . . . . . . . . . . . . . . . . . . . . . . . 26 118 6. Modifier Definitions . . . . . . . . . . . . . . . . . . . . . 28 119 6.1. redirect: Redirected Query . . . . . . . . . . . . . . . . 28 120 6.2. exp: Explanation . . . . . . . . . . . . . . . . . . . . . 29 121 7. Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 122 7.1. Formal Specification . . . . . . . . . . . . . . . . . . . 31 123 7.2. Macro Definitions . . . . . . . . . . . . . . . . . . . . 31 124 7.3. Notes . . . . . . . . . . . . . . . . . . . . . . . . . . 32 125 7.4. Expansion Examples . . . . . . . . . . . . . . . . . . . . 34 126 8. Result Handling . . . . . . . . . . . . . . . . . . . . . . . 36 127 8.1. None . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 128 8.2. Neutral . . . . . . . . . . . . . . . . . . . . . . . . . 36 129 8.3. Pass . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 130 8.4. Fail . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 131 8.5. Softfail . . . . . . . . . . . . . . . . . . . . . . . . . 37 132 8.6. Temperror . . . . . . . . . . . . . . . . . . . . . . . . 38 133 8.7. Permerror . . . . . . . . . . . . . . . . . . . . . . . . 38 134 9. Recording The Result . . . . . . . . . . . . . . . . . . . . . 39 135 9.1. The Received-SPF Header Field . . . . . . . . . . . . . . 39 136 9.2. SPF Results in the Authentication-Results Header Field . . 41 137 10. Effects on Infrastructure . . . . . . . . . . . . . . . . . . 43 138 10.1. Sending Domains . . . . . . . . . . . . . . . . . . . . . 43 139 10.1.1. DNS Resource Considerations . . . . . . . . . . . . . 43 140 10.1.2. Administrator's Considerations . . . . . . . . . . . . 44 141 10.1.3. Bounces . . . . . . . . . . . . . . . . . . . . . . . 45 142 10.2. Receivers . . . . . . . . . . . . . . . . . . . . . . . . 45 143 10.3. Mediators . . . . . . . . . . . . . . . . . . . . . . . . 46 144 11. Security Considerations . . . . . . . . . . . . . . . . . . . 47 145 11.1. Processing Limits . . . . . . . . . . . . . . . . . . . . 47 146 11.2. SPF-Authorized Email May Contain Other False Identities . 48 147 11.3. Spoofed DNS and IP Data . . . . . . . . . . . . . . . . . 48 148 11.4. Cross-User Forgery . . . . . . . . . . . . . . . . . . . . 48 149 11.5. Untrusted Information Sources . . . . . . . . . . . . . . 49 150 11.5.1. Recorded Results . . . . . . . . . . . . . . . . . . . 49 151 11.5.2. External Explanations . . . . . . . . . . . . . . . . 49 152 11.5.3. Macro Expansion . . . . . . . . . . . . . . . . . . . 49 153 11.6. Privacy Exposure . . . . . . . . . . . . . . . . . . . . . 49 154 11.7. Delivering Mail Producing a 'Fail' Result . . . . . . . . 50 155 12. Contributors and Acknowledgements . . . . . . . . . . . . . . 51 156 13. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 52 157 13.1. The SPF DNS Record Type . . . . . . . . . . . . . . . . . 52 158 13.2. The Received-SPF Mail Header Field . . . . . . . . . . . . 52 159 13.3. SPF Modifier Registration . . . . . . . . . . . . . . . . 52 160 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 53 161 14.1. Normative References . . . . . . . . . . . . . . . . . . . 53 162 14.2. Informative References . . . . . . . . . . . . . . . . . . 54 163 Appendix A. Collected ABNF . . . . . . . . . . . . . . . . . . . 56 164 Appendix B. Extended Examples . . . . . . . . . . . . . . . . . . 59 165 B.1. Simple Examples . . . . . . . . . . . . . . . . . . . . . 59 166 B.2. Multiple Domain Example . . . . . . . . . . . . . . . . . 60 167 B.3. DNSBL Style Example . . . . . . . . . . . . . . . . . . . 61 168 B.4. Multiple Requirements Example . . . . . . . . . . . . . . 61 169 Appendix C. Changes in implementation requirements from RFC 170 4408 . . . . . . . . . . . . . . . . . . . . . . . . 62 171 Appendix D. Further Testing Advice . . . . . . . . . . . . . . . 63 172 Appendix E. SPF/Mediator Interactions . . . . . . . . . . . . . . 64 173 E.1. Originating ADMDs . . . . . . . . . . . . . . . . . . . . 64 174 E.2. Mediators . . . . . . . . . . . . . . . . . . . . . . . . 65 175 E.3. Receving ADMDs . . . . . . . . . . . . . . . . . . . . . . 65 176 Appendix F. Mail Services . . . . . . . . . . . . . . . . . . . . 66 177 Appendix G. MTA Relays . . . . . . . . . . . . . . . . . . . . . 67 178 Appendix H. Local Policy Considerations . . . . . . . . . . . . . 68 179 H.1. Policy For SPF Pass . . . . . . . . . . . . . . . . . . . 68 180 H.2. Policy For SPF Fail . . . . . . . . . . . . . . . . . . . 68 181 H.3. Policy For SPF Permerror . . . . . . . . . . . . . . . . . 69 182 Appendix I. Protocol Status . . . . . . . . . . . . . . . . . . . 70 183 Appendix J. Change History . . . . . . . . . . . . . . . . . . . 71 184 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 74 186 1. Introduction 188 The current email infrastructure has the property that any host 189 injecting mail into the system can use any DNS domain name it wants 190 in each of the various identifiers specified by [RFC5321] and 191 [RFC5322]. Although this feature is desirable in some circumstances, 192 it is a major obstacle to reducing Unsolicited Bulk Email (UBE, aka 193 spam). Furthermore, many domain owning ADMDs (ADministrative 194 Management Domains, see [RFC5598]) are understandably concerned about 195 the ease with which other entities can make use of their domain 196 names, often with malicious intent. 198 This document defines a protocol by which ADMDs can authorize hosts 199 to use their domain names in the "MAIL FROM" or "HELO" identities. 200 Compliant ADMDs publish Sender Policy Framework (SPF) records in the 201 DNS specifying which hosts are permitted to use their names, and 202 compliant mail receivers use the published SPF records to test the 203 authorization of sending Mail Transfer Agents (MTAs) using a given 204 "HELO" or "MAIL FROM" identity during a mail transaction. 206 An additional benefit to mail receivers is that after the use of an 207 identity is verified, local policy decisions about the mail can be 208 made based on the sender's domain, rather than the host's IP address. 209 This is advantageous because reputation of domain names is likely to 210 be more accurate than reputation of host IP addresses. Furthermore, 211 if a claimed identity fails verification, local policy can take 212 stronger action against such email, such as rejecting it. 214 1.1. Terminology 216 1.1.1. Keywords 218 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 219 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 220 "OPTIONAL" in this document are to be interpreted as described in 221 [RFC2119]. 223 1.1.2. Imported Definitions 225 The ABNF tokens "ALPHA", "DIGIT", and "SP" are defined in [RFC5234]. 227 The token "local-part" is defined in [RFC5321]. 229 "dot-atom", "quoted-string", "comment", "CFWS", "FWS", and "CRLF" are 230 defined in [RFC5322]. 232 1.1.3. MAIL FROM Definition 234 This document is concerned with the portion of a mail message 235 commonly called "envelope sender", "return path", "reverse path", 236 "bounce address", "5321 FROM", "MAIL FROM", or RFC5321.MailFrom. 237 Since these terms are either not well defined or often used casually, 238 this document uses "MAIL FROM" for consistency. This means the 239 RFC5321.MailFrom as defined in [RFC5598]. Note that other terms that 240 might superficially look like the common terms, such as "reverse- 241 path", are used only with the defined meanings from normative 242 documents. 244 1.1.4. HELO Definition 246 This document also makes use of the HELO/EHLO identity. The "HELO" 247 identity derives from either the SMTP HELO or EHLO command (see 248 [RFC5321]). Since HELO and EHLO can, in many cases, be used 249 interchangeably, they are identified commonly as "HELO" in this 250 document. This means RFC5321.HELO/.EHLO as defined in [RFC5598]. 251 These commands supply the identity of the SMTP client (sending host) 252 for the SMTP session. 254 1.2. check_host() 256 Section 4 introduces an algorithm to evaluate an SPF policy against 257 an arriving email transaction. In an early implementation, this 258 algorithm was encoded in a function called check_host(). That name 259 is used in this document as symbolic of the SPF evaluation algorithm, 260 but of course implementers are not required to use this name. 262 2. Operational Overview 264 2.1. The "HELO" Identity 266 It is RECOMMENDED that SPF verifiers not only check the "MAIL FROM" 267 identity, but also separately check the "HELO" identity by applying 268 the check_host() function (Section 4) to the "HELO" identity as the 269 . Checking "HELO" promotes consistency of results and can 270 reduce DNS resource usage. Additionally, since SPF records published 271 for "HELO" identities refer to a single host, when available, they 272 are a very reliable source of host authorization status. 274 Note that requirements for the domain presented in the EHLO or HELO 275 command are not always clear to the sending party, and SPF verifiers 276 MUST be prepared for the "HELO" identity to be malformed or an IP 277 address literal. This SPF check can only be performed when the 278 "HELO" string is a valid fully qualified domain. 280 2.2. The "MAIL FROM" Identity 282 SPF verifiers MUST check the ""MAIL FROM" identity if a completed 283 "HELO" check has not reached a definitive policy result by applying 284 the check_host() function to the "MAIL FROM" identity as the 285 . 287 [RFC5321] allows the reverse-path to be null (see Section 4.5.5 in 288 [RFC5321]). In this case, there is no explicit sender mailbox, and 289 such a message can be assumed to be a notification message from the 290 mail system itself. When the reverse-path is null, this document 291 defines the "MAIL FROM" identity to be the mailbox composed of the 292 local-part "postmaster" and the "HELO" identity (which might or might 293 not have been checked separately before). 295 2.3. Publishing Authorization 297 An SPF-compliant domain MUST have valid SPF records as described in 298 Section 3. These records authorize the use of the relevant domain 299 names in the "HELO" and "MAIL FROM" identities by the MTAs specified 300 therein. 302 SPF results can be used to make both positive (source is authorized) 303 and negative (source is not authorized) determinations. If domain 304 owners choose to publish SPF records and want to support receivers 305 making negative authorization determinations, then they MUST publish 306 records that end in "-all", or redirect to other records that do, 307 otherwise, no definitive determination of authorization can be made. 308 Potential issues and mitigations associated with negative 309 determinations are discussed in Section 10. 311 ADMDs can publish SPF records that explicitly authorize no hosts for 312 domain names that are neither used in the domain part of email 313 addresses nor expected to originate mail. 315 When changing SPF records, care has to be taken to ensure that there 316 is a transition period so that the old policy remains valid until all 317 legitimate email can reasonably expect to have been checked. 318 [RFC5321] Section 4.5.4.1 discusses how long a message might be in 319 transit. While offline checks are possible, the closer to the 320 original transmission time checks are performed, the more likely they 321 are to get an SPF result that matches the sending ADMD intent at the 322 time the message was sent. 324 2.4. Checking Authorization 326 A mail receiver can perform a set of SPF checks for each mail message 327 it receives. An SPF check tests the authorization of a client host 328 to emit mail with a given identity. Typically, such checks are done 329 by a receiving MTA, but can be performed elsewhere in the mail 330 processing chain so long as the required information is available and 331 reliable. At least the "MAIL FROM" identity MUST be checked, but it 332 is RECOMMENDED that the "HELO" identity also be checked beforehand. 334 Without explicit approval of the domain owner, checking other 335 identities against SPF version 1 records is NOT RECOMMENDED because 336 there are cases that are known to give incorrect results. For 337 example, almost all mailing lists rewrite the "MAIL FROM" identity 338 (see Section 10.3), but some do not change any other identities in 339 the message. Documents that define other identities will have to 340 define the method for explicit approval. 342 It is possible that mail receivers will use the SPF check as part of 343 a larger set of tests on incoming mail. The results of other tests 344 might influence whether or not a particular SPF check is performed. 345 For example, finding the sending host's IP address on a local white 346 list might cause all other tests to be skipped and all mail from that 347 host to be accepted. 349 When a mail receiver decides to perform an SPF check, it MUST use a 350 correctly-implemented check_host() function (Section 4) evaluated 351 with the correct parameters. Although the test as a whole is 352 optional, once it has been decided to perform a test it has to be 353 performed as specified so that the correct semantics are preserved 354 between publisher and receiver. 356 To make the test, the mail receiver MUST evaluate the check_host() 357 function with the arguments set as follows: 359 - the IP address of the SMTP client that is emitting the 360 mail, either IPv4 or IPv6. 362 - the domain portion of the "MAIL FROM" or "HELO" identity. 364 - the "MAIL FROM" or "HELO" identity. 366 Although invalid, malformed, or non-existent domains cause SPF checks 367 to return "none" because no SPF record can be found, it has long been 368 the policy of many MTAs to reject email from such domains, especially 369 in the case of invalid "MAIL FROM". Rejecting email will prevent one 370 method of circumventing of SPF records. 372 Implementations have to take care to correctly extract the 373 from the data given with the SMTP MAIL FROM command as many MTAs will 374 still accept such things as source routes (see [RFC5321], Appendix 375 C), the %-hack (see [RFC1123]), and bang paths (see [RFC1983]). 376 These archaic features have been maliciously used to bypass security 377 systems. 379 2.5. Location of Checks 381 The authorization check SHOULD be performed during the processing of 382 the SMTP transaction that sends the mail. This reduces the 383 complexity of determining the correct IP address to use as an input 384 to check_host() and allows errors to be returned directly to the 385 sending MTA by way of SMTP replies. 387 Performing the authorization other than using the return-path and 388 client address at the time of the MAIL command during the SMTP 389 transaction can cause problems, such as the following: (1) It might 390 be difficult to accurately extract the required information from 391 potentially deceptive headers; (2) legitimate email might fail 392 because the sender's policy had since changed. 394 Generating non-delivery notifications to forged identities that have 395 failed the authorization check is a source of backscatter and SHOULD 396 be avoided. Section 2 of [RFC3834] describes backscatter and the 397 problems it causes. 399 2.6. Results of Evaluation 401 Section 4 defines check_host(), a model function definition that uses 402 the inputs defined above and the sender's policy published in the DNS 403 to reach a conclusion about client authorization. An SPF verifier 404 implements something semantically identical to the function defined 405 there. 407 This section enumerates and briefly defines the possible outputs of 408 that function. Information about how to handle these outputs is in 409 Section 8. 411 2.6.1. None 413 A result of "none" means either (a) no syntactically valid DNS domain 414 name was extracted from the SMTP session that could be used as the 415 one to be authorized, or (b) no TXT records were retrieved from the 416 DNS that appeared to be intended for use by SPF verifiers. 418 2.6.2. Neutral 420 The domain owner has explicitly stated that it is not asserting 421 whether the IP address is authorized. This result MUST be treated 422 exactly like the "none" result; the distinction exists only for 423 informational purposes. 425 2.6.3. Pass 427 A "pass" result means that the client is authorized to inject mail 428 with the given identity. The domain can now, in the sense of 429 reputation, be considered responsible for sending the message. 430 Further policy checks can now proceed with confidence in the 431 legitimate use of the identity. This is further discussed in 432 Appendix H.1. 434 2.6.4. Fail 436 A "fail" result is an explicit statement that the client is not 437 authorized to use the domain in the given identity. 439 2.6.5. Softfail 441 The domain owner has published a weak statement that the host is 442 probably not authorized. It has not published a stronger, more 443 definitive policy that results in a "fail" 445 2.6.6. Temperror 447 A "temperror" result means the SPF verifier encountered a transient 448 (generally DNS) error while performing the check. 450 2.6.7. Permerror 452 A "permerror" result means the domain's published records could not 453 be correctly interpreted. This signals an error condition that 454 definitely requires manual intervention to be resolved. 456 3. SPF Records 458 An SPF record is a DNS record that declares which hosts are, and are 459 not, authorized to use a domain name for the "HELO" and "MAIL FROM" 460 identities. Loosely, the record partitions all hosts into permitted 461 and not-permitted sets (though some hosts might fall into neither 462 category). 464 The SPF record is a single string of text. The record format is 465 described below in Section 4. An example record is the following: 467 v=spf1 +mx a:colo.example.com/28 -all 469 This record has a version of "spf1" and three directives: "+mx", 470 "a:colo.example.com/28" (the + is implied), and "-all". 472 Each SPF record is placed in the DNS tree at the host name it 473 pertains to, not a subdomain under it, such as is done with SRV 474 records [RFC2782]. 476 The example in this section might be published via these lines in a 477 domain zone file: 479 example.com. TXT "v=spf1 +mx a:colo.example.com/28 -all" 480 smtp-out.example.com. TXT "v=spf1 a -all" 482 Since TXT records have multiple uses, beware of other TXT records 483 published there for other purposes. They might cause problems with 484 size limits (see Section 3.4) and care has to be taken to ensure only 485 SPF records are used for SPF processing. 487 ADMDs publishing SPF records SHOULD try to keep the number of 488 "include" mechanisms and chained "redirect" modifiers to a minimum. 489 ADMDs SHOULD also try to minimize the amount of other DNS information 490 needed to evaluate a record. Section 4.6.4 and Section 10.1.1 491 provide some suggestions on how to achieve this. 493 3.1. DNS Resource Records 495 SPF records MUST be published as a DNS TXT (type 16) Resource Record 496 (RR) [RFC1035] only. The character content of the record is encoded 497 as [US-ASCII]. Use of alternate DNS RR types was supported in SPF's 498 experimental phase, but has been discontinued. See Appendix A of 499 [RFC6686] for further information. 501 3.2. Multiple DNS Records 503 A domain name MUST NOT have multiple records that would cause an 504 authorization check to select more than one record. See Section 4.5 505 for the selection rules. 507 3.3. Multiple Strings in a Single DNS record 509 As defined in [RFC1035] sections 3.3.14 and 3.3, a single text DNS 510 record can be composed of more than one string. If a published 511 record contains multiple character-strings, then the record MUST be 512 treated as if those strings are concatenated together without adding 513 spaces. For example: 515 IN TXT "v=spf1 .... first" "second string..." 517 MUST be treated as equivalent to: 519 IN TXT "v=spf1 .... firstsecond string..." 521 TXT records containing multiple strings are useful in constructing 522 records that would exceed the 255-byte maximum length of a character- 523 string within a single TXT record. 525 3.4. Record Size 527 The published SPF record for a given domain name SHOULD remain small 528 enough that the results of a query for it will fit within 512 octets. 529 This UDP limit is defined in [RFC1035] section 2.3.4. This will keep 530 even older DNS implementations from falling over to TCP. Since the 531 answer size is dependent on many things outside the scope of this 532 document, it is only possible to give this guideline: If the combined 533 length of the DNS name and the text of all the records of a given 534 type is under 450 octets, then DNS answers ought to fit in UDP 535 packets. Records that are too long to fit in a single UDP packet 536 could be silently ignored by SPF verifiers due to firewall and other 537 issues that cause DNS over TCP to be less reliable than DNS over UDP. 539 Note that when computing the sizes for replies to queries of the TXT 540 format, one has to take into account any other TXT records published 541 at the domain name. Similarly, the sizes for replies to all queries 542 related to SPF have to be evaluated to fit in a single UDP packet. 544 3.5. Wildcard Records 546 Use of wildcard records for publishing is discouraged and care has to 547 be taken if they are used. If a zone includes wildcard MX records, 548 it might want to publish wildcard declarations, subject to the same 549 requirements and problems. In particular, the declaration MUST be 550 repeated for any host that has any RR records at all, and for 551 subdomains thereof. Consider the example in [RFC1034], Section 552 4.3.3. Based on that, we can do the following: 554 EXAMPLE.COM. MX 10 A.EXAMPLE.COM 555 EXAMPLE.COM. TXT "v=spf1 a:A.EXAMPLE.COM -all" 557 *.EXAMPLE.COM. MX 10 A.EXAMPLE.COM 558 *.EXAMPLE.COM. TXT "v=spf1 a:A.EXAMPLE.COM -all" 560 A.EXAMPLE.COM. A 203.0.113.1 561 A.EXAMPLE.COM. MX 10 A.EXAMPLE.COM 562 A.EXAMPLE.COM. TXT "v=spf1 a:A.EXAMPLE.COM -all" 564 *.A.EXAMPLE.COM. MX 10 A.EXAMPLE.COM 565 *.A.EXAMPLE.COM. TXT "v=spf1 a:A.EXAMPLE.COM -all" 567 SPF records have to be listed twice for every name within the zone: 568 once for the name, and once with a wildcard to cover the tree under 569 the name, in order to cover all domains in use in outgoing mail. 571 4. The check_host() Function 573 This description is not an API (Application Program Interface) 574 definition, but rather a function description used to illustrate the 575 algorithm. A compliant SPF implementation MUST do something 576 semantically equivalent to this description. 578 The check_host() function fetches SPF records, parses them, and 579 evaluates them to determine whether a particular host is or is not 580 permitted to send mail with a given identity. Mail receivers that 581 perform this check MUST correctly evaluate the check_host() function 582 as described here. 584 Implementations MAY use a different algorithm than the canonical 585 algorithm defined here, so long as the results are the same in all 586 cases. 588 4.1. Arguments 590 The check_host() function takes these arguments: 592 - the IP address of the SMTP client that is emitting the 593 mail, either IPv4 or IPv6. 595 - the domain that provides the sought-after authorization 596 information; initially, the domain portion of the "MAIL 597 FROM" or "HELO" identity. 599 - the "MAIL FROM" or "HELO" identity. 601 For recursive evaluations, the domain portion of might not 602 be the same as the argument when check_host() is initially 603 evaluated. In most other cases it will be the same. (See 604 Section 5.2 below). 606 Note that the argument might not be a well-formed domain 607 name. For example, if the reverse-path was null, then the EHLO/HELO 608 domain is used, with its associated problems (see Section 2.1). In 609 these cases, check_host() is defined in Section 4.3 to return a 610 "none" result. 612 4.2. Results 614 The function check_host() can return one of several results described 615 in Section 2.6. Based on the result, the action to be taken is 616 determined by the local policies of the receiver. This is discussed 617 in Section 8. 619 4.3. Initial Processing 621 If the is malformed (e.g. label longer than 63 characters, 622 zero-length label not at the end, etc.) or is not a fully qualified 623 domain name, or if the DNS lookup returns "domain does not exist" 624 (RCODE 3), check_host() immediately returns the result "none". 625 Properly formed domains are fully qualified email domains as 626 described in [RFC5321] Section 2.3.5. Internationalized domain names 627 MUST be encoded as A-labels, as described in Section 2.3 of 628 [RFC5890].on 2.3 of [RFC5890]. 630 If the has no local-part, substitute the string "postmaster" 631 for the local-part. 633 4.4. Record Lookup 635 In accordance with how the records are published (see Section 3 636 above), a DNS query needs to be made for the name, querying 637 for type TXT only. 639 If all DNS lookups that are made return a server failure (RCODE 2), 640 or other error (RCODE other than 0 or 3), or time out, then 641 check_host() terminates immediately with the result "temperror". 642 Alternatively, for a server failure (RCODE 2) result, check_host() 643 MAY track failures and treat multiple failures within 24 hours for 644 the same domain as "permerror". 646 This alternative is intended to shorten the queue time of messages 647 that cannot be accepted, by returning a permanent negative completion 648 reply code to the client, instead of a transient one. [RFC2308] 649 suggests on an algorithm for doing such tracking and handling of 650 server failure codes. 652 4.5. Selecting Records 654 Records begin with a version section: 656 record = version terms *SP 657 version = "v=spf1" 659 Starting with the set of records that were returned by the lookup, 660 discard records that do not begin with a version section of exactly 661 "v=spf1". Note that the version section is terminated either by an 662 SP character or the end of the record. A record with a version 663 section of "v=spf10" does not match and is discarded. 665 If the resultant record set includes no records, check_host() 666 produces the "none" result. If the resultant record set includes 667 more than one record, check_host() produces the "permerror" result. 669 4.6. Record Evaluation 671 The check_host() function parses and interprets the SPF record to 672 find a result for the current test. If there are any syntax errors 673 anywhere in the record, check_host() returns immediately with the 674 result "permerror", without further interpretation. 676 4.6.1. Term Evaluation 678 There are two types of terms: mechanisms and modifiers. A record 679 contains an ordered list of these as specified in the following 680 Augmented Backus-Naur Form (ABNF). 682 terms = *( 1*SP ( directive / modifier ) ) 684 directive = [ qualifier ] mechanism 685 qualifier = "+" / "-" / "?" / "~" 686 mechanism = ( all / include 687 / A / MX / PTR / IP4 / IP6 / exists ) 688 modifier = redirect / explanation / unknown-modifier 689 unknown-modifier = name "=" macro-string 690 ; where name is not any known modifier 692 name = ALPHA *( ALPHA / DIGIT / "-" / "_" / "." ) 694 Most mechanisms allow a ":" or "/" character after the name. 696 Modifiers always contain an equals ('=') character immediately after 697 the name, and before any ":" or "/" characters that might be part of 698 the macro-string. 700 Terms that do not contain any of "=", ":", or "/" are mechanisms, as 701 defined in Section 5. 703 As per the definition of the ABNF notation in [RFC5234], mechanism 704 and modifier names are case-insensitive. 706 4.6.2. Mechanisms 708 Each mechanism is considered in turn from left to right. If there 709 are no more mechanisms, the result is specified in Section 4.7. 711 When a mechanism is evaluated, one of three things can happen: it can 712 match, not match, or return an exception. 714 If it matches, processing ends and the qualifier value is returned as 715 the result of that record. If it does not match, processing 716 continues with the next mechanism. If it returns an exception, 717 mechanism processing ends and the exception value is returned. 719 The possible qualifiers, and the results they cause check_host() to 720 return are as follows: 722 "+" pass 723 "-" fail 724 "~" softfail 725 "?" neutral 727 The qualifier is optional and defaults to "+". 729 When a mechanism matches and the qualifier is "-", then a "fail" 730 result is returned and the explanation string is computed as 731 described in Section 6.2. 733 The specific mechanisms are described in Section 5. 735 4.6.3. Modifiers 737 Modifiers are not mechanisms. They do not return match or not-match. 738 Instead, they provide additional information. Although modifiers do 739 not directly affect the evaluation of the record, the "redirect" 740 modifier has an effect after all the mechanisms have been evaluated. 742 4.6.4. DNS Lookup Limits 744 SPF implementations MUST limit the total number of mechanisms and 745 modifiers ("terms") that cause any DNS query to at most 10 during SPF 746 evaluation. Specifically, the "include", "a", "mx", "ptr", and 747 "exists" mechanisms as well as the "redirect" modifier count against 748 this collective limit. The "all", "ip4", and "ip6" mechanisms do not 749 count against this limit. If this number is exceeded during a check, 750 a permerror MUST be returned. The "exp" modifier does not count 751 against this limit because the DNS lookup to fetch the explanation 752 string occurs after the SPF record evaluation has been completed. 754 When evaluating the "mx" mechanism, the number of "MX" resource 755 records queried is included in the overall limit of 10 mechanisms/ 756 modifiers that cause DNS look ups described above. The evaluation of 757 each "MX" record MUST NOT result in querying more than 10 "A" 758 resource records. If this limit is exceeded, the "mx" mechanism MUST 759 produce a "permerror" result. 761 When evaluating the "ptr" mechanism or the %{p} macro, the number of 762 "PTR" resource records queried is included in the overall limit of 10 763 mechanisms/modifiers that cause DNS look ups described above. The 764 evaluation of each "PTR" record MUST NOT result in querying more than 765 10 "A" resource records. If this limit is exceeded, all records 766 other than the first 10 MUST be ignored. 768 The reason for the disparity is that the set of and contents of the 769 MX record are under control of the domain owner, while the set of and 770 contents of PTR records are under control of the owner of the IP 771 address actually making the connection. 773 These limits are per mechanism or macro in the record, and are in 774 addition to the lookup limits specified above. 776 MTAs or other processors SHOULD impose a limit on the maximum amount 777 of elapsed time to evaluate check_host(). Such a limit SHOULD allow 778 at least 20 seconds. If such a limit is exceeded, the result of 779 authorization SHOULD be "temperror". 781 As described at the end of Section 11.1, there may be cases where it 782 is useful to limit the number of "terms" for which DNS queries return 783 either a positive answer (RCODE 0) with an answer count of 0, or a no 784 such record (RCODE 3) answer. These are sometimes collectively 785 referred to as "void lookups". SPF implementations SHOULD limit 786 "void lookups" to two. An implementation MAY choose to make such a 787 limit configurable. In this case, a default of two is RECOMMENDED. 789 4.7. Default Result 791 If none of the mechanisms match and there is no "redirect" modifier, 792 then the check_host() returns a result of "neutral", just as if 793 "?all" were specified as the last directive. If there is a 794 "redirect" modifier, check_host() proceeds as defined in Section 6.1. 796 Note that records SHOULD always use either a "redirect" modifier or 797 an "all" mechanism to explicitly terminate processing. Although the 798 latter has default (specifically "?all"), it aids debugging efforts 799 if it is explicitly included. 801 For example: 803 v=spf1 +mx -all 804 or 805 v=spf1 +mx redirect=_spf.example.com 807 4.8. Domain Specification 809 Several of these mechanisms and modifiers have a domain-spec section. 810 The domain-spec string is subject to macro expansion (see Section 7). 812 The resulting string is the common presentation form of a fully- 813 qualified DNS name: a series of labels separated by periods. This 814 domain is called the in the rest of this document. 816 Note: The result of the macro expansion is not subject to any further 817 escaping. Hence, this facility cannot produce all characters that 818 are legal in a DNS label (e.g., the control characters). However, 819 this facility is powerful enough to express legal host names and 820 common utility labels (such as "_spf") that are used in DNS. 822 For several mechanisms, the domain-spec is optional. If it is not 823 provided, the from the check_host() arguments (see 824 Section 4.1) is used as the . Domain and domain-spec 825 are syntactically identical after macro expansion. Domain is an 826 input value for check_host() while domain-spec is computed by 827 check_host(). 829 Note: Historically, this document has made no provisions for how to 830 handle domain-specs, or macro-expansions thereof, that are 831 syntactically invalid per [RFC1035], such as names with empty labels 832 (e.g., "foo..example.com") or overlong labels (more than 63 833 characters). Some implementations choose to treat as a no-match 834 mechanisms, and ignore modifiers with such names, whereas others 835 return a "permerror" exception. The outcome for an unexpected 836 domain-spec without macros might even differ from that for an 837 unexpected after macro expansion. 839 5. Mechanism Definitions 841 This section defines two types of mechanisms. 843 Basic mechanisms contribute to the language framework. They do not 844 specify a particular type of authorization scheme. 846 all 847 include 849 Designated sender mechanisms are used to designate a set of 850 addresses as being permitted or not permitted to use the for 851 sending mail. 853 a 854 mx 855 ptr (do not use) 856 ip4 857 ip6 858 exists 860 The following conventions apply to all mechanisms that perform a 861 comparison between and an IP address at any point: 863 If no CIDR prefix length is given in the directive, then and the 864 IP address are compared for equality. (Here, CIDR is Classless 865 Inter-Domain Routing, described in [RFC4632].) 867 If a CIDR prefix length is specified, then only the specified number 868 of high-order bits of and the IP address are compared for 869 equality. 871 When any mechanism fetches host addresses to compare with , when 872 is an IPv4, "A" records are fetched; when is an IPv6 873 address, "AAAA" records are fetched. SPF implementations on IPv6 874 servers need to handle both "AAAA" and "A" secords, for clients on 875 IPv4 mapped IPv6 addresses [RFC4291]. IPv4 addresses are only 876 listed in an SPF record using the "ip4" mechanism. 878 Several mechanisms rely on information fetched from the DNS. For 879 these DNS queries, except where noted, if the DNS server returns an 880 error (RCODE other than 0 or 3) or the query times out, the mechanism 881 stops and the topmost check_host() returns "temperror". If the 882 server returns "domain does not exist" (RCODE 3), then evaluation of 883 the mechanism continues as if the server returned no error (RCODE 0) 884 and zero answer records. 886 5.1. "all" 888 all = "all" 890 The "all" mechanism is a test that always matches. It is used as the 891 rightmost mechanism in a record to provide an explicit default. 893 For example: 895 v=spf1 a mx -all 897 Mechanisms after "all" will never be tested. Mechanisms listed after 898 "all" MUST be ignored. Any "redirect" modifier (Section 6.1) MUST be 899 ignored when there is an "all" mechanism in the record. 901 5.2. "include" 903 include = "include" ":" domain-spec 905 The "include" mechanism triggers a recursive evaluation of 906 check_host(). 908 1. The domain-spec is expanded as per Section 7. 910 2. Check_host() is evaluated with the resulting string as the 911 . The and arguments remain the same as in 912 the current evaluation of check_host(). 914 3. The recursive evaluation returns either match, not match, or an 915 error. If it matches, then the appropriate result for the 916 include: mechanism is used (e.g. include or +include gives a 917 "pass" result and -include gives "fail). 919 4. If there is no match, the parent check_host() resumes processing 920 as per the table below, with the previous value of 921 restored. 923 In hindsight, the name "include" was poorly chosen. Only the 924 evaluated result of the referenced SPF record is used, rather than 925 acting as if the referenced SPF record was literally included in the 926 first. For example, evaluating a "-all" directive in the referenced 927 record does not terminate the overall processing and does not 928 necessarily result in an overall "fail". (Better names for this 929 mechanism would have been "if-match", "on-match", etc.) 931 The "include" mechanism makes it possible for one domain to designate 932 multiple administratively-independent domains. For example, a vanity 933 domain "example.net" might send mail using the servers of 934 administratively-independent domains example.com and example.org. 936 Example.net could say 938 IN TXT "v=spf1 include:example.com include:example.org -all" 940 This would direct check_host() to, in effect, check the records of 941 example.com and example.org for a "pass" result. Only if the host 942 were not permitted for either of those domains would the result be 943 "fail". 945 Whether this mechanism matches, does not match, or returns an 946 exception depends on the result of the recursive evaluation of 947 check_host(): 949 +---------------------------------+---------------------------------+ 950 | A recursive check_host() result | Causes the "include" mechanism | 951 | of: | to: | 952 +---------------------------------+---------------------------------+ 953 | pass | match | 954 | | | 955 | fail | not match | 956 | | | 957 | softfail | not match | 958 | | | 959 | neutral | not match | 960 | | | 961 | temperror | return temperror | 962 | | | 963 | permerror | return permerror | 964 | | | 965 | none | return permerror | 966 +---------------------------------+---------------------------------+ 968 The "include" mechanism is intended for crossing administrative 969 boundaries. For example, if example.com and example.org were managed 970 by the same entity, and if the permitted set of hosts for both 971 domains was 972 "mx:example.com", it would be possible for example.org to specify 973 "include:example.com", but it would be preferable to specify 974 "redirect=example.com" or even "mx:example.com". 976 With the "include" mechanism an administratively external set of 977 hosts can be authorized, but determination of sender policy is still 978 a function of the original domain's SPF record (as determined by the 979 "all" mechanism in that record). The redirect modifier is more 980 suitable for consolidating both authorizations and policy into a 981 common set to be shared within an ADMD. Redirect is much more like a 982 common code element to be shared among records in a single ADMD. It 983 is possible to control both authorized hosts and policy for an 984 arbitrary number of domains from a single record. 986 5.3. "a" 988 This mechanism matches if is one of the 's IP 989 addresses. 991 a = "a" [ ":" domain-spec ] [ dual-cidr-length ] 993 An address lookup is done on the using the type of 994 lookup (A or AAAA) appropriate for the connection type (IPv4 or 995 IPv6). The is compared to the returned address(es). If any 996 address matches, the mechanism matches. 998 5.4. "mx" 1000 This mechanism matches if is one of the MX hosts for a domain 1001 name. 1003 mx = "mx" [ ":" domain-spec ] [ dual-cidr-length ] 1005 check_host() first performs an MX lookup on the . Then 1006 it performs an address lookup on each MX name returned. The is 1007 compared to each returned IP address. To prevent Denial of Service 1008 (DoS) attacks, more than 10 MX names MUST NOT be looked up during the 1009 evaluation of an "mx" mechanism. If there are more than 10 MX names 1010 then permerror is returned and the evaluation terminated (see 1011 Section 4.6.4). If any address matches, the mechanism matches. 1013 Note regarding implicit MXs: If the has no MX records, 1014 check_host() MUST NOT pretend the target is its single MX, and MUST 1015 NOT default to an A or AAAA lookup on the directly. 1016 This behavior diverges from the legacy "implicit MX" rule, (See 1017 [RFC5321], Section 5. If such behavior is desired, the publisher 1018 will have to specify an "a" directive). 1020 5.5. "ptr" (do not use) 1022 This mechanism tests whether the DNS reverse-mapping for exists 1023 and correctly points to a domain name within a particular domain. 1024 This mechanism SHOULD NOT be used. See below for discussion. 1026 ptr = "ptr" [ ":" domain-spec ] 1028 The 's name is looked up using this procedure: 1030 o Perform a DNS reverse-mapping for : Look up the corresponding 1031 PTR record in "in-addr.arpa." if the address is an IPv4 one and in 1032 "ip6.arpa." if it is an IPv6 address. 1034 o For each record returned, validate the domain name by looking up 1035 its IP addresses. To prevent DoS attacks, more than 10 PTR names 1036 MUST NOT be looked up during the evaluation of a "ptr" mechanism 1037 (see Section 4.6.4). 1039 o If is among the returned IP addresses, then that domain name 1040 is validated. 1042 Check all validated domain names to see if they either match the 1043 domain or are a subdomain of the domain. 1044 If any do, this mechanism matches. If no validated domain name can 1045 be found, or if none of the validated domain names match or are a 1046 subdomain of the , this mechanism fails to match. If a 1047 DNS error occurs while doing the PTR RR lookup, then this mechanism 1048 fails to match. If a DNS error occurs while doing an A RR lookup, 1049 then that domain name is skipped and the search continues. 1051 Pseudocode: 1053 sending-domain_names := ptr_lookup(sending-host_IP); 1054 if more than 10 sending-domain_names are found, use at most 10. 1055 for each name in (sending-domain_names) { 1056 IP_addresses := a_lookup(name); 1057 if the sending-domain_IP is one of the IP_addresses { 1058 validated-sending-domain_names += name; 1059 } 1060 } 1062 for each name in (validated-sending-domain_names) { 1063 if name ends in , return match. 1064 if name is , return match. 1065 } 1066 return no-match. 1068 This mechanism matches if the is either a subdomain of 1069 a validated domain name or if the and a validated 1070 domain name are the same. For example: "mail.example.com" is within 1071 the domain "example.com", but "mail.bad-example.com" is not. 1073 Note: This mechanism is slow, it is not as reliable as other 1074 mechanisms in cases of DNS errors, and it places a large burden on 1075 the .arpa name servers. If used, proper PTR records MUST be in place 1076 for the domain's hosts and the "ptr" mechanism SHOULD be one of the 1077 last mechanisms checked. After many years of SPF deployment 1078 experience it has been concluded it is unnecessary and more reliable 1079 alternatives used instead. It is, however, still in use and part of 1080 the SPF protocol, so compliant check_host() implementations MUST 1081 support it. 1083 5.6. "ip4" and "ip6" 1085 These mechanisms test whether is contained within a given IP 1086 network. 1088 ip4 = "ip4" ":" ip4-network [ ip4-cidr-length ] 1089 ip6 = "ip6" ":" ip6-network [ ip6-cidr-length ] 1091 ip4-cidr-length = "/" 1*DIGIT 1092 ip6-cidr-length = "/" 1*DIGIT 1093 dual-cidr-length = [ ip4-cidr-length ] [ "/" ip6-cidr-length ] 1095 ip4-network = qnum "." qnum "." qnum "." qnum 1096 qnum = DIGIT ; 0-9 1097 / %x31-39 DIGIT ; 10-99 1098 / "1" 2DIGIT ; 100-199 1099 / "2" %x30-34 DIGIT ; 200-249 1100 / "25" %x30-35 ; 250-255 1101 ; as per conventional dotted quad notation. e.g., 192.0.2.0 1102 ip6-network = 1103 ; e.g., 2001:DB8::CD30 1105 The is compared to the given network. If CIDR prefix length 1106 high-order bits match, the mechanism matches. 1108 If ip4-cidr-length is omitted, it is taken to be "/32". If 1109 ip6-cidr-length is omitted, it is taken to be "/128". It is not 1110 permitted to omit parts of the IP address instead of using CIDR 1111 notations. That is, use 192.0.2.0/24 instead of 192.0.2. 1113 5.7. "exists" 1115 This mechanism is used to construct an arbitrary domain name that is 1116 used for a DNS A record query. It allows for complicated schemes 1117 involving arbitrary parts of the mail envelope to determine what is 1118 permitted. 1120 exists = "exists" ":" domain-spec 1122 The domain-spec is expanded as per Section 7. The resulting domain 1123 name is used for a DNS A RR lookup (even when the connection type is 1124 IPv6). If any A record is returned, this mechanism matches. 1126 Domains can use this mechanism to specify arbitrarily complex 1127 queries. For example, suppose example.com publishes the record: 1129 v=spf1 exists:%{ir}.%{l1r+-}._spf.%{d} -all 1131 The might expand to 1132 "1.2.0.192.someuser._spf.example.com". This makes fine-grained 1133 decisions possible at the level of the user and client IP address. 1135 6. Modifier Definitions 1137 Modifiers are name/value pairs that provide additional information. 1138 Modifiers always have an "=" separating the name and the value. 1140 The modifiers defined in this document ("redirect" and "exp") MAY 1141 appear anywhere in the record, but SHOULD appear at the end, after 1142 all mechanisms. Ordering of these two modifiers does not matter. 1143 These two modifiers MUST NOT appear in a record more than once each. 1144 If they do, then check_host() exits with a result of "permerror". 1146 Unrecognized modifiers MUST be ignored no matter where in a record, 1147 or how often. This allows implementations of this document to 1148 gracefully handle records with modifiers that are defined in other 1149 specifications. 1151 6.1. redirect: Redirected Query 1153 The redirect modifier is intended for consolidating both 1154 authorizations and policy into a common set to be shared within a 1155 single ADMD. Redirect is like a common code element to be shared 1156 among records in a single ADMD. It is possible to control both 1157 authorized hosts and policy for an arbitrary number of domains from a 1158 single record. 1160 redirect = "redirect" "=" domain-spec 1162 If all mechanisms fail to match, and a "redirect" modifier is 1163 present, then processing proceeds as follows: 1165 The domain-spec portion of the redirect section is expanded as per 1166 the macro rules in Section 7. Then check_host() is evaluated with 1167 the resulting string as the . The and 1168 arguments remain the same as in the current evaluation of 1169 check_host(). 1171 The result of this new evaluation of check_host() is then considered 1172 the result of the current evaluation with the exception that if no 1173 SPF record is found, or if the is malformed, the result 1174 is a "permerror" rather than "none". 1176 Note that the newly-queried domain can itself specify redirect 1177 processing. 1179 This facility is intended for use by organizations that wish to apply 1180 the same record to multiple domains. For example: 1182 la.example.com. TXT "v=spf1 redirect=_spf.example.com" 1183 ny.example.com. TXT "v=spf1 redirect=_spf.example.com" 1184 sf.example.com. TXT "v=spf1 redirect=_spf.example.com" 1185 _spf.example.com. TXT "v=spf1 mx:example.com -all" 1187 In this example, mail from any of the three domains is described by 1188 the same record. This can be an administrative advantage. 1190 Note: In general, the domain "A" cannot reliably use a redirect to 1191 another domain "B" not under the same administrative control. Since 1192 the stays the same, there is no guarantee that the record at 1193 domain "B" will correctly work for mailboxes in domain "A", 1194 especially if domain "B" uses mechanisms involving local-parts. An 1195 "include" directive is generally be more appropriate. 1197 For clarity, it is RECOMMENDED that any "redirect" modifier appear as 1198 the very last term in a record. 1200 6.2. exp: Explanation 1202 explanation = "exp" "=" domain-spec 1204 If check_host() results in a "fail" due to a mechanism match (such as 1205 "-all"), and the "exp" modifier is present, then the explanation 1206 string returned is computed as described below. If no "exp" modifier 1207 is present, then either a default explanation string or an empty 1208 explanation string MUST be returned. 1210 The domain-spec is macro expanded (see Section 7) and becomes the 1211 . The DNS TXT record for the is fetched. 1213 If there are any DNS processing errors (any RCODE other than 0), or 1214 if no records are returned, or if more than one record is returned, 1215 or if there are syntax errors in the explanation string, then proceed 1216 as if no exp modifier was given. 1218 The fetched TXT record's strings are concatenated with no spaces, and 1219 then treated as an explain-string, which is macro-expanded. This 1220 final result is the explanation string. Implementations MAY limit 1221 the length of the resulting explanation string to allow for other 1222 protocol constraints and/or reasonable processing limits. Since the 1223 explanation string is intended for an SMTP response and [RFC5321] 1224 Section 2.4 says that responses are in [US-ASCII], the explanation 1225 string MUST be limited to US-ASCII. 1227 Software evaluating check_host() can use this string to communicate 1228 information from the publishing domain in the form of a short message 1229 or URL. Software SHOULD make it clear that the explanation string 1230 comes from a third party. For example, it can prepend the macro 1231 string "%{o} explains: " to the explanation, such as shown in 1232 Section 2.6.4. 1234 Suppose example.com has this record: 1236 v=spf1 mx -all exp=explain._spf.%{d} 1238 Here are some examples of possible explanation TXT records at 1239 explain._spf.example.com: 1241 "Mail from example.com should only be sent by its own servers." 1242 -- a simple, constant message 1244 "%{i} is not one of %{d}'s designated mail servers." 1245 -- a message with a little more information, including the IP 1246 address that failed the check 1248 "See http://%{d}/why.html?s=%{S}&i=%{I}" 1249 -- a complicated example that constructs a URL with the 1250 arguments to check_host() so that a web page can be 1251 generated with detailed, custom instructions 1253 Note: During recursion into an "include" mechanism, an exp= modifier 1254 from the MUST NOT be used. In contrast, when executing 1255 a "redirect" modifier, an exp= modifier from the original domain MUST 1256 NOT be used. 1258 7. Macros 1260 When evaluating an SPF policy record, certain character sequences are 1261 intended to be replaced by parameters of the message or of the 1262 connection. These character sequences are referred to as "macros". 1264 7.1. Formal Specification 1266 The ABNF description for a macro is as follows: 1268 domain-spec = macro-string domain-end 1269 domain-end = ( "." toplabel [ "." ] ) / macro-expand 1271 toplabel = ( *alphanum ALPHA *alphanum ) / 1272 ( 1*alphanum "-" *( alphanum / "-" ) alphanum ) 1273 alphanum = ALPHA / DIGIT 1275 explain-string = *( macro-string / SP ) 1277 macro-string = *( macro-expand / macro-literal ) 1278 macro-expand = ( "%{" macro-letter transformers *delimiter "}" ) 1279 / "%%" / "%_" / "%-" 1280 macro-literal = %x21-24 / %x26-7E 1281 ; visible characters except "%" 1282 macro-letter = "s" / "l" / "o" / "d" / "i" / "p" / "h" / 1283 "c" / "r" / "t" / "v" 1284 transformers = *DIGIT [ "r" ] 1285 delimiter = "." / "-" / "+" / "," / "/" / "_" / "=" 1287 The "toplabel" construction is subject to the LDH rule plus 1288 additional top-level domain (TLD) restrictions. See Section 2 of 1289 [RFC3696] for background. 1291 Some special cases: 1293 o A literal "%" is expressed by "%%". 1295 o "%_" expands to a single " " space. 1297 o "%-" expands to a URL-encoded space, viz., "%20". 1299 7.2. Macro Definitions 1301 The following macro letters are expanded in term arguments: 1303 s = 1304 l = local-part of 1305 o = domain of 1306 d = 1307 i = 1308 p = the validated domain name of (do not use) 1309 v = the string "in-addr" if is ipv4, or "ip6" if is ipv6 1310 h = HELO/EHLO domain 1312 , , and are defined in Section 2.4. 1314 The following macro letters are allowed only in "exp" text: 1316 c = SMTP client IP (easily readable format) 1317 r = domain name of host performing the check 1318 t = current timestamp 1320 7.3. Notes 1322 A '%' character not followed by a '{', '%', '-', or '_' character is 1323 a syntax error. So: 1325 -exists:%(ir).sbl.spamhaus.example.org 1327 is incorrect and will cause check_host() to yield a "permerror". 1328 Instead, the following is legal: 1330 -exists:%{ir}.sbl.spamhaus.example.org 1332 Optional transformers are the following: 1334 *DIGIT = zero or more digits 1335 r = reverse value, splitting on dots by default 1337 If transformers or delimiters are provided, the replacement value for 1338 a macro letter is split into parts separated by one or more of the 1339 specified delimiter characters. After performing any reversal 1340 operation and/or removal of left-hand parts, the parts are rejoined 1341 using "." and not the original splitting characters. 1343 By default, strings are split on "." (dots). Note that no special 1344 treatment is given to leading, trailing, or consecutive delimiters in 1345 input strings, and so the list of parts might contain empty strings. 1346 Some older implementations of SPF prohibit trailing dots in domain 1347 names, so trailing dots SHOULD NOT be published by domain owners, 1348 although they MUST be accepted by implementations conforming to this 1349 document. Macros can specify delimiter characters that are used 1350 instead of ".". 1352 The "r" transformer indicates a reversal operation: if the client IP 1353 address were 192.0.2.1, the macro %{i} would expand to "192.0.2.1" 1354 and the macro %{ir} would expand to "1.2.0.192". 1356 The DIGIT transformer indicates the number of right-hand parts to 1357 use, after optional reversal. If a DIGIT is specified, the value 1358 MUST be nonzero. If no DIGITs are specified, or if the value 1359 specifies more parts than are available, all the available parts are 1360 used. If the DIGIT was 5, and only 3 parts were available, the macro 1361 interpreter would pretend the DIGIT was 3. Implementations MUST 1362 support at least a value of 128, as that is the maximum number of 1363 labels in a domain name. 1365 The "s" macro expands to the argument. It is an email 1366 address with a local-part, an "@" character, and a domain. The "l" 1367 macro expands to just the local-part. The "o" macro expands to just 1368 the domain part. Note that these values remain the same during 1369 recursive and chained evaluations due to "include" and/or "redirect". 1370 Note also that if the original had no local-part, the local- 1371 part was set to "postmaster" in initial processing (see Section 4.3). 1373 For IPv4 addresses, both the "i" and "c" macros expand to the 1374 standard dotted-quad format. 1376 For IPv6 addresses, the "i" macro expands to a dot-format address; it 1377 is intended for use in %{ir}. The "c" macro can expand to any of the 1378 hexadecimal colon-format addresses specified in [RFC4291], Section 1379 2.2. It is intended for humans to read. 1381 The "p" macro expands to the validated domain name of . The 1382 procedure for finding the validated domain name is defined in 1383 Section 5.5. If the is present in the list of validated 1384 domains, it SHOULD be used. Otherwise, if a subdomain of the 1385 is present, it SHOULD be used. Otherwise, any name from the 1386 list can be used. If there are no validated domain names or if a DNS 1387 error occurs, the string "unknown" is used. This macro SHOULD NOT be 1388 used. See Section 5.5 for the discussion about why not. 1390 The "h" macro expands to the parameter that was provided to the SMTP 1391 server via the HELO or EHLO SMTP verb. For sessions where that verb 1392 was provide more than once, the most recent instance is used. 1394 The "r" macro expands to the name of the receiving MTA. This SHOULD 1395 be a fully qualified domain name, but if one does not exist (as when 1396 the checking is done by a MUA) or if policy restrictions dictate 1397 otherwise, the word "unknown" SHOULD be substituted. The domain name 1398 can be different from the name found in the MX record that the client 1399 MTA used to locate the receiving MTA. 1401 The "t" macro expands to the decimal representation of the 1402 approximate number of seconds since the Epoch (Midnight, January 1, 1403 1970, UTC) at the time of the evaluation. This is the same value as 1404 is returned by the POSIX time() function in most standards-compliant 1405 libraries. 1407 When the result of macro expansion is used in a domain name query, if 1408 the expanded domain name exceeds 253 characters (the maximum length 1409 of a domain name), the left side is truncated to fit, by removing 1410 successive domain labels (and their following dots) until the total 1411 length does not exceed 253 characters. 1413 Uppercased macros expand exactly as their lowercased equivalents, and 1414 are then URL escaped. URL escaping MUST be performed for characters 1415 not in the "unreserved" set, which is defined in [RFC3986]. 1417 Note: Care has to be taken by the sending ADMD so that macro 1418 expansion for legitimate email does not exceed the 63-character limit 1419 on DNS labels. The local-part of email addresses, in particular, can 1420 have more than 63 characters between dots. 1422 Note: To minimize DNS lookup resource requirements, it is better if 1423 sending ADMDs avoid using the "s", "l", "o", or "h" macros in 1424 conjunction with any mechanism directive. Although these macros are 1425 powerful and allow per-user records to be published, they severely 1426 limit the ability of implementations to cache results of check_host() 1427 and they reduce the effectiveness of DNS caches. 1429 Note: If no directive processed during the evaluation of check_host() 1430 contains an "s", "l", "o", or "h" macro, then the results of the 1431 evaluation can be cached on the basis of and alone for 1432 as long as the shortest Time To Live (TTL) of all the DNS records 1433 involved. 1435 7.4. Expansion Examples 1437 The is strong-bad@email.example.com. 1438 The IPv4 SMTP client IP is 192.0.2.3. 1439 The IPv6 SMTP client IP is 2001:DB8::CB01. 1440 The PTR domain name of the client IP is mx.example.org. 1442 macro expansion 1443 ------- ---------------------------- 1444 %{s} strong-bad@email.example.com 1445 %{o} email.example.com 1446 %{d} email.example.com 1447 %{d4} email.example.com 1448 %{d3} email.example.com 1449 %{d2} example.com 1450 %{d1} com 1451 %{dr} com.example.email 1452 %{d2r} example.email 1453 %{l} strong-bad 1454 %{l-} strong.bad 1455 %{lr} strong-bad 1456 %{lr-} bad.strong 1457 %{l1r-} strong 1459 macro-string expansion 1460 -------------------------------------------------------------------- 1461 %{ir}.%{v}._spf.%{d2} 3.2.0.192.in-addr._spf.example.com 1462 %{lr-}.lp._spf.%{d2} bad.strong.lp._spf.example.com 1464 %{lr-}.lp.%{ir}.%{v}._spf.%{d2} 1465 bad.strong.lp.3.2.0.192.in-addr._spf.example.com 1467 %{ir}.%{v}.%{l1r-}.lp._spf.%{d2} 1468 3.2.0.192.in-addr.strong.lp._spf.example.com 1470 %{d2}.trusted-domains.example.net 1471 example.com.trusted-domains.example.net 1473 IPv6: 1474 %{ir}.%{v}._spf.%{d2} 1.0.B.C.0.0.0.0. 1475 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 1477 8. Result Handling 1479 This section provides guidance for operators in response to the 1480 various possible outputs of check_host() on a message. Terse 1481 definitions of SPF results are presented in Section 2.6; this section 1482 provides more detail on each for use in developing local policy for 1483 message handling. 1485 Every operating environment is different. There are some receivers 1486 for whom strict adherence to SPF is appropriate, and definitive 1487 treatment of messages that are evaluated to be explicity unauthorized 1488 ("fail" and sometimes "softfail") is the norm. There are others for 1489 which the "false negative" cases are more of a concern. This concern 1490 is typically handled by merely recording the result in the header and 1491 allowing the message to pass on for additional processing. There are 1492 still others where SPF is one of several inputs to the message 1493 handling decision. As such, there is no normative requirement for 1494 message handling in response to any particular result. This section 1495 is provided to present a complete picture of the likely cause of each 1496 result, and where available, the experience gained during 1497 experimental deployment. 1499 There are essentially two classes of handling choices: 1501 o Handling within the SMTP session that attempted to deliver the 1502 message, such as by returning a permanent SMTP error (rejection) 1503 or temporary SMTP error ("try again later"); 1505 o Permitting the message to pass (a successful SMTP reply code) and 1506 adding an additional header field that indicates the result 1507 returned by check_host() and other salient details; this is 1508 discussed in more detail in Section 9. 1510 8.1. None 1512 With a "none" result, the SPF verifier has no information at all 1513 about the authorization or lack thereof of the client to use the 1514 checked idenity or identities. The check_host() function completed 1515 without errors but was not able to reach any conclusion. 1517 8.2. Neutral 1519 A "neutral" result indicates that although a policy for the identity 1520 was discovered, there is no definite assertion about the (positive or 1521 negative) about the client. 1523 A "neutral" result MUST be treated exactly like the "none" result; 1524 the distinction exists only for informational purposes. Treating 1525 "neutral" more harshly than "none" would discourage domain owners 1526 from testing the use of SPF records (see Section 10.1). 1528 8.3. Pass 1530 A "pass" result means that the client is authorized to inject mail 1531 with the given identity. The domain can now, in the sense of 1532 reputation, be considered responsible for sending the message. 1533 Further policy checks can now proceed with confidence in the 1534 legitimate use of the identity. This is further discussed in 1535 Appendix H.1. 1537 8.4. Fail 1539 A "fail" result is an explicit statement that the client is not 1540 authorized to use the domain in the given identity. Disposition of 1541 SPF fail messages is a matter of local policy. See Appendix H.2 for 1542 considerations on developing local policy. 1544 If the checking software chooses to reject the mail during the SMTP 1545 transaction, then it SHOULD use an SMTP reply code of 550 (see 1546 [RFC5321]) and, if supported, the 5.7.1 enhanced status code (see 1547 [RFC3463]), in addition to an appropriate reply text. The 1548 check_host() function will return either a default explanation string 1549 or one from the domain that published the SPF records (see 1550 Section 6.2). If the information does not originate with the 1551 checking software, it is good to make it clear that the text is 1552 provided by the sender's domain. For example: 1554 550-5.7.1 SPF MAIL FROM check failed: 1555 550-5.7.1 The domain example.com explains: 1556 550 5.7.1 Please see http://www.example.com/mailpolicy.html 1558 If the checking software chooses not to reject the mail during the 1559 SMTP transaction, then it SHOULD add a Received-SPF or 1560 Authentication-Results header field (see Section 9) to communicate 1561 this result to downstream message processors. While this is true for 1562 all SPF results, it is of particular importance for "fail" results 1563 since the message is explicitly not authorized by the domain owner. 1565 8.5. Softfail 1567 A "softfail" result ought to be treated as somewhere between "fail" 1568 and "neutral"/"none". The domain owner believes the host is not 1569 authorized but is not willing to make a strong policy statement. 1570 Receiving software SHOULD NOT reject the message based solely on this 1571 result, but MAY subject the message to closer scrutiny than normal. 1573 The domain owner wants to discourage the use of this host and thus 1574 desires limited feedback when a "softfail" result occurs. For 1575 example, the recipient's Mail User Agent (MUA) could highlight the 1576 "softfail" status, or the receiving MTA could give the sender a 1577 message using greylisting, [RFC6647], with a note the first time the 1578 message is received, but accept it on a later attempt based on 1579 receiver policy. 1581 8.6. Temperror 1583 A "temperror" result means the SPF verifier encountered a transient 1584 (generally DNS) error while performing the check. Checking software 1585 can choose to accept or temporarily reject the message. If the 1586 message is rejected during the SMTP transaction for this reason, the 1587 software SHOULD use an SMTP reply code of 451 and, if supported, the 1588 4.4.3 enhanced status code. These errors can be caused by problems 1589 in either the sender's or receiver's DNS software. 1591 8.7. Permerror 1593 A "permerror" result means the domain's published records could not 1594 be correctly interpreted. This signals an error condition that 1595 definitely requires manual intervention to be resolved. If the 1596 message is rejected during the SMTP transaction for this reason, the 1597 software SHOULD use an SMTP reply code of 550 and, if supported, the 1598 5.5.2 enhanced status code. Be aware that if the domain owner uses 1599 macros (Section 7), it is possible that this result is due to the 1600 checked identities having an unexpected format. It is also possible 1601 that this result is generated by certain SPF clients due to the input 1602 arguments having an unexpected format; see Section 4.8. 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 document will have on various entities involved in Internet email. 1750 It is intended to make clear to the reader where this document 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 SHOULD do in light of this 1754 document. 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 required 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 +----------+--------+-----------------+ 1780 | term | cost | limit | 1781 +----------+--------+-----------------+ 1782 | ip4/ip6 | 0 | - | 1783 | a | 1 | 10 | 1784 | include | 1 | 10 | 1785 | redirect | 1 | 10 | 1786 | exists | 1 | 10 | 1787 | mx | 1 + N* | 10 and N* <= 10 | 1788 | ptr/%{p} | 1 + N* | 10 and N* <= 10 | 1789 | all | 0 | - | 1790 +----------+--------+-----------------+ 1791 * N is the number of RRs found during each term evaluation 1793 Section 4.6.4 specifies the limits receivers have to use. It is 1794 essential to publish records that do not exceed these requirements. 1795 It is also required to carefully weight the cost and the 1796 maintainability of licit solutions. 1798 For example, consider a domain set up as follows: 1800 example.com. IN MX 10 mx.example.com. 1801 IN MX 20 mx2.example.com. 1802 mx.example.com. IN A 192.0.2.1 1803 mx2.example.com. IN A 192.0.2.129 1805 Assume the administrative point is to authorize (pass) mx and mx2 1806 while failing every other host. Compare the following solutions: 1808 Best record: 1809 example.com. IN TXT "v=spf1 ip4:192.0.2.1 ip4:192.0.2.129 -all" 1811 Good record: 1812 $ORIGIN example.com. 1813 @ IN TXT "v=spf1 a:authorized-spf.example.com -all" 1814 authorized-spf IN A 192.0.2.1 1815 IN A 192.0.2.129 1817 Expensive record: 1818 example.com. IN TXT "v=spf1 mx:example.com -all" 1820 Wasteful, bad record: 1821 example.com. IN TXT "v=spf1 ip4:192.0.2.0/24 mx -all" 1823 10.1.2. Administrator's Considerations 1825 There might be administrative considerations: using "a" over "ip4" or 1826 "ip6" allows hosts to be renumbered easily. Using "mx" over "a" 1827 allows the set of mail hosts to be changed easily. Unless such 1828 changes are common, it is better to use the less resource intensive 1829 mechanisms like "ip4" and "ip6" over "a" or "a" or "mx". 1831 In some specific cases, standard advice on record content is 1832 appropriate. Publishing SPF records for domains that send no mail is 1833 a well established best practice. The record for a domain that sends 1834 no mail is: 1836 www.example.com. IN TXT "v=spf1 -all" 1838 Publishing SPF records for individual hosts is also best practice. 1840 The hostname is generally the identity used in the 5321.HELO/.EHLO 1841 command. In the case of messages with a null 5321.MailFrom, this is 1842 used as the domain for 5321.MailFrom SPF checks, in addition to being 1843 used in 5321.HELO/.EHLO based SPF checks. The standard SPF record 1844 for an individual host that is involved in mail processing is: 1846 relay.example.com. IN TXT "v=spf1 a -all" 1848 Validating correct deployment is difficult. [RFC6652] describes one 1849 mechanism for soliciting feedback on SPF failures. Another 1850 suggestion can be found in Appendix D. 1852 Regardless of the method used, understanding the ADMD's outbound mail 1853 architecture is essential to effective deployment. 1855 10.1.3. Bounces 1857 As explained in Section 1.1.3, [RFC5321] allows the reverse-path to 1858 be null, which is typical of some Delivery Status Notification 1859 [RFC3464], commonly called email bounces. In this case the only 1860 entity available for performing an SPF check is the "HELO" identity 1861 defined in Section 1.1.4. SPF functionality is enhanced by 1862 administrators ensuring this identity is set correctly and has an 1863 appropriate SPF record. It is normal to have the HELO identity set 1864 to hostname instead of domain. Zone file generation for significant 1865 numbers of hosts can be consolidated using the redirect modifier and 1866 scripted for initial deployment. Specific deployment advice is given 1867 above in Section 10.1.2. 1869 10.2. Receivers 1871 SPF results can be used in combination with other methods to 1872 determine the final local disposition (either positive or negative of 1873 a message. It can also be considered dispositive on its own. 1875 An attempt to have one organization (sender) direct the email 1876 handling policies of another (receiver) is inherently challenging and 1877 often controversial. As stated elsewhere in this document, there is 1878 no normative requirement for specific handling of a message based on 1879 any SPF result. The information presented in Section 8 and in 1880 Appendix H is offered for receiver consideration when forming local 1881 handling policies. 1883 The primary considerations are that SPF might return "pass" for mail 1884 that is ultimately harmful (e.g., spammers that arrange for SPF to 1885 pass using nonsense domain names, or virus or spam outbreaks from 1886 within trusted sources), and might also return "fail" for mail that 1887 is ultimately legitimate (e.g., legitimate mail that has traversed a 1888 mail alias). It is important take both of these cases under 1889 consideration when establishing local handling policy. 1891 10.3. Mediators 1893 Mediators are a type of User actor.[RFC5598]. That is, a mediator 1894 takes 'delivery' of a message and posts a 'submission' of a new 1895 message. The mediator can make the newly-posted message be as 1896 similar or as different from the original message as they wish. 1897 Examples include mailing lists (see [RFC5598] Section 5.3) and 1898 ReSenders ([RFC5598] Section 5.2). This is discussed in [RFC5321], 1899 Section 3.9. For the operation of SPF, the essential concern is the 1900 email address in the 5321.MailFrom command for the new message. 1902 Because SPF evaluation is based on the IP Address of the "last" 1903 sending SMTP server, the address of the mediator will be used, rather 1904 than the address of the SMTP server that sent the message to the 1905 mediator. Some mediators retain the email address from the original 1906 message, while some use a new address. 1908 If the address is the same as for the original message, and the 1909 original message had an associated SPF record, then the SPF 1910 evaluation will fail unless mitigations such as those described in 1911 Appendix E are used. 1913 11. Security Considerations 1915 11.1. Processing Limits 1917 As with most aspects of email, there are a number of ways that 1918 malicious parties could use the protocol as an avenue for a 1919 Denial-of-Service (DoS) attack. The processing limits outlined in 1920 Section 4.6.4 are designed to prevent attacks such as the following: 1922 o A malicious party could create an SPF record with many references 1923 to a victim's domain and send many emails to different SPF 1924 verifiers; those SPF verifiers would then create a DoS attack. In 1925 effect, the SPF verifiers are being used to amplify the attacker's 1926 bandwidth by using fewer bytes in the SMTP session than are used 1927 by the DNS queries. Using SPF clients also allows the attacker to 1928 hide the true source of the attack. 1930 o Whereas implementations of check_host() are supposed to limit the 1931 number of DNS lookups, malicious domains could publish records 1932 that exceed these limits in an attempt to waste computation effort 1933 at their targets when they send them mail. Malicious domains 1934 could also design SPF records that cause particular 1935 implementations to use excessive memory or CPU usage, or to 1936 trigger bugs. 1938 o Malicious parties could send a large volume of mail purporting to 1939 come from the intended target to a wide variety of legitimate mail 1940 hosts. These legitimate machines would then present a DNS load on 1941 the target as they fetched the relevant records. 1943 o Malicious parties could, in theory, use SPF records as a vehicle 1944 for DNS lookup amplification for a denial-of-service-attack. In 1945 this scenario, the attacker publishes an SPF record in its own DNS 1946 that uses "a" and "mx" mechanisms directed toward the intended 1947 victim, e.g. "a:example.com a:foo.example.com a:bar.example.com 1948 ..." and then distributes mail with a MAIL FROM value including 1949 its own domain in large volume to a wide variety of destinations. 1950 Any such destination operating an SPF verifier will begin querying 1951 all of the names associated with the "a" mechanisms in that 1952 record. The names used in the record needn't exist for the attack 1953 to be effective. Operational experience since publication of 1954 [RFC4408] suggests that mitigation of this class of attack can be 1955 accomplished with minimal impact on the deployed base by having 1956 the verifier abort processing and return "permerror" 1957 (Section 2.6.7) once more than two "void lookups" have been 1958 encountered (defined in Section 4.6.4. 1960 Of these, the case of a third party referenced in the SPF record is 1961 the easiest for a DoS attack to effectively exploit. As a result, 1962 limits that might seem reasonable for an individual mail server can 1963 still allow an unreasonable amount of bandwidth amplification. 1964 Therefore, the processing limits need to be quite low. 1966 11.2. SPF-Authorized Email May Contain Other False Identities 1968 Do not construe the "MAIL FROM" and "HELO" identity authorizations to 1969 provide more assurance than they do. It is entirely possible for a 1970 malicious sender to inject a message using his own domain in the 1971 identities used by SPF, to have that domain's SPF record authorize 1972 the sending host, and yet the message can easily list other 1973 identities in its header. Unless the user or the MUA takes care to 1974 note that the authorized identity does not match the other more 1975 commonly-presented identities (such as the From: header field), the 1976 user might be lulled into a false sense of security. 1978 11.3. Spoofed DNS and IP Data 1980 There are two aspects of this protocol that malicious parties could 1981 exploit to undermine the validity of the check_host() function: 1983 o The evaluation of check_host() relies heavily on DNS. A malicious 1984 attacker could attack the DNS infrastructure and cause 1985 check_host() to see spoofed DNS data, and then return incorrect 1986 results. This could include returning "pass" for an value 1987 where the actual domain's record would evaluate to "fail". See 1988 [RFC3833] for a description of DNS weaknesses. 1990 o The client IP address, , is assumed to be correct. In a 1991 modern, correctly configured system the risk of this not being 1992 true is nil. 1994 11.4. Cross-User Forgery 1996 By definition, SPF policies just map domain names to sets of 1997 authorized MTAs, not whole email addresses to sets of authorized 1998 users. Although the "l" macro (Section 7) provides a limited way to 1999 define individual sets of authorized MTAs for specific email 2000 addresses, it is generally impossible to verify, through SPF, the use 2001 of specific email addresses by individual users of the same MTA. 2003 It is up to mail services and their MTAs to directly prevent 2004 cross-user forgery: based on SMTP AUTH ([RFC4954]), users have to be 2005 restricted to using only those email addresses that are actually 2006 under their control (see [RFC6409], Section 6.1). Another means to 2007 verify the identity of individual users is message cryptography such 2008 as PGP ([RFC4880]) or S/MIME ([RFC5751]). 2010 11.5. Untrusted Information Sources 2012 An SPF compliant receiver gathers information from the SMTP commands 2013 it receives and from the published DNS records of the sending domain 2014 holder, (e.g., "HELO" domain name, the "MAIL FROM" address from the 2015 envelope, and SPF DNS records published by the domain holder). 2017 11.5.1. Recorded Results 2019 This information, passed to the receiver in the Received-SPF: or 2020 Authentication-Results: trace fields, may be returned to the client 2021 MTA as an SMTP rejection message. If such an SMTP rejection message 2022 is generated, the information from the trace fields has to be checked 2023 for such problems as invalid characters and excessively long lines. 2025 11.5.2. External Explanations 2027 When the authorization check fails, an explanation string could be 2028 included in the reject response. Both the sender and the rejecting 2029 receiver need to be aware that the explanation was determined by the 2030 publisher of the SPF record checked and, in general, not the 2031 receiver. The explanation can contain malicious URLs, or it might be 2032 offensive or misleading. 2034 Explanations returned to sender domains due to "exp" modifiers, 2035 (Section 6.2), were generated by the sender policy published by the 2036 domain holders themselves. As long as messages are only returned 2037 with non-delivery notification ([RFC3464]) to domains publishing the 2038 explanation strings from their own DNS SPF records, the only affected 2039 parties are the original publishers of the domain's SPF records. 2041 In practice, such non-delivery notifications can be misdirected, such 2042 as when an MTA accepts an email and only later generates the 2043 notification to a forged address, or when an email forwarder does not 2044 direct the bounce back to the original sender. 2046 11.5.3. Macro Expansion 2048 Macros (Section 7) allow senders to inject arbitrary text (any non- 2049 null [US-ASCII] character) into receiver DNS queries. It is necesary 2050 to be prepared for hostile or unexpected content. 2052 11.6. Privacy Exposure 2054 Checking SPF records causes DNS queries to be sent to the domain 2055 owner. These DNS queries, especially if they are caused by the 2056 "exists" mechanism, can contain information about who is sending 2057 email and likely to which MTA the email is being sent. This can 2058 introduce some privacy concerns, which are more or less of an issue 2059 depending on local laws and the relationship between the domain owner 2060 and the person sending the email. 2062 11.7. Delivering Mail Producing a 'Fail' Result 2064 Operators that choose to deliver mail for which SPF produces a "fail" 2065 result need to understand that they are admitting content that is 2066 explicitly not authorized by the purported sender. While there are 2067 known failure modes that can be considered "false negatives", the 2068 distinct choice to admit those messages increases end-user exposure 2069 to likely harm. This is especially true for domains belonging to 2070 known good actors that are typically well-behaved; unauthorized mail 2071 from those sources might well be subjected to much higher skepticism 2072 and content analysis. 2074 SPF does not, however, include the capacity for identifying good 2075 actors from bad ones, nor does it handle the concept of known actors 2076 versus unknown ones. Those notions are out of scope for this 2077 specification. 2079 12. Contributors and Acknowledgements 2081 This document is largely based on the work of Meng Weng Wong, Mark 2082 Lentczner, and Wayne Schlitt. Although, as this section 2083 acknowledges, many people have contributed to this document, a very 2084 large portion of the writing and editing are due to Meng, Mark, and 2085 Wayne. 2087 This design owes a debt of parentage to [RMX] by Hadmut Danisch and 2088 to [DMP] by Gordon Fecyk. The idea of using a DNS record to check 2089 the legitimacy of an email address traces its ancestry further back 2090 through messages on the namedroppers mailing list by Paul Vixie 2091 [Vixie] (based on suggestion by Jim Miller) and by David Green 2092 [Green]. 2094 Philip Gladstone contributed the concept of macros to the 2095 specification, multiplying the expressiveness of the language and 2096 making per-user and per-IP lookups possible. 2098 The authors of both this document and [RFC4408] would also like to 2099 thank the literally hundreds of individuals who have participated in 2100 the development of this design. They are far too numerous to name, 2101 but they include the following: 2103 The participants in the SPFbis working group. 2104 The folks on the spf-discuss mailing list. 2105 The folks on the SPAM-L mailing list. 2106 The folks on the IRTF ASRG mailing list. 2107 The folks on the IETF MARID mailing list. 2108 The folks on #perl. 2110 13. IANA Considerations 2112 13.1. The SPF DNS Record Type 2114 Per [RFC4408], the IANA assigned the Resource Record Type and Qtype 2115 from the DNS Parameters Registry for the SPF RR type with code 99. 2116 The format of this type is identical to the TXT RR [RFC1035]. The 2117 character content of the record is encoded as [US-ASCII]. Use of 2118 this record type is obsolete for SPF Version 1. 2120 IANA is requested to add an annotation to the SPF RRTYPE saying 2121 "(OBSOLETE - use TXT)" in the DNS Parameters registry. 2123 [NOTE TO RFC EDITOR: (to be changed to " ... has added ..." upon 2124 publication)] 2126 13.2. The Received-SPF Mail Header Field 2128 Per [RFC3864], the "Received-SPF:" header field is added to the IANA 2129 Permanent Message Header Field Registry. The following is the 2130 registration template: 2132 Header field name: Received-SPF 2133 Applicable protocol: mail ([RFC5322]) 2134 Status: Standards Track 2135 Author/Change controller: IETF 2136 Specification document(s): RFC XXXX 2137 [NOTE TO RFC EDITOR: (this document)] 2139 13.3. SPF Modifier Registration 2141 [RFC6652] created a new SPF Modifier Registration. IANA is requested 2142 to change the reference for the exp and redirect modifiers from 2143 [RFC4408] to this document. Their status should not be changed. 2145 14. References 2147 14.1. Normative References 2149 [RFC1035] Mockapetris, P., "Domain names - implementation and 2150 specification", STD 13, RFC 1035, November 1987. 2152 [RFC1123] Braden, R., "Requirements for Internet Hosts - Application 2153 and Support", STD 3, RFC 1123, October 1989. 2155 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2156 Requirement Levels", BCP 14, RFC 2119, March 1997. 2158 [RFC3463] Vaudreuil, G., "Enhanced Mail System Status Codes", 2159 RFC 3463, January 2003. 2161 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 2162 Procedures for Message Header Fields", BCP 90, RFC 3864, 2163 September 2004. 2165 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 2166 Resource Identifier (URI): Generic Syntax", STD 66, 2167 RFC 3986, January 2005. 2169 [RFC4291] Hinden, R. and S. Deering, "IP Version 6 Addressing 2170 Architecture", RFC 4291, February 2006. 2172 [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax 2173 Specifications: ABNF", STD 68, RFC 5234, January 2008. 2175 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 2176 October 2008. 2178 [RFC5322] Resnick, P., Ed., "Internet Message Format", RFC 5322, 2179 October 2008. 2181 [RFC5451] Kucherawy, M., "Message Header Field for Indicating 2182 Message Authentication Status", RFC 5451, April 2009. 2184 [RFC5598] Crocker, D., "Internet Mail Architecture", RFC 5598, 2185 July 2009. 2187 [RFC5890] Klensin, J., "Internationalized Domain Names for 2188 Applications (IDNA): Definitions and Document Framework", 2189 RFC 5890, August 2010. 2191 [US-ASCII] 2192 American National Standards Institute (formerly United 2193 States of America Standards Institute), "USA Code for 2194 Information Interchange, X3.4", 1968. 2196 ANSI X3.4-1968 has been replaced by newer versions with 2197 slight modifications, but the 1968 version remains 2198 definitive for the Internet. 2200 14.2. Informative References 2202 [DMP] Fecyk, G., "Designated Mailers Protocol". 2204 Work In Progress 2206 [Green] Green, D., "Domain-Authorized SMTP Mail", 2002. 2208 [RFC1034] Mockapetris, P., "Domain names - concepts and facilities", 2209 STD 13, RFC 1034, November 1987. 2211 [RFC1983] Malkin, G., "Internet Users' Glossary", RFC 1983, 2212 August 1996. 2214 [RFC2308] Andrews, M., "Negative Caching of DNS Queries (DNS 2215 NCACHE)", RFC 2308, March 1998. 2217 [RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for 2218 specifying the location of services (DNS SRV)", RFC 2782, 2219 February 2000. 2221 [RFC3464] Moore, K. and G. Vaudreuil, "An Extensible Message Format 2222 for Delivery Status Notifications", RFC 3464, 2223 January 2003. 2225 [RFC3696] Klensin, J., "Application Techniques for Checking and 2226 Transformation of Names", RFC 3696, February 2004. 2228 [RFC3833] Atkins, D. and R. Austein, "Threat Analysis of the Domain 2229 Name System (DNS)", RFC 3833, August 2004. 2231 [RFC3834] Moore, K., "Recommendations for Automatic Responses to 2232 Electronic Mail", RFC 3834, August 2004. 2234 [RFC4408] Wong, M. and W. Schlitt, "Sender Policy Framework (SPF) 2235 for Authorizing Use of Domains in E-Mail, Version 1", 2236 RFC 4408, April 2006. 2238 [RFC4632] Fuller, V. and T. Li, "Classless Inter-domain Routing 2239 (CIDR): The Internet Address Assignment and Aggregation 2240 Plan", BCP 122, RFC 4632, August 2006. 2242 [RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R. 2243 Thayer, "OpenPGP Message Format", RFC 4880, November 2007. 2245 [RFC4954] Siemborski, R. and A. Melnikov, "SMTP Service Extension 2246 for Authentication", RFC 4954, July 2007. 2248 [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet 2249 Mail Extensions (S/MIME) Version 3.2 Message 2250 Specification", RFC 5751, January 2010. 2252 [RFC6409] Gellens, R. and J. Klensin, "Message Submission for Mail", 2253 STD 72, RFC 6409, November 2011. 2255 [RFC6647] Kucherawy, M. and D. Crocker, "Email Greylisting: An 2256 Applicability Statement for SMTP", RFC 6647, June 2012. 2258 [RFC6648] Saint-Andre, P., Crocker, D., and M. Nottingham, 2259 "Deprecating the "X-" Prefix and Similar Constructs in 2260 Application Protocols", BCP 178, RFC 6648, June 2012. 2262 [RFC6652] Kitterman, S., "Sender Policy Framework (SPF) 2263 Authentication Failure Reporting Using the Abuse Reporting 2264 Format", RFC 6652, June 2012. 2266 [RFC6686] Kucherawy, M., "Resolution of the Sender Policy Framework 2267 (SPF) and Sender ID Experiments", RFC 6686, July 2012. 2269 [RMX] Danisch, H., "The RMX DNS RR Type for light weight sender 2270 authentication". 2272 Work In Progress 2274 [Vixie] Vixie, P., "Repudiating MAIL FROM", 2002. 2276 Appendix A. Collected ABNF 2278 This section is normative and any discrepancies with the ABNF 2279 fragments in the preceding text are to be resolved in favor of this 2280 grammar. 2282 See [RFC5234] for ABNF notation. Please note that as per this ABNF 2283 definition, literal text strings (those in quotes) are case- 2284 insensitive. Hence, "mx" matches "mx", "MX", "mX", and "Mx". 2286 record = version terms *SP 2287 version = "v=spf1" 2289 terms = *( 1*SP ( directive / modifier ) ) 2291 directive = [ qualifier ] mechanism 2292 qualifier = "+" / "-" / "?" / "~" 2293 mechanism = ( all / include 2294 / A / MX / PTR / IP4 / IP6 / exists ) 2296 all = "all" 2297 include = "include" ":" domain-spec 2298 A = "a" [ ":" domain-spec ] [ dual-cidr-length ] 2299 MX = "mx" [ ":" domain-spec ] [ dual-cidr-length ] 2300 PTR = "ptr" [ ":" domain-spec ] 2301 IP4 = "ip4" ":" ip4-network [ ip4-cidr-length ] 2302 IP6 = "ip6" ":" ip6-network [ ip6-cidr-length ] 2303 exists = "exists" ":" domain-spec 2305 modifier = redirect / explanation / unknown-modifier 2306 redirect = "redirect" "=" domain-spec 2307 explanation = "exp" "=" domain-spec 2308 unknown-modifier = name "=" macro-string 2309 ; where name is not any known modifier 2311 ip4-cidr-length = "/" 1*DIGIT 2312 ip6-cidr-length = "/" 1*DIGIT 2313 dual-cidr-length = [ ip4-cidr-length ] [ "/" ip6-cidr-length ] 2315 ip4-network = qnum "." qnum "." qnum "." qnum 2316 qnum = DIGIT ; 0-9 2317 / %x31-39 DIGIT ; 10-99 2318 / "1" 2DIGIT ; 100-199 2319 / "2" %x30-34 DIGIT ; 200-249 2320 / "25" %x30-35 ; 250-255 2321 ; conventional dotted quad notation. e.g., 192.0.2.0 2322 ip6-network = 2323 ; e.g., 2001:DB8::CD30 2325 domain-spec = macro-string domain-end 2326 domain-end = ( "." toplabel [ "." ] ) / macro-expand 2328 toplabel = ( *alphanum ALPHA *alphanum ) / 2329 ( 1*alphanum "-" *( alphanum / "-" ) alphanum ) 2330 ; LDH rule plus additional TLD restrictions 2331 ; (see [RFC3696], Section 2 for background) 2332 alphanum = ALPHA / DIGIT 2334 explain-string = *( macro-string / SP ) 2336 macro-string = *( macro-expand / macro-literal ) 2337 macro-expand = ( "%{" macro-letter transformers *delimiter "}" ) 2338 / "%%" / "%_" / "%-" 2339 macro-literal = %x21-24 / %x26-7E 2340 ; visible characters except "%" 2341 macro-letter = "s" / "l" / "o" / "d" / "i" / "p" / "h" / 2342 "c" / "r" / "t" / "v" 2343 transformers = *DIGIT [ "r" ] 2344 delimiter = "." / "-" / "+" / "," / "/" / "_" / "=" 2346 name = ALPHA *( ALPHA / DIGIT / "-" / "_" / "." ) 2348 header-field = "Received-SPF:" [CFWS] result FWS [comment FWS] 2349 [ key-value-list ] CRLF 2351 result = "pass" / "fail" / "softfail" / "neutral" / 2352 "none" / "temperror" / "permerror" 2354 key-value-list = key-value-pair *( ";" [CFWS] key-value-pair ) 2355 [";"] 2357 key-value-pair = key [CFWS] "=" ( dot-atom / quoted-string ) 2359 key = "client-ip" / "envelope-from" / "helo" / 2360 "problem" / "receiver" / "identity" / 2361 "mechanism" / name 2363 identity = "mailfrom" ; for the "MAIL FROM" identity 2364 / "helo" ; for the "HELO" identity 2365 / name ; other identities 2367 ALPHA = 2368 DIGIT = <0-9 as per [RFC5234]> 2369 SP = 2370 domain = 2371 dot-atom = 2372 quoted-string = 2373 comment = 2374 CFWS = 2375 FWS = 2376 CRLF = 2377 authserv-id = 2378 reasonspec = 2380 Appendix B. Extended Examples 2382 These examples are based on the following DNS setup: 2384 ; A domain with two mail servers, two hosts 2385 ; and two servers at the domain name 2386 $ORIGIN example.com. 2387 @ MX 10 mail-a 2388 MX 20 mail-b 2389 A 192.0.2.10 2390 A 192.0.2.11 2391 amy A 192.0.2.65 2392 bob A 192.0.2.66 2393 mail-a A 192.0.2.129 2394 mail-b A 192.0.2.130 2395 www CNAME example.com. 2397 ; A related domain 2398 $ORIGIN example.org. 2399 @ MX 10 mail-c 2400 mail-c A 192.0.2.140 2402 ; The reverse IP for those addresses 2403 $ORIGIN 2.0.192.in-addr.arpa. 2404 10 PTR example.com. 2405 11 PTR example.com. 2406 65 PTR amy.example.com. 2407 66 PTR bob.example.com. 2408 129 PTR mail-a.example.com. 2409 130 PTR mail-b.example.com. 2410 140 PTR mail-c.example.org. 2412 ; A rogue reverse IP domain that claims to be 2413 ; something it's not 2414 $ORIGIN 0.0.10.in-addr.arpa. 2415 4 PTR bob.example.com. 2417 B.1. Simple Examples 2419 These examples show various possible published records for 2420 example.com and which values if would cause check_host() to 2421 return "pass". Note that is "example.com". 2423 v=spf1 +all 2424 -- any passes 2426 v=spf1 a -all 2427 -- hosts 192.0.2.10 and 192.0.2.11 pass 2429 v=spf1 a:example.org -all 2430 -- no sending hosts pass since example.org has no A records 2432 v=spf1 mx -all 2433 -- sending hosts 192.0.2.129 and 192.0.2.130 pass 2435 v=spf1 mx:example.org -all 2436 -- sending host 192.0.2.140 passes 2438 v=spf1 mx mx:example.org -all 2439 -- sending hosts 192.0.2.129, 192.0.2.130, and 192.0.2.140 pass 2441 v=spf1 mx/30 mx:example.org/30 -all 2442 -- any sending host in 192.0.2.128/30 or 192.0.2.140/30 passes 2444 v=spf1 ptr -all 2445 -- sending host 192.0.2.65 passes (reverse DNS is valid and is in 2446 example.com) 2447 -- sending host 192.0.2.140 fails (reverse DNS is valid, but not 2448 in example.com) 2449 -- sending host 10.0.0.4 fails (reverse IP is not valid) 2451 v=spf1 ip4:192.0.2.128/28 -all 2452 -- sending host 192.0.2.65 fails 2453 -- sending host 192.0.2.129 passes 2455 B.2. Multiple Domain Example 2457 These examples show the effect of related records: 2459 example.org: "v=spf1 include:example.com include:example.net -all" 2461 This record would be used if mail from example.org actually came 2462 through servers at example.com and example.net. Example.org's 2463 designated servers are the union of example.com's and example.net's 2464 designated servers. 2466 la.example.org: "v=spf1 redirect=example.org" 2467 ny.example.org: "v=spf1 redirect=example.org" 2468 sf.example.org: "v=spf1 redirect=example.org" 2470 These records allow a set of domains that all use the same mail 2471 system to make use of that mail system's record. In this way, only 2472 the mail system's record needs to be updated when the mail setup 2473 changes. These domains' records never have to change. 2475 B.3. DNSBL Style Example 2477 Imagine that, in addition to the domain records listed above, there 2478 are these: 2480 $ORIGIN _spf.example.com. 2481 mary.mobile-users A 127.0.0.2 2482 fred.mobile-users A 127.0.0.2 2483 15.15.168.192.joel.remote-users A 127.0.0.2 2484 16.15.168.192.joel.remote-users A 127.0.0.2 2486 The following records describe users at example.com who mail from 2487 arbitrary servers, or who mail from personal servers. 2489 example.com: 2491 v=spf1 mx 2492 include:mobile-users._spf.%{d} 2493 include:remote-users._spf.%{d} 2494 -all 2496 mobile-users._spf.example.com: 2498 v=spf1 exists:%{l1r+}.%{d} 2500 remote-users._spf.example.com: 2502 v=spf1 exists:%{ir}.%{l1r+}.%{d} 2504 B.4. Multiple Requirements Example 2506 Say that your sender policy requires both that the IP address is 2507 within a certain range and that the reverse DNS for the IP matches. 2508 This can be done several ways, including the following: 2510 example.com. SPF ( "v=spf1 " 2511 "-include:ip4._spf.%{d} " 2512 "-include:ptr._spf.%{d} " 2513 "+all" ) 2514 ip4._spf.example.com. SPF "v=spf1 -ip4:192.0.2.0/24 +all" 2515 ptr._spf.example.com. SPF "v=spf1 -ptr +all" 2517 This example shows how the "-include" mechanism can be useful, how an 2518 SPF record that ends in "+all" can be very restrictive, and the use 2519 of De Morgan's Law. 2521 Appendix C. Changes in implementation requirements from RFC 4408 2523 The modifications to implmentation requirements from [RFC4408] are 2524 all either (a) corrections to errors in [RFC4408], or (b) additional 2525 documentation based on consensus of operational experience acquired 2526 since publication of [RFC4408]. 2528 o Use of DNS RR type SPF (99) has been removed from the protocol 2529 [RFC6686]. 2531 o A new DNS related processing limit based on "void lookups" has 2532 been added Section 4.6.4. 2534 o A new option for converting repeated DNS SERVFAIL responses from 2535 temperror to permerror as been added Section 2.6.6. 2537 o Use of the ptr mechanism and the %p macro have been strongly 2538 discouraged Section 5.5 and Section 7.2. They remain part of the 2539 protocol because they were found to be in use, but records ought 2540 to be updated to avoid them. 2542 o Use of the "Authentication-Results" header field [RFC5451] as a 2543 possible alternative to use of the "Received-SPF" header field is 2544 discussed Section 9.2. 2546 o There have been a number of minor corrections to the ABNF to make 2547 it more clear and correct Appendix A. SPF library implementers 2548 should give the revised ABNF a careful review to determine if 2549 implementation changes are needed. 2551 o Use of X- fields in the ABNF has been removed [RFC6648]. 2553 o Ambiguity about how to deal with invalid domain-spec after macro 2554 expansion has been documented. Depending on one specific behavior 2555 has to be avoided Section 4.8. 2557 o General operational information has been updated and expanded 2558 based on eight years of post [RFC4408] operations experience 2559 Section 10 and Appendices D - H below. 2561 o Security considerations have been reviewed and updated Section 11. 2563 Appendix D. Further Testing Advice 2565 Another approach that can be helpful to publish records that include 2566 a "tracking exists:" mechanism. By looking at the name server logs, 2567 a rough list can then be generated. For example: 2569 v=spf1 exists:_h.%{h}._l.%{l}._o.%{o}._i.%{i}._spf.%{d} ?all 2571 Appendix E. SPF/Mediator Interactions 2573 There are three places that techniques can be used to ameliorate 2574 unintended SPF failures with mediators. 2576 E.1. Originating ADMDs 2578 The beginning, when email is first sent: 2580 o "Neutral" results could be given for IP addresses that might be 2581 forwarders, instead of "fail" results based on a list of known 2582 reliable forwarders. For example: 2584 "v=spf1 mx ?exists:%{ir}.whitlist.example.org -all" 2586 This would cause a lookup on an DNS white list (DNSWL) and cause a 2587 result of "fail" only for email not either coming from the 2588 domain's mx host(s) (SPF pass) or white listed sources (SPF 2589 neutral). This, in effect, outsources an element of sender policy 2590 to the maintainer of the whitelist. 2592 o The "MAIL FROM" identity could have additional information in the 2593 local-part that cryptographically identifies the mail as coming 2594 from an authorized source. In this case, such an SPF record could 2595 be used: 2597 "v=spf1 mx exists:%{l}._spf_verify.%{d} -all" 2599 Then, a specialized DNS server can be set up to serve the 2600 _spf_verify subdomain that validates the local-part. Although 2601 this requires an extra DNS lookup, this happens only when the 2602 email would otherwise be rejected as not coming from a known good 2603 source. 2604 Note that due to the 63-character limit for domain labels, this 2605 approach only works reliably if the local-part signature scheme is 2606 guaranteed either to only produce local-parts with a maximum of 63 2607 characters or to gracefully handle truncated local-parts. 2609 o Similarly, a specialized DNS server could be set up that will 2610 rate-limit the email coming from unexpected IP addresses. 2612 "v=spf1 mx exists:%{ir}._spf_rate.%{d} -all" 2614 o SPF allows the creation of per-user policies for special cases. 2615 For example, the following SPF record and appropriate wildcard DNS 2616 records can be used: 2618 "v=spf1 mx redirect=%{l1r+}._at_.%{o}._spf.%{d}" 2620 E.2. Mediators 2622 The middle, when email is forwarded:. 2624 o Mediators can solve the problem by rewriting the "MAIL FROM" to be 2625 in their own domain. This means mail rejected from the external 2626 mailbox will have to be forwarded back to the original sender by 2627 the forwarding service. Various schemes to do this exist though 2628 they vary widely in complexity and resource requirements on the 2629 part of the mediator. 2631 o Several popular MTAs can be forced from "alias" semantics to 2632 "mailing list" semantics by configuring an additional alias with 2633 "owner-" prepended to the original alias name (e.g., an alias of 2634 "friends: george@example.com, fred@example.org" would need another 2635 alias of the form "owner-friends: localowner"). 2637 o Mediators could reject mail that would "fail" SPF if forwarded 2638 using an SMTP reply code of 551, User not local, (see [RFC5321] 2639 section 3.4) to communicate the correct target address to resend 2640 the mail to. 2642 E.3. Receving ADMDs 2644 The end, when email is received: 2646 o If the owner of the external mailbox wishes to trust the mediator, 2647 he can direct the external mailbox's MTA to skip SPF tests when 2648 the client host belongs to the mediator. 2650 o Tests against other identities, such as the "HELO" identity, MAY 2651 be used to override a failed test against the "MAIL FROM" 2652 identity. 2654 o For larger domains, it might not be possible to have a complete or 2655 accurate list of forwarding services used by the owners of the 2656 domain's mailboxes. In such cases, whitelists of generally- 2657 recognized forwarding services could be employed. 2659 Appendix F. Mail Services 2661 MSPs (Mail Service Providers - [RFC5598] Section 2.3) that offer mail 2662 services to third-party domains, such as sending of bulk mail, might 2663 want to adjust their configurations in light of the authorization 2664 check described in this document. If the domain part of the "MAIL 2665 FROM" identity used for such email uses the domain of one of the MSPs 2666 domain, then the provider needs only to ensure that its sending host 2667 is authorized by its own SPF record, if any. 2669 If the "MAIL FROM" identity does not use the MSP's domain, then extra 2670 care has to be taken. The SPF record format has several options for 2671 the third-party domain to authorize the service provider's MTAs to 2672 send mail on its behalf. For MSPs, such as ISPs, that have a wide 2673 variety of customers using the same MTA, steps are required to 2674 mitiate the risk of cross-customer forgery (see Section 11.4). 2676 Appendix G. MTA Relays 2678 Relays are described in [RFC5598] Section 2.2.2. The authorization 2679 check generally precludes the use of arbitrary MTA relays between 2680 sender and receiver of an email message. 2682 Within an organization, MTA relays can be effectively deployed. 2683 However, for purposes of this document, such relays are effectively 2684 transparent. The SPF authorization check is a check between border 2685 MTAs of different ADMDs. 2687 For mail senders, this means that published SPF records have to 2688 authorize any MTAs that actually send across the Internet. Usually, 2689 these are just the border MTAs as internal MTAs simply forward mail 2690 to these MTAs for relaying. 2692 The receiving ADMD will generally want to perform the authorization 2693 check at the boundary MTAs, including all secondary MXs. Internal 2694 MTAs (including MTAs that might serve both as boundary MTAs and 2695 internal relays from secondary MXs when they are processing the 2696 relayed mail stream) then do not perform the authorization test. To 2697 perform the authorization test other than at the boundary, the host 2698 that first transferred the message to the receiving ADMD have to be 2699 determined, which can be difficult to extract from the message header 2700 because (a) header fields can be forged or malformed, and (b) there's 2701 no standard way to encode that information such that it can be 2702 reliably extracted. Testing other than at the boundary is likely to 2703 produce unreliable results. 2705 Appendix H. Local Policy Considerations 2707 SPF results can be used in combination with other methods to 2708 determine the final local disposition (either positive or negative of 2709 a message. It can also be considered dispositive on its own. 2711 H.1. Policy For SPF Pass 2713 SPF pass results can be used in combination with "white lists" of 2714 known "good" domains to bypass some or all additional pre-delivery 2715 email checks. Exactly which checks and how to determine appropriate 2716 white list entries has to be based on local conditions and 2717 requirements. 2719 H.2. Policy For SPF Fail 2721 SPF fail results can be used to reject messages during the SMTP 2722 transaction based on either "MAIL FROM" or "HELO" identity results. 2723 This reduces resource requirements for various content filtering 2724 methods and conserves bandwidth since rejection can be done before 2725 the SMTP content is transferred. It also gives immediate feedback to 2726 the sender who might then be able to resolve the issue. Due to some 2727 of the issues described above in this section (Section 10), SPF based 2728 rejection does present some risk of rejecting legitimate email when 2729 rejecting based on "MAIL FROM" results. 2731 SPF fail results can alternately be used as one input into a larger 2732 set of evaluations which might, based on a combination with other 2733 evaluation techniques, result in the email being marked negatively in 2734 some way (this might be via delivery to a special spam folder, 2735 modifying subject lines, or other locally determined means). 2736 Developing the details of such an approach have to be based on local 2737 conditions and requirements. Using SPF results in this way does not 2738 have the advantages of resource conservation and immediate feedback 2739 to the sender associated with SMTP rejection, but could produce fewer 2740 undesirable rejections in a well designed system. Such an approach 2741 might result in email that was not authorized by the sending ADMD 2742 being unknowingly delivered to end users. 2744 Either general approach can be used as they both leave a clear 2745 disposition of emails. They are either delivered in some manner or 2746 the sender is notified of the failure. Other dispositions such as 2747 "dropping" or deleting email after acceptance are inappropriate 2748 because they leave uncertainty and reduce the overall reliabilility 2749 and utility of email across the Internet. 2751 H.3. Policy For SPF Permerror 2753 The "permerror" result (see Section 2.6.7) indicates the SPF 2754 processing module at the receiver determined that the retrieved SPF 2755 policy record could not be interpreted. This gives no true 2756 indication about the authorized use of the data found in the 2757 envelope. 2759 As with all results, implementers have a choice to make regarding 2760 what to do with a message that yields this result. SMTP allows only 2761 a few basic options. 2763 Rejection of the message is an option, in that it is the one thing a 2764 receiver can do to draw attention to the difficulty encountered while 2765 protecting itself from messages that do not have a definite SPF 2766 result of some kind. However, if the SPF implementation is defective 2767 and returns spurious "permerror" results, only the sender is actively 2768 notified of the defect (in the form of rejected mail), and not the 2769 receiver making use of SPF. 2771 The less intrusive handling choice is to deliver the message, perhaps 2772 with some kind of annotation of the difficulty encountered and/or 2773 logging of a similar nature. However, this will not be desirable to 2774 operators that wish to implement SPF checking as strictly as 2775 possible, nor is this sort of passive problem reporting typically 2776 effective. 2778 There is of course the option placing this choice in the hands of the 2779 operator rather than the implementer since this kind of choice is 2780 often a matter of local policy rather than a condition with a 2781 universal solution, but this adds one more piece of complexity to an 2782 already non-trivial environment. 2784 Both implementers and operators need to be cautious of all choices 2785 and outcomes when handling SPF results. 2787 Appendix I. Protocol Status 2789 SPF has been in development since the summer of 2003 and has seen 2790 deployment beyond the developers beginning in December 2003. The 2791 design of SPF slowly evolved until the spring of 2004 and has since 2792 stabilized. There have been quite a number of forms of SPF, some 2793 written up as documents, some submitted as Internet Drafts, and many 2794 discussed and debated in development forums. The protocol was 2795 originally defined in [RFC4408], which this document replaces. 2797 [RFC4408] was designed to clearly document the protocol defined by 2798 earlier draft specifications of SPF as used in existing 2799 implementations. This updated specification is intended to clarify 2800 identified ambiguities in [RFC4408], resolve techincal issues 2801 identified in post-RFC 4408 deplyment experience, and document widely 2802 deployed extensions to SPF that have been developed since [RFC4408] 2803 was published. 2805 This document updates and replaces RFC 4408 that was part of a group 2806 of simultaneously published Experimental RFCs (RFC 4405, RFC 4406, 2807 RFC 4407, and RFC 4408) in 2006. At that time the IESG requested the 2808 community observe the success or failure of the two approaches 2809 documented in these RFCs during the two years following publication, 2810 in order that a community consensus could be reached in the future. 2812 SPF is widely deployed by large and small email providers alike. 2813 There are multiple, interoperable implementations. 2815 For SPF (as documented in RFC 4408) a careful effort was made to 2816 collect and document lessons learned and errata during the two year 2817 period. The errata list has been stable (no new submissions) and 2818 only minor protocol lessons learned were identified. Resolution of 2819 the IESG's experiment is documented in [RFC6686]. 2821 Appendix J. Change History 2823 Changes since RFC 4408 (to be removed prior to publication) 2825 Moved to standards track 2827 Authors updated 2829 IESG Note regarding experimental use replaced with discussion of 2830 results 2832 Process errata: 2834 Resolved Section 2.5.7 PermError on invalid domains after macro 2835 expansion errata in favor of documenting that different clients 2836 produce different results. 2838 Add %v macro to ABNF grammar 2840 Replace "uric" by "unreserved" 2842 Recommend an SMTP reply code for optional permerror rejections 2844 Correct syntax in Received-SPF examples 2846 Fix unknown-modifier clause is too greedy in ABNF 2848 Correct use of empty domain-spec on exp modifier 2850 Fix minor typo errata 2852 Convert to spfbis working group draft, 2853 draft-ietf-spfbis-4408bis-00 2855 Addressed Ticket #1, RFC 4408 Section 2.5.6 - Temporary errors by 2856 giving the option to turn repeated SERVFAIL into permerror and 2857 adding RFC 2308 reference. 2859 Clarified text about IPv4 mapped addresses to resolve test suite 2860 ambiguity 2862 Clarified ambiguity about result when more than 10 "mx" or "ptr" 2863 records are returned for lookup to specify permerror. This 2864 resolves one of the test suite ambiguities 2866 Made all references to result codes lower case per issue #7 2867 Adjusted section 2.2 Requirement to check mail from per issue #15 2869 Added missing "v" element in macro-letter in the collected ABNF 2870 per issue #16 - section 8.1 was already fixed in the pre-WG draft 2872 Marked ptr and "p" macro SHOULD NOT use per issue #27 2874 Expunged lower case may from the draft per issue #8 2876 Expunged "x-" name as an obsolete concept 2878 Updated obslete references: RFC2821 to RFC5321, RFC2822 to 2879 RFC5322, and RFC4234 to RFC5234 2881 Refer to RFC6647 to describe greylisting instead of trying to 2882 describe it directly. 2884 Updated informative references to the current versions. 2886 Start to rework section 9 with some RFC5598 terms. 2888 Added mention of RFC 6552 feedback reports in section 9. 2890 Added draft-ietf-spfbis-experiment as an informational reference. 2892 Drop Type SPF. 2894 Try and clarify informational nature of RFC3696 2896 Fix ABNF nits and add missing definitions per Bill's ABNF checker. 2898 Make DNS lookup time limit SHOULD instead of MAY. 2900 Reorganize and clarify processing limits. Move hard limits to new 2901 section 4.6.4, Evaluation Limits. Move advice to non-normative 2902 section 9. 2904 Removed paragraph in section 10.1 about limiting total data 2905 volumes as it is unused (and removable per the charter) and serves 2906 no purpose (it isn't something that actually can be implemented in 2907 any reasonable way). 2909 Added text and figures from Alessandro Vesely in section 9.1 to 2910 better explain DNS resource limits. 2912 Multiple editorial fixes from Murray Kucherawy's review. 2914 Also based on Murray's review, reworked SMTP identity definitions 2915 and made RFC 5598 a normative reference instead of informative. 2916 This is a downref that will have to be mentioned in the last call. 2918 Added RFC 3834 as an informative reference about backscatter. 2920 Added IDN requirements and normative reference to RFC 5890 to deal 2921 with the question "like DKIM did it.: 2923 Added informative reference to RFC 4632 for CIDR and use CIDR 2924 prefix length instead of CIDR-length to match its terminology. 2926 Simplified the exists description. 2928 Added text on creating a Authentication-Results header field that 2929 matches the Received-SPF header field information and added a 2930 normative reference to RFC 5451. 2932 Added informative reference to RFC 2782 due to SRV mention. 2934 Added informative reference to RFC 3464 due to DSN mention. 2936 Added informative reference to RFC 5617 for its DNS wildcard use. 2938 Clarified the intended match/no-match method for exists. 2940 Added new sections on Receiver policy for SPF pass, fail, and 2941 permerror. 2943 Added new section 9 discussion on treatment of bounces and the 2944 significance of HELO records. 2946 Added request to IANA to update the SPF modifier registry. 2948 Substantially reorganized the document for improved readability 2949 for new users based on WG consensus. 2951 Added new DNS "void lookup" processing limit to mitigate potental 2952 future risk of SPF being used as a DDoS vector. 2954 Author's Address 2956 Scott Kitterman 2957 Kitterman Technical Services 2958 3611 Scheel Dr 2959 Ellicott City, MD 21042 2960 United States of America 2962 Email: scott@kitterman.com