2. Definition and Format of the Header Field This section gives a general overview of the format of the header field being defined and then provides a formal specification. 2.1. General Description The header field specified here is called "Authentication-Results". It is a structured header field as defined in "Internet Message Format" [MAIL], and thus all of the related definitions in that document apply. This header field is added at the top of the message as it transits MTAs that do authentication checks, so some idea of how far away the checks were done can be inferred. It is therefore considered to be a trace field as defined in [MAIL], and thus all of the related definitions in that document apply. The value of the header field (after removing comments) consists of an authentication service identifier, an optional version, and then a series of statements and supporting data. The statements are of the form "method=result" and indicate which authentication method or methods were applied and their respective results. For each such statement, the supporting data can include a "reason" string and one or more "property=value" statements indicating which message properties were evaluated to reach that conclusion.
The header field can appear more than once in a single message, more than one result can be represented in a single header field, or a combination of these can be applied. 2.2. Formal Definition Formally, the header field is specified as shown below using Augmented Backus-Naur Form [ABNF]. Examples of valid header fields with explanations of their semantics can be found in Appendix B. authres-header-field = "Authentication-Results:" authres-payload authres-payload = [CFWS] authserv-id [ CFWS authres-version ] ( no-result / 1*resinfo ) [CFWS] CRLF authserv-id = value ; see below for a description of this element authres-version = 1*DIGIT [CFWS] ; indicates which version of this specification is in use; ; this specification is version "1", and the absence of a ; version implies this version of the specification no-result = [CFWS] ";" [CFWS] "none" ; the special case of "none" is used to indicate that no ; message authentication was performed resinfo = [CFWS] ";" methodspec [ CFWS reasonspec ] [ CFWS 1*propspec ] methodspec = [CFWS] method [CFWS] "=" [CFWS] result ; indicates which authentication method was evaluated ; and what its output was 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
method = Keyword [ [CFWS] "/" [CFWS] method-version ] ; a method indicates which method's result is ; represented by "result"; it is one of the methods ; explicitly defined as valid in this document ; or is an extension method as defined below method-version = 1*DIGIT [CFWS] ; indicates which version of the method specification is ; in use, corresponding to the matching entry in the IANA ; "Email Authentication Methods" registry; a value of "1" ; is assumed if this version string is absent result = Keyword ; indicates the results of the attempt to authenticate ; the message; see below for details ptype = Keyword ; indicates whether the property being evaluated was ; a parameter to an SMTP command [SMTP], was a value taken ; from a message header field, was some property of ; the message body, or was some other property evaluated by ; the receiving MTA; expected to be one of the "property ; types" explicitly defined as valid, or an extension ; ptype, as defined below property = special-smtp-verb / Keyword ; indicates more specifically than "ptype" what the ; source of the evaluated property is; the exact meaning ; is specific to the method whose result is being reported ; and is defined more clearly below special-smtp-verb = "mailfrom" / "rcptto" ; special cases of SMTP commands [SMTP] that are made up ; of multiple words pvalue = [CFWS] ( value / [ [ local-part ] "@" ] domain-name ) [CFWS] ; the value extracted from the message property defined ; by the "ptype.property" construction "local-part" is defined in Section 3.4.1 of [MAIL], as modified by [RFC6531]. "CFWS" is defined in Section 3.2.2 of [MAIL].
"Keyword" is defined in Section 4.1.2 of [SMTP]. It is further constrained by the necessity of being registered in the Internet Assigned Numbers Authority (IANA) registry relevant to the context in which it is used. See Sections 2.3, 2.7, and 6. The "value" is as defined in Section 5.1 of [MIME], with "quoted-string" updated as specified in [RFC6532]. The "domain-name" is as defined in Section 3.5 of [DKIM]. See Section 2.5 for a description of the authserv-id element. If the value portion of a "pvalue" construction identifies something intended to be an email identity, then it MUST use the right-hand portion of that ABNF definition. The list of commands eligible for use with the "smtp" ptype can be found in Section 4.1 of [SMTP]. The "propspec" may be omitted if, for example, the method was unable to extract any properties to do its evaluation yet still has a result to report. It may also be omitted if the agent generating this result wishes not to reveal such properties to downstream agents. Where an SMTP command name is being reported as a "property", the agent generating the header field represents that command by converting it to lowercase and dropping any spaces (e.g., "MAIL FROM" becomes "mailfrom", "RCPT TO" becomes "rcptto", etc.). A "ptype" value of "policy" indicates a policy decision about the message not specific to a property of the message that could be extracted. See Section 2.4 for details. Examples of complete messages using this header field can be found in Appendix B. 2.3. Property Types (ptypes) and Properties The "ptype" in the ABNF above indicates the general type of property being described by the result being reported, upon which the reported result was based. Coupled with the "property", which is more specific, it indicates from where the reported "pvalue" was extracted. This can include a particular part of the message header or body, some part of the SMTP session, a secondary output of an authentication method (apart from its pure result), or some other aspect of the message's handling.
Combinations of ptypes and properties are registered and described in the "Email Authentication Methods" registry, coupled with the authentication methods with which they are used. This is further described in Section 6. Legal values of "ptype" are as defined in the IANA "Email Authentication Property Types" registry, created by [RFC7410]. The initial values and what they typically indicate are as follows, based on [RFC7001]: body: Information that was extracted from the body of the message. This might be an arbitrary string of bytes, a hash of a string of bytes, a Uniform Resource Identifier, or some other content of interest. The "property" is an indication of where within the message body the extracted content was found and can indicate an offset, identify a MIME part, etc. (At the time of this revision, no properties matching this ptype have been registered. Accordingly, this ptype may be deprecated in the future.) header: Indicates information that was extracted from the header of the message. This might be the value of a header field or some portion of a header field. The "property" gives a more precise indication of the place in the header from which the extraction took place. policy: A local policy mechanism was applied that augments or overrides the result returned by the authentication mechanism. (See Section 2.4.) smtp: Indicates information that was extracted from an SMTP command that was used to relay the message. The "property" indicates which SMTP command included the extracted content as a parameter. Results reported using unknown ptypes MUST NOT be used in making handling decisions. They can be safely ignored by consumers. Entries in the "Email Authentication Methods" registry can define properties that deviate from these definitions when appropriate. Such deviations need to be clear in the registry and/or in the defining document. See Section 2.7.1 for an example.
2.4. The "policy" ptype A special ptype value of "policy" is also defined. This ptype is provided to indicate that some local policy mechanism was applied that augments or even replaces (i.e., overrides) the result returned by the authentication mechanism. The property and value in this case identify the local policy that was applied and the result it returned. For example, a DKIM signature is not required to include the Subject header field in the set of fields that are signed. An ADMD receiving such a message might decide that such a signature is unacceptable, even if it passes, because the content of the Subject header field could be altered post-signing without invalidating the signature. Such an ADMD could replace the DKIM "pass" result with a "policy" result and then also include the following in the corresponding Authentication-Results field: ... dkim=policy policy.dkim-rules=unsigned-subject ... In this case, the property is "dkim-rules", indicating that some local check by that name took place and that check returned a result of "unsigned-subject". These are arbitrary names selected by (and presumably used within) the ADMD making use of them, so they are not normally registered with IANA or otherwise specified apart from setting syntax restrictions that allow for easy parsing within the rest of the header field. This ptype existed in the original specification for this header field [RFC5451], but without a complete description or example of intended use. As a result, it has not seen any practical use to date that matches its intended purpose. These added details are provided to guide implementers toward proper use. 2.5. Authentication Service Identifier Field Every Authentication-Results header field has an authentication service identifier field (authserv-id above). Specifically, this is any string intended to identify the authentication service within the ADMD that conducted authentication checks on the message. This identifier is intended to be machine-readable and not necessarily meaningful to users. Note that in an EAI-formatted message, this identifier may be expressed in UTF-8.
Since agents consuming this field will use this identifier to determine whether its contents are of interest (and are safe to use), the uniqueness of the identifier MUST be guaranteed by the ADMD that generates it and MUST pertain to that ADMD. MUAs or downstream filters SHOULD use this identifier to determine whether or not the data contained in an Authentication-Results header field ought to be used or ignored. For simplicity and scalability, the authentication service identifier SHOULD be a common token used throughout the ADMD. Common practice is to use the DNS domain name used by or within that ADMD, sometimes called the "organizational domain", but this is not strictly necessary. For tracing and debugging purposes, the authentication service identifier can instead be the specific hostname of the MTA performing the authentication check whose result is being reported. Moreover, some implementations define a substructure to the identifier; such structures are outside of the scope of this specification. Note, however, that using a local, relative identifier like a flat hostname, rather than a hierarchical and globally unique ADMD identifier like a DNS domain name, makes configuration more difficult for large sites. The hierarchical identifier permits aggregating related, trusted systems together under a single, parent identifier, which in turn permits assessing the trust relationship with a single reference. The alternative is a flat namespace requiring individually listing each trusted system. Since consumers will use the identifier to determine whether to use the contents of the header field: o Changes to the identifier impose a large, centralized administrative burden. o Ongoing administrative changes require constantly updating this centralized table, making it difficult to ensure that an MUA or downstream filter will have access to accurate information for assessing the usability of the header field's content. In particular, consumers of the header field will need to know not only the current identifier(s) in use but previous ones as well to account for delivery latency or later reassessment of the header field's content. Examples of valid authentication service identifiers are "example.com", "mail.example.org", "ms1.newyork.example.com", and "example-auth".
2.6. Version Tokens The grammar above provides for the optional inclusion of versions on both the header field itself (attached to the authserv-id token) and on each of the methods being reported. The method version refers to the method itself, which is specified in the documents describing those methods, while the authserv-id version refers to this document and thus the syntax of this header field. The purpose of including these is to avoid misinterpretation of the results. That is, if a parser finds a version after an authserv-id that it does not explicitly know, it can immediately discontinue trying to parse, since what follows might not be in an expected format. For a method version, the parser SHOULD ignore a method result if the version is not supported in case the semantics of the result have a different meaning than what is expected. For example, if a hypothetical DKIM version 2 yielded a "pass" result for different reasons than version 1 does, a consumer of this field might not want to use the altered semantics. Allowing versions in the syntax is a way to indicate this and let the consumer of the header field decide. 2.7. Defined Methods and Result Values Each individual authentication method returns one of a set of specific result values. The subsections below provide references to the documents defining the authentication methods specifically supported by this document, and their corresponding result values. Verifiers SHOULD use these values as described below. New methods not specified in this document, but intended to be supported by the header field defined here, MUST include a similar result table either in their defining documents or in supplementary ones. 2.7.1. DKIM DKIM is represented by the "dkim" method and is defined in [DKIM]. A signature is "acceptable to the ADMD" if it passes local policy checks (or there are no specific local policy checks). For example, an ADMD policy might require that the signature(s) on the message be added using the DNS domain present in the From header field of the message, thus making third-party signatures unacceptable even if they verify.
The DKIM result set is as follows: none: The message was not signed. pass: The message was signed, the signature or signatures were acceptable to the ADMD, and the signature(s) passed verification tests. fail: The message was signed and the signature or signatures were acceptable to the ADMD, but they failed the verification test(s). policy: The message was signed, but some aspect of the signature or signatures was not acceptable to the ADMD. neutral: The message was signed, but the signature or signatures contained syntax errors or were not otherwise able to be processed. This result is also used for other failures not covered elsewhere in this list. temperror: The message could not be verified due to some error that is likely transient in nature, such as a temporary inability to retrieve a public key. A later attempt may produce a final result. permerror: The message could not be verified due to some error that is unrecoverable, such as a required header field being absent. A later attempt is unlikely to produce a final result. DKIM results are reported using a ptype of "header". The property, however, represents one of the tags found in the DKIM-Signature header field rather than a distinct header field. For example, the ptype-property combination "header.d" refers to the content of the "d" (signing domain) tag from within the signature header field, and not a distinct header field called "d". Note that in an EAI-formatted message, the values of the "d" and "i" properties can be expressed in UTF-8. In addition to previous registrations, this document registers the DKIM tags "a" (cryptographic algorithm used to sign the message) and "s" (selector) as reportable properties. These can be used to aid receivers during post-verification processing. In particular, [RFC8301] obsoleted use of the "rsa-sha1" algorithm in DKIM, so it is important to be able to distinguish such signatures from those using preferred algorithms. The ability to report different DKIM results for a message with multiple signatures is described in [RFC6008].
[DKIM] advises that if a message fails verification, it is to be treated as an unsigned message. A report of "fail" here permits the receiver of the report to decide how to handle the failure. A report of "neutral" or "none" preempts that choice, ensuring that the message will be treated as if it had not been signed. 2.7.2. SPF SPF uses the "spf" method name. The result values for SPF are defined in Section 2.6 of [SPF], and those definitions are included here by reference: +-----------+------------------------------+ | Code | Meaning | +-----------+------------------------------+ | none | [SPF], Section 2.6.1 | +-----------+------------------------------+ | pass | [SPF], Section 2.6.3 | +-----------+------------------------------+ | fail | [SPF], Section 2.6.4 | +-----------+------------------------------+ | softfail | [SPF], Section 2.6.5 | +-----------+------------------------------+ | policy | RFC 8601, Section 2.4 | +-----------+------------------------------+ | neutral | [SPF], Section 2.6.2 | +-----------+------------------------------+ | temperror | [SPF], Section 2.6.6 | +-----------+------------------------------+ | permerror | [SPF], Section 2.6.7 | +-----------+------------------------------+ These result codes are used in the context of this specification to reflect the result returned by the component conducting SPF evaluation. For SPF, the ptype used is "smtp", and the property is either "mailfrom" or "helo", since those values are the ones SPF can evaluate. (If the SMTP client issued the EHLO command instead of HELO, the property used is "helo".) Note that in an EAI-formatted message, the local-part of the "mailfrom" can be expressed in UTF-8 and the domain part can be expressed as a U-label. For this method, an additional result of "policy" is defined, which means the client was authorized to inject or relay mail on behalf of the sender's DNS domain according to the authentication method's
algorithm, but local policy dictates that the result is unacceptable. For example, "policy" might be used if SPF returns a "pass" result, but a local policy check matches 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 do not 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 this mechanism SHOULD NOT include the local-part or the following "@" character. 2.7.3. "iprev" The result values used by the "iprev" method, defined in Section 3, are as follows: pass: The DNS evaluation succeeded, i.e., the "reverse" and "forward" lookup results were returned and were in agreement. fail: The DNS evaluation failed. In particular, the "reverse" and "forward" lookups each produced results, but they were not in agreement, or the "forward" query completed but produced no result, e.g., a DNS RCODE of 3, commonly known as NXDOMAIN, or an RCODE of 0 (NOERROR) in a reply containing no answers, was returned. temperror: The DNS evaluation could not be completed due to some error that is likely transient in nature, such as a temporary DNS error, e.g., a DNS RCODE of 2, commonly known as SERVFAIL, or other error condition resulted. A later attempt may produce a final result. permerror: The DNS evaluation could not be completed because no PTR data are published for the connecting IP address, e.g., a DNS RCODE of 3, commonly known as NXDOMAIN, or an RCODE of 0 (NOERROR) in a reply containing no answers, was returned. This prevented completion of the evaluation. A later attempt is unlikely to produce a final result. 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. The result is reported using a ptype of "policy" (as this is not part of any established protocol) and a property of "iprev". For discussion of the format of DNS replies, see "Domain names - implementation and specification" [DNS].
2.7.4. SMTP AUTH SMTP AUTH (defined in [AUTH]) is represented by the "auth" method. Its result values are as follows: none: SMTP authentication was not attempted. pass: The SMTP client authenticated to the server reporting the result using the protocol described in [AUTH]. fail: The SMTP client attempted to authenticate to the server using the protocol described in [AUTH] but was not successful (such as providing a valid identity but an incorrect password). temperror: The SMTP client attempted to authenticate using the protocol described in [AUTH] but was not able to complete the attempt due to some error that is likely transient in nature, such as a temporary directory service lookup error. A later attempt may produce a final result. permerror: The SMTP client attempted to authenticate using the protocol described in [AUTH] but was not able to complete the attempt due to some error that is likely not transient in nature, such as a permanent directory service lookup error. A later attempt is not likely to produce a final result. The result of AUTH is reported using a ptype of "smtp" and a property of either: o "auth", in which case the value is the authorization identity generated by the exchange initiated by the AUTH command; or o "mailfrom", in which case the value is the mailbox identified by the AUTH parameter used with the MAIL FROM command. Note that in an EAI-formatted message, the local-part can be expressed in UTF-8 and the domain can be expressed as a U-label. If both identities are available, both can be reported. For example, consider this command issued by a client that has completed session authentication with the AUTH command resulting in an authorized identity of "firstname.lastname@example.org": MAIL FROM:<email@example.com> AUTH=<firstname.lastname@example.org> This could result in a "resinfo" construction like so: ; auth=pass email@example.com firstname.lastname@example.org
Note that in all cases other than "pass", the message was sent by an unauthenticated client. All non-"pass" cases SHOULD thus be treated as equivalent with respect to this method. 2.7.5. Other Registered Codes Result codes were also registered in other RFCs as follows: o Vouch By Reference (in [AR-VBR], represented by "vbr"). o Authorized Third-Party Signatures (in [ATPS], represented by "dkim-atps"). o Author Domain Signing Practices (in [ADSP], represented by "dkim-adsp"). o Require-Recipient-Valid-Since (in [RRVS], represented by "rrvs"). o S/MIME (in [SMIME-REG], represented by "smime"). Note that in an EAI-formatted message, "vbr.mv" and "vbr.md", which are already registered, can be expressed as U-labels. 2.7.6. Extension Methods Additional authentication method identifiers (extension methods) may be defined in the future by later revisions or extensions to this specification. These method identifiers are registered with IANA and, preferably, published in an RFC. See Section 6 for further details. Extension methods can be defined for the following reasons: 1. To allow additional information from new authentication systems to be communicated to MUAs or downstream filters. The names of such identifiers ought to reflect the name of the method being defined but ought not be needlessly long. 2. To allow the creation of "sub-identifiers" that indicate different levels of authentication and differentiate between their relative strengths, e.g., "auth1-weak" and "auth1-strong".
Authentication method implementers are encouraged to provide adequate information, via message header field comments if necessary, to allow an MUA developer to understand or relay ancillary details of authentication results. For example, if it might be of interest to relay what data were used to perform an evaluation, such information could be relayed as a comment in the header field, such as: 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 associated with them are not documented formally. Therefore, they are subject to change at any time and 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 (unknown) method identifier. 2.7.7. Extension Result Codes Additional result codes (extension results) might be defined in the future by later revisions or extensions to this specification. Non-experimental result codes MUST be registered with IANA (and, preferably, published in an RFC). See Section 6 for further details. Experimental results MUST only be used within ADMDs that have explicitly consented to use them. These results and the parameters associated with them are not formally documented. Therefore, they are subject to change at any time and 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 extension result.