RFC 5451
Message Header Field for Indicating Message Authentication Status
RFC 5451: Message Header Field for Indicating Message Authentication Status ๐
okay bestie, this is the RFC that gave email its Authentication-Results header ๐. it's a Standards Track doc, written by M. Kucherawy from Sendmail, Inc., and it's dated April 2009 ๐
. the title block doesn't list anything it obsoletes or updates, so it's a standalone vibe ๐ฆ
Status of This Memo ๐
so this doc is an Internet standards track protocol for the whole Internet community ๐, and it's literally begging for discussion and suggestions for improvements ๐. for the current standardization state and status of this protocol, check the "Internet Official Protocol Standards" (STD 1) list ๐. distribution of this memo is unlimited, so share away ๐
Copyright Notice ยฉ๏ธ
Copyright (c) 2009 IETF Trust and the persons identified as the document authors. All rights reserved. ๐
this document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents in effect on the date of publication of this document (http://trustee.ietf.org/license-info). please read these carefully, bestie, because they spell out your rights and restrictions for this doc ๐
Abstract ๐ธ
this memo defines a brand new header field for electronic mail messages that shows the results of message authentication efforts ๐จ. any receiver-side software, like mail filters or Mail User Agents (MUAs), may use this header to pass that info along in a convenient way to users, or to make sorting and filtering decisions ๐ง
Table of Contents ๐๏ธ
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Purpose . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2. Trust Boundary . . . . . . . . . . . . . . . . . . . . . . 4
1.3. Processing Scope . . . . . . . . . . . . . . . . . . . . . 5
1.4. Requirements . . . . . . . . . . . . . . . . . . . . . . . 5
1.5. Definitions . . . . . . . . . . . . . . . . . . . . . . . 5
1.5.1. General . . . . . . . . . . . . . . . . . . . . . . . 5
1.5.2. Security . . . . . . . . . . . . . . . . . . . . . . . 5
1.5.3. Email Architecture . . . . . . . . . . . . . . . . . . 6
1.6. Trust Environment . . . . . . . . . . . . . . . . . . . . 7
2. Definition and Format of the Header Field . . . . . . . . . . 8
2.1. General Description . . . . . . . . . . . . . . . . . . . 8
2.2. Formal Definition . . . . . . . . . . . . . . . . . . . . 8
2.3. Authentication Identifier Field . . . . . . . . . . . . . 10
2.4. Result Values . . . . . . . . . . . . . . . . . . . . . . 12
2.4.1. DKIM and DomainKeys Results . . . . . . . . . . . . . 12
2.4.2. SPF and Sender-ID Results . . . . . . . . . . . . . . 13
2.4.3. "iprev" Results . . . . . . . . . . . . . . . . . . . 14
2.4.4. SMTP AUTH Results . . . . . . . . . . . . . . . . . . 14
2.4.5. Extension Result Codes . . . . . . . . . . . . . . . . 15
2.5. Authentication Methods . . . . . . . . . . . . . . . . . . 15
2.5.1. Definition of Initial Methods . . . . . . . . . . . . 16
2.5.2. Extension Methods . . . . . . . . . . . . . . . . . . 16
3. The "iprev" Authentication Method . . . . . . . . . . . . . . 17
4. Adding the Header Field to A Message . . . . . . . . . . . . . 18
4.1. Header Field Position and Interpretation . . . . . . . . . 19
4.2. Local Policy Enforcement . . . . . . . . . . . . . . . . . 20
5. Removing the Header Field . . . . . . . . . . . . . . . . . . 20
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22
6.1. The Authentication-Results Header Field . . . . . . . . . 22
6.2. Email Authentication Method Name Registry . . . . . . . . 22
6.3. Email Authentication Result Name Registry . . . . . . . . 24
7. Security Considerations . . . . . . . . . . . . . . . . . . . 26
7.1. Forged Header Fields . . . . . . . . . . . . . . . . . . . 26
7.2. Misleading Results . . . . . . . . . . . . . . . . . . . . 27
7.3. Header Field Position . . . . . . . . . . . . . . . . . . 28
7.4. Reverse IP Query Denial-of-Service Attacks . . . . . . . . 28
7.5. Mitigation of Backscatter . . . . . . . . . . . . . . . . 28
7.6. Internal MTA Lists . . . . . . . . . . . . . . . . . . . . 28
7.7. Attacks against Authentication Methods . . . . . . . . . . 28
7.8. Intentionally Malformed Header Fields . . . . . . . . . . 29
7.9. Compromised Internal Hosts . . . . . . . . . . . . . . . . 29
7.10. Encapsulated Instances . . . . . . . . . . . . . . . . . . 29
7.11. Reverse Mapping . . . . . . . . . . . . . . . . . . . . . 29
8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 30
8.1. Normative References . . . . . . . . . . . . . . . . . . . 30
8.2. Informative References . . . . . . . . . . . . . . . . . . 30
Appendix A. Legacy MUAs . . . . . . . . . . . . . . . . . . . . . 32
Appendix B. Authentication-Results Examples . . . . . . . . . . . 33
B.1. Trivial Case; Header Field Not Present . . . . . . . . . . 33
B.2. Nearly Trivial Case; Service Provided, But No
Authentication Done . . . . . . . . . . . . . . . . . . . 34
B.3. Service Provided, Authentication Done . . . . . . . . . . 35
B.4. Service Provided, Several Authentications Done, Single
MTA . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
B.5. Service Provided, Several Authentications Done,
Different MTAs . . . . . . . . . . . . . . . . . . . . . . 37
B.6. Service Provided, Multi-Tiered Authentication Done . . . . 39
Appendix C. Operational Considerations about Message
Authentication . . . . . . . . . . . . . . . . . . . 41
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . 43
1. Introduction ๐
okay so this memo defines a new header field for electronic mail messages that presents the results of a message authentication effort in a machine-readable format ๐ค. the whole point is to have one place to collect that data when message authentication mechanisms are in use, so a Mail User Agent (MUA) and downstream filters can make filtering decisions and/or give the user a recommendation about whether the message's origin is valid and possibly whether its content is intact ๐
end users aren't expected to be direct consumers of this header field ๐ โโ๏ธ. it's meant for programs, which then use or render that data in a human-usable form โจ
this memo covers both the format of this new header field and what it means when the field is present or absent ๐ . it does NOT get into how the data should be used (like which filtering decisions make sense, or how an MUA might display the results), because those are local policy and user interface design questions, and they don't belong in this memo ๐
at the time of publication of this memo, [AUTH], [DKIM], [DOMAINKEYS], [SENDERID], and [SPF] are published DNS domain-level email authentication methods in common use ๐ฌ. this proposal isn't meant to be restricted to domain-based authentication, but that has proven to be a good starting point for implementations ๐ฑ. as various methods emerge, it's necessary to prepare for their appearance and encourage convergence in the area of interfacing verifiers to filters and MUAs ๐ฆ
ngl this next bit is the tea ๐ซ: although [SPF] defined a header field called Received-SPF, and [DOMAINKEYS] defined one called DomainKey-Status for this purpose, those header fields are specific to conveying their own respective results only, so they're insufficient to satisfy the requirements listed below ๐
1.1. Purpose ๐ง
the header field defined in this memo is expected to serve several purposes:
- Convey the results of various message authentication checks being applied by upstream filters and Mail Transfer Agents (MTAs) to MUAs and downstream filters within the same "trust domain", as such agents may wish to render those results to end users or use that data to apply more or less stringent content checks based on authentication results;
- Provide a common location within a message for this data;
- Create an extensible framework for reporting new authentication methods as they emerge.
in particular, the mere presence of this header field should not be construed as meaning that its data is valid ๐. it's really asserting validity based on one or more authentication schemes somewhere upstream. for an MUA or downstream filter to treat those assertions as actually valid, there must be an assessment of the trust relationship between such agents and the validating MTA ๐ค
1.2. Trust Boundary ๐ง
this document makes several references to the "trust boundary" of an administrative management domain (ADMD) ๐ฐ. given how diverse existing mail environments are, a precise definition of this term isn't possible, so don't @ me about it ๐ญ
simply put, a transfer from the creator of the header field to the consumer must happen within a context of trust that the creator's information is correct ๐. how that trust is obtained is outside the scope of this document. it's entirely a local matter ๐ซถ
so this document defines a "trust boundary" as the line between "external" and "internal" entities ๐ช. "external" here includes all hosts that do not deliberately provide some kind of messaging service for the receiving ADMD's users, and "internal" includes those hosts that do ๐ฎ. by this definition, the hosts within a "trust boundary" may lie entirely within a receiving ADMD's direct control, or they can include hosts managed by another ADMD (such as an ISP or commercial filtering service) that also provide services for the former ๐
1.3. Processing Scope ๐ญ
this proposal is meant to address the needs of authenticating messages, or properties of messages, during their actual transport ๐. it is NOT meant to address the security of messages that might be encapsulated within other messages, like a message/rfc822 [MIME] part inside a message ๐ฆ
1.4. Requirements ๐
this memo establishes no new requirements on existing protocols or servers โจ
in particular, this memo establishes no requirement on MTAs to reject or filter arriving messages that do not pass authentication checks ๐. the data conveyed by the defined header field's contents is for the information of MUAs and filters, and should be used at their discretion ๐
1.5. Definitions ๐
this section defines various terms used throughout this document ๐
1.5.1. General ๐
the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [KEYWORDS] ๐ซถ
1.5.2. Security ๐
okay bestie, the security stuff is where it gets spicy ๐ถ๏ธ. [SECURITY] talks about authentication and authorization and how people keep mixing them up ๐ญ. Because those words have been showing up in recent message-security work, they've picked up slightly different meanings, and this doc follows those newer usages:
- "Authorization" is the establishment of permission to use a resource or represent an identity. Here it means a message from a particular ADMD came in through a route the ADMD has explicitly approved ๐.
- "Authentication" is the assertion that a piece of data about a message (like the sender's identity) is valid, or that the whole message is valid โ .
Here's how the examples sort out ๐ . [SPF] and [SENDERID] are authorization mechanisms because they give a result showing whether the ADMD that apparently sent the message has explicitly authorized the connecting [SMTP] client to relay messages for it. They don't actually check any property of the message itself, so they're not validating the message ๐ โโ๏ธ. [DKIM] is different: it doesn't care how the message was routed. Instead, it uses cryptographic signatures to authenticate the agents claiming responsibility for the message (which implies authorization) and to make sure the message wasn't modified in transit ๐. The signatures aren't tied to SMTP connections, so they can be added by the ADMD of origin, by intermediate ADMDs (like a mailing list server), or by both ๐ค.
Rather than making a separate header field for each kind of solution, this proposal puts them both into one single header field ๐.
1.5.3. Email Architecture ๐ฌ
- A "border MTA" is an MTA that acts as a gateway between the general Internet and the users inside an organizational boundary ๐ช. (See also Section 1.2.)
- A "delivery MTA" (or Mail Delivery Agent or MDA) is an MTA that actually delivers a message to a user's inbox or other final destination ๐ฅ.
- An "intermediate MTA" is an MTA that handles messages after a border MTA and before a delivery MTA ๐ง.
Here's a little diagram of how mail flows between these parts ๐บ๏ธ:
+-----+ +-----+ +------------+
| MUA |-->| MSA |-->| Border MTA |
+-----+ +-----+ +------------+
|
|
V
+----------+
| Internet |
+----------+
|
|
V
+-----+ +-----+ +------------------+ +------------+
| MUA |<--| MDA |<--| Intermediate MTA |<--| Border MTA |
+-----+ +-----+ +------------------+ +------------+
Generally, the assumption is that applying message authentication schemes happens at a border MTA or a delivery MTA ๐ง , and this spec is written with that in mind โจ. BUT some sites run their whole mail setup on a single host ๐ . In those cases, "border MTA" and "delivery MTA" might even be the same machine, or even the very same agent ๐คฏ. It's also possible that some message authentication tests happen on an intermediate MTA. This doc doesn't spell out those cases, but they aren't meant to be excluded from this spec, so they're totally in the mix ๐.
See [EMAIL-ARCH] for more on general email system architecture, and Appendix C of this memo for the common aspects of email authentication in today's environments ๐.
1.6. Trust Environment ๐ธ
Okay so this new header field lets one or more message validation mechanisms pass their output along to one or more separate assessment mechanisms ๐. All of these live inside one unified trust boundary that defines an Administrative Management Domain (ADMD) ๐ฐ. An ADMD has one or more entities that do the validation and generate the header field, plus one or more entities that consume it for some kind of assessment ๐งโโ๏ธ.
Here's the tea โ: the field has no integrity or validation mechanism of its own, so its presence has to be trusted implicitly ๐ซข. That's why using this header field depends on making sure that mail entering the ADMD has any instances of the header field claiming to be valid within its boundaries removed. That way, consumers can safely use the occurrences of the header field that are left ๐งน.
The "authserv-id" token defined in Section 2.2 can be used to label an entire ADMD or one specific validation engine inside an ADMD ๐ท๏ธ. The labeling scheme is left as an operational choice, but this proposal does give some guidance on picking a token ๐ก.
2. Definition and Format of the Header Field ๐
This section gives a general overview of the header field being defined, and then gets into the more formal specification ๐.
2.1. General Description
The new header field being defined here is called "Authentication-Results" ๐. It's a Structured Header Field as defined in [MAIL], so all of the related definitions in that document apply ๐.
This new header field SHOULD be added at the top of the message as it transits MTAs that do authentication checks, so you can kind of infer how far away the checks were done ๐ธ. It should therefore be treated as a Trace Field as defined in [MAIL], and all of the related definitions in that document apply too ๐.
The value of the header field (after removing [MAIL] comments) is made up of an authentication identifier, an optional version, and then a series of "method=result" statements showing which authentication method(s) were applied and what their results were ๐. Then, for each applied method, you can have an optional "reason" string plus optional "property=value" statements showing which message properties were checked to reach that conclusion ๐ต๏ธโโ๏ธ.
The header field MAY appear more than once in a single message, or more than one result MAY be represented in a single header field, or a combination of these MAY be applied ๐.
2.2. Formal Definition
Formally, the header field is specified as follows using [ABNF] ๐ค:
authres-header = "Authentication-Results:" [CFWS] authserv-id
[ CFWS version ]
( [CFWS] ";" [CFWS] "none" / 1*resinfo ) [CFWS] CRLF
; the special case of "none" is used to indicate that no
; message authentication is performed
authserv-id = dot-atom
; see below for a description of this element
version = 1*DIGIT [CFWS]
; indicates which version of this specification is in use;
; this specification is version "1"; the absence of a
; version implies this version of the specification
resinfo = [CFWS] ";" methodspec [ CFWS reasonspec ]
*( CFWS propspec )
methodspec = [CFWS] method [CFWS] "=" [CFWS] result
; indicates which authentication method was evaluated
reasonspec = "reason" [CFWS] "=" [CFWS] value
; a free-form comment on the reason the given result
; was returned
propspec = ptype [CFWS] "." [CFWS] property [CFWS] "=" pvalue
; an indication of which properties of the message
; were evaluated by the authentication scheme being
; applied to yield the reported result and would be
; useful to reveal to end users as authenticated
method = dot-atom [ [CFWS] "/" [CFWS] version ]
; a method indicates which method's result is
; represented by "result", and is one of the methods
; explicitly defined as valid in this document
; or is an extension method as defined below
result = dot-atom
; indicates the results of the attempt to authenticate
; the message; see below for details
ptype = "smtp" / "header" / "body" / "policy"
; indicates whether the property being evaluated was
; a parameter to an [SMTP] command, or was a value taken
; from a message header field, or was some property of
; the message body, or some other property evaluated by
; the receiving MTA
property = dot-atom
; if "ptype" is "smtp", this indicates which [SMTP]
; command provided the value that was evaluated by the
; authentication scheme being applied; if "ptype" is
; "header", this indicates from which header field the
; value being evaluated was extracted; if "ptype" is
; "body", this indicates the offset into the body at which
; content of interest was detected; if "ptype" is "policy"
; then this indicates the name of the policy that caused
; this header field to be added (see below)
pvalue = [CFWS] ( value / [ [ local-part ] "@" ] domain-name )
[CFWS]
; the value extracted from the message property defined
; by the "ptype.property" construction; if the value
; identifies something intended to be an e-mail identity,
; then it MUST use the right hand portion of this ABNF
; definition
The "local-part" is as defined in Section 3.4.1, and "dot-atom" is defined in Section 3.2.3, of [MAIL] ๐. The "value" is as defined in Section 5.1 of [MIME] ๐งฉ. The "domain-name" is as defined in Section 3.5 of [DKIM] ๐.
The "dot-atom" used in a "result" above is further constrained by the need to be listed in Section 2.4 or an amendment to it ๐. See Section 2.3 for a description of the "authserv-id" element ๐ท๏ธ. The list of commands you can use with the "smtp" ptype is in [SMTP] and subsequent amendments ๐จ. "CFWS" is as defined in Section 3.2.2 of [MAIL] โจ.
The "propspec" can be left out if, for example, the method couldn't pull out any properties to evaluate but still has a result to report ๐คทโโ๏ธ. The "ptype" and "property" values each authentication method uses should be defined in the spec for that method (or its amendments) ๐งพ. And the "ptype" and "property" are case-insensitive ๐ค.
A "ptype" value of "policy" means a policy decision about the message that isn't tied to a property that could be pulled out of the message ๐๏ธ. For example, if a method would normally report a "ptype.property" of "header.From" but no From: header field was present, the method can use "policy" to show that no conclusion about the message's authenticity could be reached ๐.
2.3. Authentication Identifier Field ๐ชช
Every Authentication-Results header field has an authentication identifier field (authserv-id above) ๐. It's kinda like a fully-qualified domain name, so it looks similar.
This field is a unique ID for the authenticating service inside a given ADMD โจ. The uniqueness MUST be guaranteed by the ADMD that generates it, and it must pertain to exactly that one ADMD. It's meant to be read by machines and isn't necessarily meaningful to users. MUAs or downstream filters SHOULD use this identifier to figure out whether the data in an Authentication-Results header field should be used ๐ซถ.
For simplicity and scalability, the authentication identifier SHOULD be a common token used throughout the ADMD, like the DNS domain name used by or within that ADMD ๐ธ.
For tracing and debugging, the authentication identifier MAY instead be the hostname of the MTA performing the authentication check whose result is being reported. That's also handy for another purpose, as described in Section 4 ๐. Some implementations have even considered adding a delimiter like / and then some useful transport tracing data, such as the [SMTP] queue ID or a timestamp ๐ฐ๏ธ.
Okay, but here's the tea โ. Using a local, relative identifier like one single hostname, instead of a hierarchical and globally unique ADMD identifier like a DNS domain name, makes configuration way harder for big sites ๐ฉ. A hierarchical identifier lets you group related, trusted systems under one parent identifier, so you only have to assess the trust relationship with a single reference. The alternative is a flat namespace where every trusted system has to be listed one by one. Since consumers have to use the identifier to decide whether to use the contents of the header field, flat namespaces cause some real drama:
- Changes to the identifier impose a large, centralized administrative burden ๐ฆ.
- Ongoing administrative changes require constantly updating this centralized table. That makes it hard to make sure an MUA or downstream filter has accurate info for judging whether the header field's content is usable ๐. Consumers need to know not only the current identifier(s) in use, but the previous ones too, to account for delivery latency or to re-assess the header field's contents later โณ.
Examples of valid authentication identifiers are example.com, mail.example.org, ms1.newyork.example.com, and example-auth ๐.
2.4. Result Values ๐ฏ
Each individual authentication method returns one of a set of specific result values ๐ . The subsections below define these results for the authentication methods specifically supported by this memo, and verifiers SHOULD use these values as described below. New methods that aren't specified in this document but are meant to be supported by the header field defined here MUST include a similar result table, either in their defining memo or in a supplementary one ๐.
2.4.1. DKIM and DomainKeys Results ๐
The result values used by [DKIM] and [DOMAINKEYS] are as follows:
none: The message was not signed.pass: The message was signed, the signature or signatures were acceptable to the verifier, and the signature(s) passed verification tests โ .fail: The message was signed and the signature or signatures were acceptable to the verifier, but they failed the verification test(s) ๐.policy: The message was signed, but the signature or signatures were not acceptable to the verifier ๐ซ.neutral: The message was signed, but the signature or signatures contained syntax errors or weren't otherwise able to be processed ๐คทโโ๏ธ. This result SHOULD also be used for other failures not covered elsewhere in this list.temperror: The message couldn't be verified because of some error that's likely transient in nature, like a temporary inability to retrieve a public key โฑ๏ธ. A later attempt may produce a final result.permerror: The message couldn't be verified because of some error that's unrecoverable, like a required header field being absent ๐. A later attempt is unlikely to produce a final result.
A signature is "acceptable to the verifier" if it passes local policy checks (or if there are no specific local policy checks). For example, a verifier might require that the signature(s) on the message be added using the DNS domain present in the From: header field of the message, which would make third-party signatures unacceptable ๐
โโ๏ธ.
[DKIM] advises that if a message fails verification, it should be treated as an unsigned message. A report of "fail" here lets the receiver of the report decide how to handle the failure. A report of "neutral" or "none" preempts that choice, making sure the message is treated as if it had not been signed ๐ง.
2.4.2. SPF and Sender-ID Results ๐จ
The result values are used by [SPF] and [SENDERID] as follows:
none: No policy records were published at the sender's DNS domain ๐ซฅ.neutral: The sender's ADMD has asserted that it cannot or does not want to assert whether or not the sending IP address is authorized to send mail using the sender's DNS domain ๐ถ.pass: The client is authorized by the sender's ADMD to inject or relay mail on behalf of the sender's DNS domain ๐ฅณ.policy: The client is authorized to inject or relay mail on behalf of the sender's DNS domain according to the authentication method's algorithm, but local policy says the result is unacceptable ๐ โโ๏ธ.hardfail: This client is explicitly not authorized to inject or relay mail using the sender's DNS domain ๐.softfail: The sender's ADMD believes the client was not authorized to inject or relay mail using the sender's DNS domain, but is unwilling to make a strong assertion to that effect ๐ค.temperror: The message couldn't be verified because of some error that's likely transient in nature, like a temporary inability to retrieve a policy record from DNS ๐ฆ๏ธ. A later attempt may produce a final result.permerror: The message couldn't be verified because of some error that's unrecoverable, like a required header field being absent or a syntax error in a retrieved DNS TXT record ๐ฅ. A later attempt is unlikely to produce a final result.
The distinction between and interpretation of "none" and "neutral" under these methods is discussed further in [SPF] ๐.
The "policy" result would be returned if, for example, [SPF] returned a "pass" result, but a local policy check matched the sending DNS domain to one found in an explicit list of unacceptable DNS domains (e.g., spammers) ๐.
If the retrieved sender policies used to evaluate [SPF] and [SENDERID] don't contain explicit provisions for authenticating the local-part (see Section 3.4.1 of [MAIL]) of an address, the pvalue reported along with results for these mechanisms SHOULD NOT include the local-part ๐.
2.4.3. "iprev" Results ๐
The result values used by the "iprev" method, defined in Section 3, are as follows:
pass: The DNS evaluation succeeded, meaning the "reverse" and "forward" lookup results were returned and were in agreement ๐ .fail: The DNS evaluation failed. Specifically, the "reverse" and "forward" lookups each produced results, but they didn't agree, or the "forward" query completed but produced no result. That happens with a DNS RCODE of 3 (commonly known as NXDOMAIN), or with an RCODE of 0 (NOERROR) in a reply containing no answers ๐ป.temperror: The DNS evaluation couldn't be completed because of some error that's likely transient in nature, like a temporary DNS error. For example, a DNS RCODE of 2 (commonly known as SERVFAIL), or some other error condition, came back ๐ตโ๐ซ. A later attempt may produce a final result.permerror: The DNS evaluation couldn't be completed because no PTR data is published for the connecting IP address. That's shown by a DNS RCODE of 3 (commonly known as NXDOMAIN), or by an RCODE of 0 (NOERROR) in a reply containing no answers, and it prevented the evaluation from finishing ๐ง.
There is no "none" for this method, since any TCP connection delivering email has an IP address associated with it, so some kind of evaluation will always be possible ๐ง .
For a discussion of the format of DNS replies, see [DNS] ๐.
2.4.4. SMTP AUTH Results ๐
The result values used by the [AUTH] method are as follows:
none: SMTP authentication was not attempted ๐ .pass: The SMTP client had authenticated to the server reporting the result using the protocol described in [AUTH] ๐.fail: The SMTP client had tried to authenticate to the server using the protocol described in [AUTH] but wasn't successful. It still went ahead and continued to send the message the result is being reported for ๐ซ .temperror: The SMTP client tried to authenticate using the protocol described in [AUTH] but couldn't finish the attempt because of some error that's likely transient in nature, like a temporary Lightweight Directory Access Protocol (LDAP) lookup error ๐ง๏ธ. A later attempt may produce a final result.permerror: The SMTP client tried to authenticate using the protocol described in [AUTH] but couldn't finish the attempt because of some error that's likely not transient in nature, like a permanent LDAP lookup error ๐ชฆ. A later attempt is not likely to produce a final result.
Note that an agent making use of the data provided by this header field SHOULD consider "fail" and "temperror" to be synonymous in terms of message authentication, meaning the client did not authenticate ๐จ.
2.4.5. Extension Result Codes ๐งฉ
Additional result codes (extension results) might be defined in the future by later revisions or extensions to this specification โจ. Extension results beginning with x- will never be defined as standard fields, since those names are reserved for experimental use ๐งช. Result codes that don't begin with x- MUST be registered with the Internet Assigned Numbers Authority (IANA) and published in an RFC. See Section 6 for further details ๐.
Implementations reporting new result codes MUST use the x- prefix until the new method is registered by IANA ๐ท๏ธ.
Extension results MUST only be used within ADMDs that have explicitly consented to use them ๐ค. These results, and the parameters associated with them, are not documented in RFCs. That means they're subject to change at any time and aren't suitable for production use ๐ซฃ. Any MTA, MUA, or downstream filter intended for production use SHOULD ignore or delete any Authentication-Results header field that includes an extension result ๐๏ธ.
2.5. Authentication Methods ๐งโ๐ฌ
This section defines the supported authentication methods and discusses the proper ways to apply experimental and other extension methods ๐.
2.5.1. Definition of Initial Methods โจ
okay so these are the message authentication specs that already exist ๐
and it makes total sense to give each one its own method identifier: [AUTH], [DKIM], [DOMAINKEYS], [SENDERID], and [SPF]. So the identifiers auth, dkim, domainkeys, sender-id, and spf are officially defined, respectively, for MTAs that apply those specifications for email message authentication. ๐ฆ
And the method iprev gets defined in Section 3 ๐ธ
See Section 6 for details ๐
2.5.2. Extension Methods ๐ง
Brand new authentication method identifiers (extension methods) may be defined in the future by later revisions or extensions to this specification โจ Extension methods that begin with x- will never be defined as standard fields, because those names are reserved for experimental use ๐งช Method identifiers that don't begin with x- MUST be registered with the Internet Assigned Numbers Authority (IANA) and published in an RFC. See Section 6 for further details.
Extension methods may be defined for the following reasons:
- To allow additional information from new authentication systems to be communicated to MUAs or downstream filters. The names of these identifiers should reflect the name of the method being defined, but should not be needlessly long ๐
- To allow the creation of "sub-identifiers" that indicate different levels of authentication and differentiate between their relative strengths, e.g.,
auth1-weakandauth1-strong. ๐ฅ
Implementations of new methods MUST use the x- prefix until the new method gets registered by IANA ๐ซถ
Authentication method implementors are encouraged to provide adequate information, via [MAIL] comments if necessary, so an MUA developer can understand or relay the ancillary details of authentication results ๐ For example, if it might be of interest to relay what data was used to perform an evaluation, that info could be relayed as a comment in the header field, like this:
Authentication-Results: example.com;
foo=pass bar.baz=blob (2 of 3 tests OK)
Experimental method identifiers MUST only be used within ADMDs that have explicitly consented to use them. ๐ญ These method identifiers and the parameters attached to them are not documented in RFCs. Therefore, they are subject to change at any time and are not suitable for production use. Any MTA, MUA, or downstream filter intended for production use SHOULD ignore or delete any Authentication-Results header field that includes an experimental method identifier ๐
3. The "iprev" Authentication Method ๐ธ
This section defines an additional authentication method called iprev. ๐
In general, iprev is an attempt to verify that a client appears to be valid, based on some DNS queries. Once a session initiation of some kind comes in from a client, the IP address of the client peer gets queried for matching names (aka a number-to-name translation, also known as a "reverse lookup" or a "PTR" record query) ๐ Once that result comes back, each of the names gets looked up (aka a name-to-number translation, or an "A" or "AAAA" record query). The response to this second check should result in at least one mapping back to the client's IP address. It's giving circular, but make it make sense ๐
More algorithmically: if the client peer's IP address is I, the list of names that I maps to (after a "PTR" query) is the set N, and the union of IP addresses that each member of N maps to (after the corresponding "A" and "AAAA" queries) is L. Then this test is successful if I is an element of L. ๐งฎ
The response to a PTR query could contain multiple names. To prevent heavy DNS loads, agents performing these queries MUST be implemented such that the number of names evaluated by generating corresponding A or AAAA queries is finite, though it MAY be configurable by an administrator. As an example, Section 5.5 of [SPF] chose a limit of 10 for its implementation of this algorithm ๐
[DNS-IP6] discusses the query formats for the IPv6 case ๐
A successful test using this algorithm gives a result of "pass", since the ADMD where the client's PTR claims it belongs has confirmed that claim by including corresponding data in its DNS domain โ A failure to match is a "fail". There is no case where a "neutral" result can be returned, not even a little ๐ The remaining "temperror" and "permerror" cases refer, respectively, to temporary and permanent DNS query errors. ๐งฏ
There is some contention about the wisdom and reliability of this test ๐ค For example, in some regions it can be really hard for this test to ever pass, because the practice of arranging to match the forward and reverse DNS is infrequently observed. So the actual implementation details of how a verifier performs an "iprev" test are not specified here. The verifier MAY report a successful or failed "iprev" test at its discretion, after doing some kind of check of the validity of the connection's identity using DNS. It is incumbent upon an agent making use of the reported "iprev" result to understand what that particular verifier is actually trying to report ๐ง
Extensive discussion of reverse DNS mapping and its implications can be found in [DNSOP-REVERSE]. In particular, it recommends that applications avoid using this test as a means of authentication or security ๐ซ Its presence in this memo is not an endorsement. It's just an acknowledgement that the method remains common and provides the means to relay the results of that test ๐ซ
4. Adding the Header Field to A Message ๐
This specification makes no attempt to evaluate the relative strengths of the various message authentication methods that may become available. So the order of the presented authentication methods and results MUST NOT be used to imply or infer the importance or strength of any given method over another ๐ โโ๏ธ Instead, the MUA or downstream filter consuming this header field must interpret the result of each method based on its own knowledge of what that method evaluates. ๐ง
Each "method" MUST refer to an authentication method declared in the IANA registry, or to an extension method as defined in Section 2.5.2. Each "result" MUST refer to a result code declared in the IANA registry, or to an extension result code as defined in Section 2.4.5. See Section 6 for further information about the registered methods and result codes ๐
An MTA compliant with this specification MUST add this header field (after performing one or more message authentication tests) to indicate which MTA or ADMD performed the test, which test got applied, and what the result was ๐ If an MTA applies more than one such test, it MUST add this header field either once per test, or once indicating all of the results. An MTA MUST NOT add a result to an existing header field. No cheating, bestie ๐
An MTA MAY add this header field containing only the authentication identifier portion, to indicate explicitly that no message authentication schemes were applied prior to delivery of this message ๐ซฅ
An MTA adding this header field must take steps to identify it as legitimate to the MUAs or downstream filters that will ultimately consume its content. One required process to do so is described in Section 5. Further measures may be required in some environments, and some possible solutions are listed in Section 7.1. This memo doesn't mandate any specific solution to this issue, since each environment has its own facilities and limitations ๐ ๏ธ
For MTAs that add this header field, adding header fields in order (at the top), per Section 3.6 of [MAIL], is particularly important โญ Moreover, this header field SHOULD be inserted above any other trace header fields such MTAs might prepend. That way, it's easy to detect which header fields can be trusted ๐
End users who make direct use of this header field may inadvertently trust information that hasn't been properly vetted ๐ฌ If, for example, a basic [SPF] result were relayed that claims an authenticated addr-spec, the local-part of that addr-spec has actually not been authenticated. So an MTA adding this header field SHOULD NOT include any data that hasn't been authenticated by the method(s) being applied. Moreover, MUAs SHOULD NOT render such information to users if it's presented by a method known not to authenticate it ๐
4.1. Header Field Position and Interpretation ๐
In order to ensure non-ambiguous results and avoid the impact of false header fields, MUAs and downstream filters SHOULD NOT interpret this header field unless specifically instructed to do so by the user or administrator. Like, this interpretation should not be "on by default" ๐ Naturally then, users or administrators should not activate such a feature unless they're certain the header field will be added by the border MTA that accepts the mail that is ultimately read by the MUA. Any instances of the header field that appear to be from within the ADMD but were actually added by foreign MTAs will be removed before delivery ๐ช
Furthermore, MUAs and downstream filters SHOULD NOT interpret this header field unless the authentication identifier it bears appears to be one used within its own ADMD, as configured by the user or administrator ๐ธ
MUAs and downstream filters MUST ignore any result reported using a "result" that isn't specified in the result code registry, or a "ptype" that isn't listed in the corresponding registry for such values, as defined in Section 6. Moreover, such agents MUST ignore a result indicated for any "method" they don't specifically support ๐๏ธ
An MUA SHOULD NOT reveal these results to end users unless the results are accompanied by, at a minimum, some associated reputation data about the authenticated origin identifiers within the message. For example, an attacker could register examp1e.com (note the digit "one") and send signed mail to intended victims. A verifier would detect that the signature was valid and report a "pass", even though it's clear the DNS domain name was meant to mislead ๐จ See Section 7.2 for further discussion.
As stated in Section 2.1, this header field SHOULD be treated as though it were a trace header field as defined in Section 3.6.7 of [MAIL]. Hence it MUST NOT be reordered and MUST be prepended to the message, so that there is generally some indication upon delivery of where in the chain of handling MTAs the message authentication was done ๐งพ
MUAs SHOULD ignore instances of this header field discovered within message/rfc822 [MIME] attachments ๐
Further discussion of this can be found in Section 7 below. ๐ซถ
4.2. Local Policy Enforcement โจ
okay so bestie, what if your site's local policy says a total failure (like fail for DKIM or hardfail for SPF) means the message is dead on arrival? ๐ Then the border MTA SHOULD send back an [SMTP] rejection instead of adding this header field with the failure result and letting the message keep going. It's giving "don't let it in the building" ๐ช. This is way better than letting the message reach an internal host's MTA or spam filter, where it could trigger a local rejection like a [DSN] sent to a forged originator. Not it ๐
โโ๏ธ.
The same MAY also be done when local policy overrides the results of the authentication methods, like the "policy" result codes from Section 2.4. ๐
Heads up though: rejecting at the SMTP level isn't possible if local policy is enforced at the MUA and not the MTA. ๐ญ Unfortunately, that's a pretty common setup, so it's worth knowing about. ๐ซถ
5. Removing the Header Field ๐งน
For security reasons, any MTA that follows this specification MUST delete any instance of this header field it finds that claims to have been added inside its trust boundary, unless it came from another trusted MTA. ๐ For example, an MTA (border or otherwise) for example.com that receives a message MUST delete any instance of this header field carrying an authentication identifier that says it was added inside example.com, before adding its own header fields. Lowkey this means each MTA needs a list of internal MTAs known to be compliant (and therefore trustworthy) ๐.
For simplicity and maximum security, a border MTA MAY remove all instances of this header field on mail crossing into its trust boundary. โ๏ธ But ngl, that might clash with wanting to access authentication results from trusted external service providers. It could also break signed messages whose signatures cover external instances of this header field. ๐ A more robust border MTA could allow a specific list of authenticating MTAs whose information gets let in, and remove everything else. ๐ง
As stated in Section 1.2, a formal definition of "trust boundary" is deliberately not made here. ๐ It's totally possible that a border MTA for example.com explicitly trusts the authentication results asserted by the upstream host example.net, even though they live in completely separate administrative boundaries. In that case, the border MTA MAY elect not to delete those results. ๐ค Also, the upstream host doing the authentication work could apply a signing technology like [DKIM] to its own results, so downstream hosts can be sure they're authentic. An example of this is in Appendix B. ๐
Similarly, for messages signed using [DKIM] or other message signing methods that sign header fields, removing a header field may invalidate one or more signatures on the message if they covered that header field at signing time. ๐ฌ This behavior can actually be desirable, since there's little value in validating the signature on a message with forged headers. ๐๏ธ Still, signing agents MAY therefore elect to omit these header fields from signing so they don't end up in this situation. ๐ธ
An MTA SHOULD remove any instance of this header field that bears a version (express or implied) it doesn't support. ๐ However, an MTA MUST remove such a header if the [SMTP] connection relaying the message is not from a trusted internal MTA. ๐จ
6. IANA Considerations ๐
IANA has registered one new header field and created two new tables, as described below. ๐
6.1. The Authentication-Results Header Field ๐
Per [IANA-HEADERS], the Authentication-Results header field has been added to the IANA Permanent Message Header Field Registry. Here's the registration template, slay ๐
:
Header field name: Authentication-Results
Applicable protocol: mail ([MAIL])
Status: Standard
Author/Change controller: IETF
Specification document(s): RFC 5451
Related information:
Requesting review of any proposed changes and additions to
this field is recommended.
6.2. Email Authentication Method Name Registry ๐๏ธ
Names of message authentication methods supported by this specification must be registered with IANA, except for experimental names as described in Section 2.5.2. ๐งช
New entries are only assigned for values that have been documented in a published RFC that has had IETF Review, per [IANA-CONSIDERATIONS]. Each method must register a name, the specification that defines it, one or more "ptype" values that suit that method, which "property" value(s) that method should report, and a description of the "value" to use with each. ๐
The initial set of entries in this registry looks like this:
+------------+----------+--------+----------------+--------------------+
| Method | Defined | ptype | property | value |
+------------+----------+--------+----------------+--------------------+
| auth | RFC4954 | smtp | auth | AUTH parameter of |
| | | | | the SMTP MAIL |
| | | | | command |
+------------+----------+--------+----------------+--------------------+
| dkim | RFC4871 | header | d | value of |
| | | | | signature "d" tag |
| | | +----------------+--------------------+
| | | | i | value of |
| | | | | signature "i" tag |
+------------+----------+--------+----------------+--------------------+
| domainkeys | RFC4870 | header | d | value of |
| | | | | signature "d" tag |
| | | +----------------+--------------------+
| | | | from | value of From |
| | | | | header field after |
| | | | | removing comments |
| | | | | and local-part if |
| | | | | not authenticated |
| | | +----------------+--------------------+
| | | | sender | value of Sender |
| | | | | header field after |
| | | | | removing comments |
| | | | | and local-part if |
| | | | | not authenticated |
+------------+----------+--------+----------------+--------------------+
| iprev | this | policy | iprev | client IP address |
| | document | | | |
+------------+----------+--------+----------------+--------------------+
| sender-id | RFC4406 | header | name of header | value of header |
| | | | field used by | field used by PRA |
| | | | the Purported | after removing |
| | | | Responsible | comments and parts |
| | | | Address (PRA) | not authenticated |
+------------+----------+--------+----------------+--------------------+
| spf | RFC4408 | smtp | mailfrom | envelope sender |
| | | | | after removing |
| | | | | parts not |
| | | | | authenticated |
| | +--------+----------------+--------------------+
| | | smtp | helo | HELO/EHLO value |
+------------+----------+--------+----------------+--------------------+
6.3. Email Authentication Result Name Registry ๐ท๏ธ
Names of message authentication result codes supported by this specification must be registered with IANA, except for experimental codes as described in Section 2.4.5. ๐งช
New entries are only assigned for result codes that have been documented in a published RFC that has had IETF Review, per [IANA-CONSIDERATIONS]. Each code must register a name, the document that establishes the registration, the authentication method(s) that use it, and either a definition of what its use means or a reference to where those semantics are defined. ๐
The initial set of entries in this registry looks like this:
+-----------+----------+----------------+------------------------------+
| Code | Defined | Auth Method(s) | Meaning |
+-----------+----------+----------------+------------------------------+
| none | this | dkim | section 2.4.1 |
| | document | domainkeys | |
| | +----------------+------------------------------+
| | | spf | section 2.4.2 |
| | | sender-id | |
| | +----------------+------------------------------+
| | | auth | section 2.4.4 |
+-----------+----------+----------------+------------------------------+
| pass | this | dkim | section 2.4.1 |
| | document | domainkeys | |
| | +----------------+------------------------------+
| | | spf | section 2.4.2 |
| | | sender-id | |
| | +----------------+------------------------------+
| | | iprev | section 2.4.3 |
| | +----------------+------------------------------+
| | | auth | section 2.4.4 |
+-----------+----------+----------------+------------------------------+
| fail | this | dkim | section 2.4.1 |
| | document | domainkeys | |
| | +----------------+------------------------------+
| | | iprev | section 2.4.3 |
| | +----------------+------------------------------+
| | | auth | section 2.4.4 |
+-----------+----------+----------------+------------------------------+
| policy | this | dkim | section 2.4.1 |
| | document | domainkeys | |
| | +----------------+------------------------------+
| | | spf | section 2.4.2 |
| | | sender-id | |
+-----------+----------+----------------+------------------------------+
| neutral | this | dkim | section 2.4.1 |
| | document | domainkeys | |
| | +----------------+------------------------------+
| | | spf | section 2.4.2 |
| | | sender-id | |
+-----------+----------+----------------+------------------------------+
| temperror | this | dkim | section 2.4.1 |
| | document | domainkeys | |
| | +----------------+------------------------------+
| | | spf | section 2.4.2 |
| | | sender-id | |
| | +----------------+------------------------------+
| | | iprev | section 2.4.3 |
| | +----------------+------------------------------+
| | | auth | section 2.4.4 |
+-----------+----------+----------------+------------------------------+
| permerror | this | dkim | section 2.4.1 |
| | document | domainkeys | |
| | +----------------+------------------------------+
| | | spf | section 2.4.2 |
| | | sender-id | |
| | +----------------+------------------------------+
| | | iprev | section 2.4.3 |
| | +----------------+------------------------------+
| | | auth | section 2.4.4 |
+-----------+----------+----------------+------------------------------+
| hardfail | this | spf | section 2.4.2 |
| | document | sender-id | |
+-----------+----------+----------------+------------------------------+
| softfail | this | spf | section 2.4.2 |
| | document | sender-id | |
+-----------+----------+----------------+------------------------------+
7. Security Considerations ๐
okay bestie, this section is where things get spicy ๐ถ๏ธ fr. These are the security considerations for adding or processing the Authentication-Results header field โจ
7.1. Forged Header Fields ๐ญ
okay so picture this: an MUA or filter opens a mailbox where the mail went through a non-conformant MTA, and it does understand Authentication-Results header fields. It could totally make false conclusions based on forged ones ๐ญ. A sneaky user or agent could fake the header by using the DNS domain of a receiving ADMD as the authserv-id token, then claim in the rest of the value that the message was properly authenticated. The non-conformant MTA wouldn't strip that fake header, and the MUA could trust it when it shouldn't ๐.
That's why an MUA should not have processing of the Authentication-Results header field enabled by default. Instead it should be ignored, at least for filtering decisions, unless a user or administrator specifically turns it on after verifying that the border MTA is compliant ๐ง. It's totally acceptable for an MUA to know about this spec and keep an explicit list of hostnames whose Authentication-Results header fields are trustworthy, but that list should start out empty ๐ซถ.
Proposed alternate solutions to this problem are still nascent ๐ฑ:
- Possibly the simplest is a digital signature protecting the header field, such as using [DKIM], that can be verified by an MUA by using a posted public key. Even though one of the main purposes of this memo is to relieve the burden of doing message authentication work at the MUA, this only requires that the MUA learn a single authentication scheme, even if a number of them are in use at the border MTA. Note that [DKIM] requires that the
Fromheader field be signed. In this application, though, the signing agent (a trusted MTA) likely can't authenticate that value, so the fact that it is signed should be ignored ๐คทโโ๏ธ. - Another would be a means to interrogate the MTA that added the header field to see if it is actually providing any message authentication services and saw the message in question. But this isn't especially palatable given the work required to craft and implement such a scheme ๐ฌ.
- Yet another might be a method to interrogate the internal MTAs that apparently handled the message (based on
Received:header fields) to determine whether any of them conform to Section 5 of this memo. This, too, has potentially high barriers-to-entry ๐ง. - Extensions to [IMAP], [SMTP], and [POP3] could be defined to allow an MUA or filtering agent to acquire the
authserv-idin use within an ADMD, thus allowing it to identify whichAuthentication-Resultsheader fields it can trust ๐. - On the presumption that internal MTAs are fully compliant with Section 3.6 of [MAIL], and the compliant internal MTAs are using their own host names or the ADMD's DNS domain name as the
authserv-idtoken, the header field proposed here should always appear above aReceived:header added by a trusted MTA. This can be used as a test for header field validity โ .
Support for some of these is planned for future work ๐๏ธ.
In any case, a mechanism needs to exist for an MUA or filter to verify that the host that appears to have added the header field (a) actually did so, and (b) is legitimately adding that header field for this delivery. Given the variety of messaging environments deployed today, consensus appears to be that specifying a particular mechanism for doing so is not appropriate for this memo. no pressure, but this is a whole vibe ๐
Mitigation of the forged header field attack can also be accomplished by moving the authentication results data into meta-data associated with the message. In particular, an [SMTP] extension could be established to communicate authentication results from the border MTA to intermediate and delivery MTAs. The latter could arrange to store the authentication results as meta-data, retrieved and rendered along with the message by an [IMAP] client aware of a similar extension in that protocol. The delivery MTA would be told to trust data via this extension only from MTAs it trusts, and border MTAs would not accept data via this extension from any source. In an arrangement like this, there is no vector for an outside agent to forge authentication data ๐ฆ.
7.2. Misleading Results ๐ต๏ธโโ๏ธ
Until some form of service for querying the reputation of a sending agent is widely deployed, the existence of this header field indicating a "pass" does not make the message trustworthy. Not it ๐ โโ๏ธ. A piece of spam or other undesirable mail can pass checks by several of the methods enumerated above. For example, a piece of spam signed using [DKIM] by the originator of the spam, which might be a spammer or a compromised system, can totally slide through ๐. This issue is not resolved by the forged header field removal discussed above, either.
So MUAs and downstream filters must take some care with use of this header, even after possibly malicious headers are scrubbed. main character energy is not the same as being trustworthy, babes โจ
7.3. Header Field Position ๐
Despite the requirements of [MAIL], header fields can sometimes be reordered en route by intermediate MTAs. The goal of requiring header field addition only at the top of a message is an acknowledgement that some MTAs do reorder header fields, but most do not. So, in the general case, there will be some indication of which MTAs (if any) handled the message after the addition of the header field defined here ๐.
7.4. Reverse IP Query Denial-of-Service Attacks ๐ฉ๏ธ
Section 5.5 of [SPF] describes a DNS-based denial-of-service attack for verifiers that attempt DNS-based identity verification of arriving client connections. A verifier wishing to do this check and report this information SHOULD take care not to go to unbounded lengths to resolve "A" and "PTR" queries. MUAs or other filters making use of an "iprev" result specified by this memo SHOULD be aware of the algorithm used by the verifier reporting the result, and thus be aware of its limitations ๐ง .
7.5. Mitigation of Backscatter ๐ฌ
Failing to follow the instructions of Section 4.2 can result in a denial-of-service attack caused by the generation of [DSN] messages (or equivalent) to addresses that did not send the messages being rejected. Yikes, that's a whole chaos gremlin ๐พ.
7.6. Internal MTA Lists ๐
Section 5 describes a procedure for scrubbing headers that may contain forged authentication results about a message. A compliant installation will have to include, at each MTA, a list of other MTAs known to be compliant and trustworthy. Failing to keep this list current as internal infrastructure changes may expose an ADMD to attack ๐จ.
7.7. Attacks against Authentication Methods ๐ฅท
If an attack becomes known against an authentication method, then clearly the agent verifying that method can be fooled into thinking an inauthentic message is authentic, and thus the value of this header field can be misleading ๐ต. It follows that any attack against the authentication methods supported by this document (and later amendments to it) is also a security consideration here.
7.8. Intentionally Malformed Header Fields ๐งจ
It is possible for an attacker to add an Authentication-Results header field that is extraordinarily large or otherwise malformed, in an attempt to discover or exploit weaknesses in header field parsing code. Implementors must thoroughly verify all such header fields received from MTAs, and be robust against intentionally as well as unintentionally malformed header fields ๐ก๏ธ. this is the part where parsers get humbled ๐
7.9. Compromised Internal Hosts ๐ฆ
An internal MUA or MTA that has been compromised could generate mail with a forged From header field and a forged Authentication-Results header field that endorses it. Although it is clearly a larger concern to have compromised internal machines than it is to prove the value of this header field, this risk can be mitigated by arranging that internal MTAs will remove this header field if it claims to have been added by a trusted border MTA (as described above), yet the [SMTP] connection is not coming from an internal machine known to be running an authorized MTA. However, in such a configuration, legitimate MTAs will have to add this header field when legitimate internal-only messages are generated. This is also covered in Section 5 ๐.
7.10. Encapsulated Instances ๐ฆ
[MIME] messages may contain attachments of type "message/rfc822", which contain other [MAIL] messages. Such an encapsulated message may also contain an Authentication-Results header field. Although the processing of these is outside of the intended scope of this document (see Section 1.3), some early guidance to MUA developers is appropriate here ๐.
Since MTAs are unlikely to strip Authentication-Results header fields after mailbox delivery, MUAs are advised in Section 4.1 to ignore such instances within [MIME] attachments. Moreover, when extracting a message digest to separate mail store messages or other media, such header fields should be removed so that they will never be interpreted improperly by MUAs that might later consume them ๐งน.
7.11. Reverse Mapping ๐
Although Section 3 of this memo includes explicit support for the "iprev" method, its value as an authentication mechanism is limited. Implementors of both this proposal and agents that use the data it relays are encouraged to become familiar with the issues raised by [DNSOP-REVERSE] when deciding whether or not to include support for "iprev" ๐.
8. References ๐
8.1. Normative References ๐โจ
okay bestie, these are the docs this spec literally can't function without, so here they are ๐
[ABNF]Crocker, D. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008.[IANA-HEADERS]Klyne, G., Nottingham, M., and J. Mogul, "Registration Procedures for Message Header Fields", BCP 90, RFC 3864, September 2004.[KEYWORDS]Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.[MAIL]Resnick, P., Ed., "Internet Message Format", RFC 5322, October 2008.[MIME]Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, November 1996.
8.2. Informative References ๐ง
these ones are the extra reading. not strictly required, but they're where the context lives, and honestly they're so worth a look ๐ธ
[AUTH]Siemborski, R. and A. Melnikov, "SMTP Service Extension for Authentication", RFC 4954, July 2007.[DKIM]Allman, E., Callas, J., Delany, M., Libbey, M., Fenton, J., and M. Thomas, "DomainKeys Identified Mail (DKIM) Signatures", RFC 4871, May 2007.[DNS]Mockapetris, P., "Domain names - implementation and specification", STD 13, RFC 1035, November 1987.[DNS-IP6]Thomson, S., Huitema, C., Ksinant, V., and M. Souissi, "DNS Extensions to Support IP Version 6", RFC 3596, October 2003.[DNSOP-REVERSE]Senie, D. and A. Sullivan, "Considerations for the use of DNS Reverse Mapping", Work in Progress, March 2008.[DOMAINKEYS]Delany, M., "Domain-Based Email Authentication Using Public Keys Advertised in the DNS (DomainKeys)", RFC 4870, May 2007.[DSN]Moore, K. and G. Vaudreuil, "An Extensible Message Format for Delivery Status Notifications", RFC 3464, January 2003.[EMAIL-ARCH]Crocker, D., "Internet Mail Architecture", Work in Progress, October 2008.[IANA-CONSIDERATIONS]Narten, T. and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 5226, May 2008.[IMAP]Crispin, M., "INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1", RFC 3501, March 2003.[POP3]Myers, J. and M. Rose, "Post Office Protocol - Version 3", STD 53, RFC 1939, May 1996.[SECURITY]Rescorla, E. and B. Korver, "Guidelines for Writing RFC Text on Security Considerations", BCP 72, RFC 3552, July 2003.[SENDERID]Lyon, J. and M. Wong, "Sender ID: Authenticating E-Mail", RFC 4406, April 2006.[SMTP]Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, October 2008.[SPF]Wong, M. and W. Schlitt, "Sender Policy Framework (SPF) for Authorizing Use of Domains in E-Mail, Version 1", RFC 4408, April 2006.
Appendix A. Legacy MUAs ๐
okay so here's the thing, lots of MUAs (mail apps) are never gonna get updated to understand this new header field and what it means ๐ญ so for convenience and faster adoption, a delivery MTA might wanna add stuff that the existing MUAs already process, alongside the Authentication-Results header field. one idea is to put a Priority header field on messages that don't already have one, with a value that reflects how strong the authentication was. so "low" for weak or no authentication, and "normal" or "high" for good or strong authentication. cute workaround, no notes ๐ง
some modern MUAs can already filter based on what's in this header field. but people are obsessed with the idea of MUAs showing a graphical representation of what it means for end users, and honestly same ๐ until that exists, other interim ways of showing authentication results might be needed while this proposal and its successors get adopted โจ
Appendix B. Authentication-Results Examples ๐
this section is the fun part! it's got examples of how this header field gets used to show authentication results ๐
B.1. Trivial Case; Header Field Not Present ๐ฆ
the trivial case, bestie:
Received: from mail-router.example.com
(mail-router.example.com [192.0.2.1])
by server.example.org (8.11.6/8.11.6)
with ESMTP id g1G0r1kA003489;
Fri, Feb 15 2002 17:19:07 -0800
From: sender@example.com
Date: Fri, Feb 15 2002 16:54:30 -0800
To: receiver@example.org
Message-Id: <12345.abc@example.com>
Subject: here's a sample
Hello! Goodbye!
Example 1: Trivial case
the "Authentication-Results" header field is completely absent ๐ so the MUA may make no conclusion about whether the message is valid. that could happen because the message authentication services weren't available at delivery time, or no service is provided at all, or the MTA just isn't complying with this spec.
B.2. Nearly Trivial Case; Service Provided, But No Authentication Done ๐
a message delivered by an MTA that follows this spec but doesn't actually do any message authentication:
Authentication-Results: example.org; none
Received: from mail-router.example.com
(mail-router.example.com [192.0.2.1])
by server.example.org (8.11.6/8.11.6)
with ESMTP id g1G0r1kA003489;
Fri, Feb 15 2002 17:19:07 -0800
From: sender@example.com
Date: Fri, Feb 15 2002 16:54:30 -0800
To: receiver@example.org
Message-Id: <12345.abc@example.com>
Subject: here's a sample
Hello! Goodbye!
Example 2: Header present but no authentication done
so the "Authentication-Results" header field is there, which shows the delivering MTA follows this spec ๐ซถ it used its DNS domain name as the authserv-id. the presence of "none" (and no method or result tokens) means no message authentication was done.
B.3. Service Provided, Authentication Done โญ
a message delivered by an MTA that follows this spec and did apply some message authentication:
Authentication-Results: example.com;
spf=pass smtp.mailfrom=example.net
Received: from dialup-1-2-3-4.example.net
(dialup-1-2-3-4.example.net [192.0.2.200])
by mail-router.example.com (8.11.6/8.11.6)
with ESMTP id g1G0r1kA003489;
Fri, Feb 15 2002 17:19:07 -0800
From: sender@example.net
Date: Fri, Feb 15 2002 16:54:30 -0800
To: receiver@example.com
Message-Id: <12345.abc@example.net>
Subject: here's a sample
Hello! Goodbye!
Example 3: Header reporting results
the "Authentication-Results" header field is present, which means the border MTA follows this spec ๐ the authserv-id is again the DNS domain name. the message was also authenticated by that MTA using the method in [SPF]. since that method can't authenticate the local-part, it got left out of the result's value ๐ the MUA could pull out and pass along that extra info if it wanted to.
B.4. Service Provided, Several Authentications Done, Single MTA ๐
a message relayed inbound through one MTA that follows this spec and ran three different message authentication checks, slay ๐
Authentication-Results: example.com;
auth=pass (cram-md5) smtp.auth=sender@example.com;
spf=pass smtp.mailfrom=example.com
Authentication-Results: example.com;
sender-id=pass header.from=example.com
Received: from dialup-1-2-3-4.example.net (8.11.6/8.11.6)
(dialup-1-2-3-4.example.net [192.0.2.200])
by mail-router.example.com (8.11.6/8.11.6)
with ESMTP id g1G0r1kA003489;
Fri, Feb 15 2002 17:19:07 -0800
Date: Fri, Feb 15 2002 16:54:30 -0800
To: receiver@example.net
From: sender@example.com
Message-Id: <12345.abc@example.com>
Subject: here's a sample
Hello! Goodbye!
Example 4: Headers reporting results from one MTA
the "Authentication-Results" header field is present, showing the delivering MTA follows this spec. once again, the receiving DNS domain name is the authserv-id. the sender also authenticated herself/himself to the MTA using a method from [AUTH], and both the [SPF] and [SENDERID] checks ran and passed ๐ฅ the MUA could pull out and pass along this extra info if it wanted.
two "Authentication-Results" header fields aren't required here, since the same host did all of the checking. the authenticating agent could've combined all the results into one header field, no cap ๐
this example is basically a remote user on a dialup connection (example.net) sending mail to a border MTA (example.com) and using SMTP authentication to prove who they are ๐ง the dialup provider was explicitly authorized to relay mail as "example.com", which is why the SPF and SenderID checks both came back as passes ๐ฆ
B.5. Service Provided, Several Authentications Done, Different MTAs
okay so this one is a message that got relayed inbound by two different MTAs that both follow this spec and ran multiple message authentication checks ๐โจ
Authentication-Results: example.com;
sender-id=hardfail header.from=example.com;
dkim=pass (good signature) header.i=sender@example.com
Received: from mail-router.example.com
(mail-router.example.com [192.0.2.1])
by auth-checker.example.com (8.11.6/8.11.6)
with ESMTP id i7PK0sH7021929;
Fri, Feb 15 2002 17:19:22 -0800
Authentication-Results: example.com;
auth=pass (cram-md5) smtp.auth=sender@example.com;
spf=hardfail smtp.mailfrom=example.com
Received: from dialup-1-2-3-4.example.net
(dialup-1-2-3-4.example.net [192.0.2.200])
by mail-router.example.com (8.11.6/8.11.6)
with ESMTP id g1G0r1kA003489;
Fri, Feb 15 2002 17:19:07 -0800
DKIM-Signature: v=1; a=rsa-sha256; s=gatsby; d=example.com;
i=sender@example.com; t=1188964191; c=simple/simple;
h=From:Date:To:Message-Id:Subject;
bh=sEuZGD/pSr7ANysbY3jtdaQ3Xv9xPQtS0m70;
b=EToRSuvUfQVP3Bkz ... rTB0t0gYnBVCM=
From: sender@example.com
Date: Fri, Feb 15 2002 16:54:30 -0800
To: receiver@example.com
Message-Id: <12345.abc@example.com>
Subject: here's a sample
Hello! Goodbye!
Example 5: Headers reporting results from multiple MTAs
The Authentication-Results header field is there, which shows this message follows the spec ๐
Once again, the authserv-id is the recipient's DNS domain name. The header field shows up twice because two different MTAs in the delivery chain ran authentication tests ๐ฆ
The first one, "mail-router.example.com", says [AUTH] and [SPF] were both used. [AUTH] passed, but [SPF] failed. For the [AUTH] result, there's extra info in the comment field, which the MUA can choose to show if it wants ๐
The second MTA, "auth-checker.example.com", says it ran a [SENDERID] test (which failed) and a [DKIM] test (which passed). Again, one of the tests comes with extra details in a comment, which the MUA may choose to render ๐ธ
Since two different hosts did these two sets of checks, the header fields can't be merged in this example ๐
This one is a super typical case of mail coming into "example.com" from a user on a dialup connection at "example.net" ๐ The user seems legit because they had a valid password, so [AUTH] worked at the border MTA. The [SPF] and [SENDERID] tests failed since "example.com" never gave "example.net" permission to relay mail for it ๐ But the [DKIM] test passed, because the sending user had a private key that matched one of "example.com"'s published public keys and used it to sign the message ๐โจ
B.6. Service Provided, Multi-Tiered Authentication Done
this is a message that got authenticated at several stages, and one of those stages was outside the receiving ADMD ๐ง
Authentication-Results: example.com;
dkim=pass (good signature) header.i=@mail-router.example.net;
dkim=fail (bad signature) header.i=@newyork.example.com
Received: from mail-router.example.net
(mail-router.example.net [192.0.2.250])
by chicago.example.com (8.11.6/8.11.6)
for <recipient@chicago.example.com>
with ESMTP id i7PK0sH7021929;
Fri, Feb 15 2002 17:19:22 -0800
DKIM-Signature: v=1; a=rsa-sha256; s=furble;
d=mail-router.example.net; t=1188964198; c=relaxed/simple;
h=From:Date:To:Message-Id:Subject:Authentication-Results;
bh=ftA9J6GtX8OpwUECzHnCkRzKw1uk6FNiLfJl5Nmv49E=;
b=oINEO8hgn/gnunsg ... 9n9ODSNFSDij3=
Authentication-Results: example.net;
dkim=pass (good signature) header.i=@newyork.example.com
Received: from smtp.newyork.example.com
(smtp.newyork.example.com [192.0.2.220])
by mail-router.example.net (8.11.6/8.11.6)
with ESMTP id g1G0r1kA003489;
Fri, Feb 15 2002 17:19:07 -0800
DKIM-Signature: v=1; a=rsa-sha256; s=gatsby; d=newyork.example.com;
t=1188964191; c=simple/simple;
h=From:Date:To:Message-Id:Subject;
bh=sEu28nfs9fuZGD/pSr7ANysbY3jtdaQ3Xv9xPQtS0m7=;
b=EToRSuvUfQVP3Bkz ... rTB0t0gYnBVCM=
From: sender@newyork.example.com
Date: Fri, Feb 15 2002 16:54:30 -0800
To: meetings@example.net
Message-Id: <12345.abc@newyork.example.com>
Subject: here's a sample
Example 6: Headers reporting results from multiple MTAs in different ADMDs
this one is multi-tiered authentication with an extended trust boundary ๐
The message was sent by someone in example.com's New York office (newyork.example.com) to a mailing list run by an intermediary. It was signed at the origin using [DKIM] โ๏ธ
The mailing list goes through a provider called example.net, which example.com uses. There, meetings@example.net gets expanded into a long list of recipients, one of whom is at the Chicago office. For this example, we'll assume that the trust boundary for chicago.example.com includes the mailing list server at example.net ๐ซถ
The mailing list server there authenticated the message first and added an Authentication-Results header field saying so, using its DNS domain name as the authserv-id. Then it changed the message by adding some footer text to the body, including admin stuff like unsubscribe instructions ๐ Last, the mailing list server adds a second [DKIM] signature and starts sending the message out ๐ฌ
The border MTA for chicago.example.com explicitly trusts results from mail-router.example.net, so that header field doesn't get removed. It checks both signatures and finds that the first one (the most recent) is a "pass". But because of those changes, the second one is a "fail". Still, the first signature covered the Authentication-Results header added at mail-router.example.net, and that header recorded the validation of the second signature. So, indirectly, you can tell that the authentications claimed by both signatures are actually valid ๐
Appendix C. Operational Considerations about Message Authentication
this whole proposal is built on the idea that authentication (and, presumably in the future, reputation) work is usually done by border MTAs, not by MUAs or intermediate MTAs. Those later ones just use the results the border MTAs figured out ๐ง Is this required to take part in email or message authentication? Nope, not at all. But the work in this proposal, and how it's been deployed so far, is based on that model. The assumption covers a few common ADMD needs:
- Service operators want to deal with problem messages as close to the ADMD border as they can. For example, that lets messages get rejected at the SMTP level instead of generating a DSN internally ๐ โโ๏ธ So if you do any authentication or reputation work only at the MUA or an intermediate MTA, that goal just isn't reachable.
- Border MTAs are more likely to have direct access to outside sources of authentication or reputation info, since modern MUAs tend to be heavily firewalled ๐งฑ That means some MUAs might not even be able to finish authentication or reputation checks without complicated proxy setups or similar hassles.
- MUAs depend on the upstream MTAs inside their trust boundaries to make correct (as correct as possible) judgments about the message's envelope, header, and content ๐โโ๏ธ So MUAs don't need to know how to do what the upstream MTAs do. They only need the results.
- Judging a message's quality, from simple token matching (like a list of preferred DNS domains) to cryptanalysis (like public/private key work), is at least a little bit expensive, so it should be kept to a minimum ๐ธ That's why doing those tests at the border MTA is way better than doing them at every MUA that handles the message. If an ADMD sticks to common messaging protocols, a reputation query or authentication check run by a border MTA gives the same result as the same query run by an MUA. But in an environment where the MUA does the work, a message arriving for several recipients would make authentication or reputation evaluation happen more than once for the same message (once at each MUA). That causes needless amplification of resource use and creates a possible denial-of-service attack vector ๐ฌ
- Minimizing change is good ๐ฟ As new authentication and reputation methods show up, the list of methods supported by this header field would presumably get extended. If MUAs just consume the contents of this header field instead of actually trying to do authentication and/or reputation work, then MUAs only have to learn to parse this header field once. A new method then needs only a configuration change at the MUAs and software changes at the MTAs, which are presumably fewer in number. When deciding whether to put these functions in MTAs or MUAs, you have to think about individual flexibility, infrastructure inertia, and the scale of effort ๐ค It's usually easier to change a single MUA than an MTA, because the change affects fewer users and can be done with less care. But changing many MUAs is more work than changing a smaller number of MTAs.
- For decisions that affect message delivery and display, assessment based on authentication and reputation works best close to the time of message transit, while the message is on its way to a user's inbox, not afterwards โณ DKIM keys and IP address reputations, etc., can change over time or even become invalid, and users can take a long time to read a message once it's delivered. So the value of this work drops, maybe quickly, once delivery is done. That seriously lowers the value of doing this work anywhere other than at MTAs ๐
Many operational choices are possible within an ADMD, including where authentication and/or reputation assessment happens ๐บ๏ธ The current specification doesn't dictate any of those choices. Instead, it makes things easier in the cases where information produced at one stage of analysis needs to travel with the message to the next stage ๐
Acknowledgements โจ
Huge shoutout ๐ฃ to everyone who reviewed this proposal and gave honest, constructive criticism, because that's how good specs get made ๐ซถ. The author is grateful to Eric Allman, Mark Delany, Victor Duchovni, Frank Ellermann, Jim Fenton, Philip Guenther, Tony Hansen, Paul Hoffman, Scott Kitterman, Eliot Lear, John Levine, Miles Libbey, Charles Lindsey, Alexey Melnikov, Douglas Otis, Juan Altmayer Pizzorno, Michael Thomas, and Kazu Yamamoto ๐.
Special thanks ๐ go to Dave Crocker and S. Moonesamy for their logistical support, and for their feedback and contributions to the many proposed edits over the whole life of this work ๐ .
Author's Address ๐ฆ
The author is Murray S. Kucherawy, who was at Sendmail, Inc. when this was written ๐ธ. Here's how to reach them:
Murray S. Kucherawy
Sendmail, Inc.
6475 Christie Ave., Suite 350
Emeryville, CA 94608
US
Phone: +1 510 594 5400
EMail: msk+ietf@sendmail.com
๐ฆ where this page comes from
- ietf: rfc5451 2009-04
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms