draft-ietf-dkim-rfc4871bis-15.txt   rfc6376.txt 
Network Working Group D. Crocker, Ed. Internet Engineering Task Force (IETF) D. Crocker, Ed.
Internet-Draft Brandenburg InternetWorking Request for Comments: 6376 Brandenburg InternetWorking
Obsoletes: 4871, 5672 T. Hansen, Ed. Obsoletes: 4871, 5672 T. Hansen, Ed.
(if approved) AT&T Laboratories Category: Standards Track AT&T Laboratories
Intended status: Standards Track M. Kucherawy, Ed. ISSN: 2070-1721 M. Kucherawy, Ed.
Expires: January 12, 2012 Cloudmark Cloudmark
July 11, 2011 September 2011
DomainKeys Identified Mail (DKIM) Signatures DomainKeys Identified Mail (DKIM) Signatures
draft-ietf-dkim-rfc4871bis-15
Abstract Abstract
DomainKeys Identified Mail (DKIM) permits a person, role, or DomainKeys Identified Mail (DKIM) permits a person, role, or
organization that owns the signing domain to claim some organization that owns the signing domain to claim some
responsibility for a message by associating the domain with the responsibility for a message by associating the domain with the
message. This can be an author's organization, an operational relay message. This can be an author's organization, an operational relay,
or one of their agents. DKIM separates the question of the identity or one of their agents. DKIM separates the question of the identity
of the signer of the message from the purported author of the of the Signer of the message from the purported author of the
message. Assertion of responsibility is validated through a message. Assertion of responsibility is validated through a
cryptographic signature and querying the signer's domain directly to cryptographic signature and by querying the Signer's domain directly
retrieve the appropriate public key. Message transit from author to to retrieve the appropriate public key. Message transit from author
recipient is through relays that typically make no substantive change to recipient is through relays that typically make no substantive
to the message content and thus preserve the DKIM signature. change to the message content and thus preserve the DKIM signature.
This memo obsoletes RFC4871 and RFC5672.
Status of this Memo This memo obsoletes RFC 4871 and RFC 5672.
This Internet-Draft is submitted in full conformance with the Status of This Memo
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering This is an Internet Standards Track document.
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months This document is a product of the Internet Engineering Task Force
and may be updated, replaced, or obsoleted by other documents at any (IETF). It represents the consensus of the IETF community. It has
time. It is inappropriate to use Internet-Drafts as reference received public review and has been approved for publication by the
material or to cite them other than as "work in progress." Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 5741.
This Internet-Draft will expire on January 12, 2012. Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc6376.
Copyright Notice Copyright Notice
Copyright (c) 2011 IETF Trust and the persons identified as the Copyright (c) 2011 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 3, line 7 skipping to change at page 2, line 29
modifications of such material outside the IETF Standards Process. modifications of such material outside the IETF Standards Process.
Without obtaining an adequate license from the person(s) controlling Without obtaining an adequate license from the person(s) controlling
the copyright in such materials, this document may not be modified the copyright in such materials, this document may not be modified
outside the IETF Standards Process, and derivative works of it may outside the IETF Standards Process, and derivative works of it may
not be created outside the IETF Standards Process, except to format not be created outside the IETF Standards Process, except to format
it for publication as an RFC or to translate it into languages other it for publication as an RFC or to translate it into languages other
than English. than English.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1. DKIM Architecture Documents . . . . . . . . . . . . . . . 6 1.1. DKIM Architecture Documents . . . . . . . . . . . . . . . 5
1.2. Signing Identity . . . . . . . . . . . . . . . . . . . . . 6 1.2. Signing Identity . . . . . . . . . . . . . . . . . . . . . 5
1.3. Scalability . . . . . . . . . . . . . . . . . . . . . . . 6 1.3. Scalability . . . . . . . . . . . . . . . . . . . . . . . 5
1.4. Simple Key Management . . . . . . . . . . . . . . . . . . 6 1.4. Simple Key Management . . . . . . . . . . . . . . . . . . 6
1.5. Data Integrity . . . . . . . . . . . . . . . . . . . . . . 7 1.5. Data Integrity . . . . . . . . . . . . . . . . . . . . . . 6
2. Terminology and Definitions . . . . . . . . . . . . . . . . . 7 2. Terminology and Definitions . . . . . . . . . . . . . . . . . 6
2.1. Signers . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.1. Signers . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2. Verifiers . . . . . . . . . . . . . . . . . . . . . . . . 7 2.2. Verifiers . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3. Identity . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.3. Identity . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.4. Identifier . . . . . . . . . . . . . . . . . . . . . . . . 8 2.4. Identifier . . . . . . . . . . . . . . . . . . . . . . . . 7
2.5. Signing Domain Identifier (SDID) . . . . . . . . . . . . . 8 2.5. Signing Domain Identifier (SDID) . . . . . . . . . . . . . 7
2.6. Agent or User Identifier (AUID) . . . . . . . . . . . . . 8 2.6. Agent or User Identifier (AUID) . . . . . . . . . . . . . 7
2.7. Identity Assessor . . . . . . . . . . . . . . . . . . . . 8 2.7. Identity Assessor . . . . . . . . . . . . . . . . . . . . 7
2.8. Whitespace . . . . . . . . . . . . . . . . . . . . . . . . 8 2.8. Whitespace . . . . . . . . . . . . . . . . . . . . . . . . 8
2.9. Imported ABNF Tokens . . . . . . . . . . . . . . . . . . . 9 2.9. Imported ABNF Tokens . . . . . . . . . . . . . . . . . . . 8
2.10. Common ABNF Tokens . . . . . . . . . . . . . . . . . . . . 9 2.10. Common ABNF Tokens . . . . . . . . . . . . . . . . . . . . 9
2.11. DKIM-Quoted-Printable . . . . . . . . . . . . . . . . . . 10 2.11. DKIM-Quoted-Printable . . . . . . . . . . . . . . . . . . 9
3. Protocol Elements . . . . . . . . . . . . . . . . . . . . . . 11 3. Protocol Elements . . . . . . . . . . . . . . . . . . . . . . 10
3.1. Selectors . . . . . . . . . . . . . . . . . . . . . . . . 11 3.1. Selectors . . . . . . . . . . . . . . . . . . . . . . . . 10
3.2. Tag=Value Lists . . . . . . . . . . . . . . . . . . . . . 13 3.2. Tag=Value Lists . . . . . . . . . . . . . . . . . . . . . 12
3.3. Signing and Verification Algorithms . . . . . . . . . . . 14 3.3. Signing and Verification Algorithms . . . . . . . . . . . 13
3.4. Canonicalization . . . . . . . . . . . . . . . . . . . . . 15 3.4. Canonicalization . . . . . . . . . . . . . . . . . . . . . 14
3.5. The DKIM-Signature Header Field . . . . . . . . . . . . . 19 3.5. The DKIM-Signature Header Field . . . . . . . . . . . . . 18
3.6. Key Management and Representation . . . . . . . . . . . . 28 3.6. Key Management and Representation . . . . . . . . . . . . 26
3.7. Computing the Message Hashes . . . . . . . . . . . . . . . 32 3.7. Computing the Message Hashes . . . . . . . . . . . . . . . 29
3.8. Input Requirements . . . . . . . . . . . . . . . . . . . . 34 3.8. Input Requirements . . . . . . . . . . . . . . . . . . . . 32
3.9. Output Requirements . . . . . . . . . . . . . . . . . . . 35 3.9. Output Requirements . . . . . . . . . . . . . . . . . . . 32
3.10. Signing by Parent Domains . . . . . . . . . . . . . . . . 35 3.10. Signing by Parent Domains . . . . . . . . . . . . . . . . 33
3.11. Relationship between SDID and AUID . . . . . . . . . . . . 36 3.11. Relationship between SDID and AUID . . . . . . . . . . . . 33
4. Semantics of Multiple Signatures . . . . . . . . . . . . . . . 37 4. Semantics of Multiple Signatures . . . . . . . . . . . . . . . 34
4.1. Example Scenarios . . . . . . . . . . . . . . . . . . . . 37 4.1. Example Scenarios . . . . . . . . . . . . . . . . . . . . 34
4.2. Interpretation . . . . . . . . . . . . . . . . . . . . . . 38 4.2. Interpretation . . . . . . . . . . . . . . . . . . . . . . 35
5. Signer Actions . . . . . . . . . . . . . . . . . . . . . . . . 39 5. Signer Actions . . . . . . . . . . . . . . . . . . . . . . . . 36
5.1. Determine Whether the Email Should Be Signed and by 5.1. Determine Whether the Email Should Be Signed and by
Whom . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Whom . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.2. Select a Private Key and Corresponding Selector 5.2. Select a Private Key and Corresponding Selector
Information . . . . . . . . . . . . . . . . . . . . . . . 39 Information . . . . . . . . . . . . . . . . . . . . . . . 37
5.3. Normalize the Message to Prevent Transport Conversions . . 40 5.3. Normalize the Message to Prevent Transport Conversions . . 37
5.4. Determine the Header Fields to Sign . . . . . . . . . . . 41 5.4. Determine the Header Fields to Sign . . . . . . . . . . . 38
5.5. Compute the Message Hash and Signature . . . . . . . . . . 45 5.5. Compute the Message Hash and Signature . . . . . . . . . . 43
5.6. Insert the DKIM-Signature Header Field . . . . . . . . . . 45 5.6. Insert the DKIM-Signature Header Field . . . . . . . . . . 43
6. Verifier Actions . . . . . . . . . . . . . . . . . . . . . . . 46 6. Verifier Actions . . . . . . . . . . . . . . . . . . . . . . . 43
6.1. Extract Signatures from the Message . . . . . . . . . . . 46 6.1. Extract Signatures from the Message . . . . . . . . . . . 44
6.2. Communicate Verification Results . . . . . . . . . . . . . 51 6.2. Communicate Verification Results . . . . . . . . . . . . . 49
6.3. Interpret Results/Apply Local Policy . . . . . . . . . . . 52 6.3. Interpret Results/Apply Local Policy . . . . . . . . . . . 50
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 51
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 53 7.1. Email Authentication Methods Registry . . . . . . . . . . 51
7.1. Email Authentication Methods Registry . . . . . . . . . . 53 7.2. DKIM-Signature Tag Specifications . . . . . . . . . . . . 51
7.2. DKIM-Signature Tag Specifications . . . . . . . . . . . . 53 7.3. DKIM-Signature Query Method Registry . . . . . . . . . . . 52
7.3. DKIM-Signature Query Method Registry . . . . . . . . . . . 54 7.4. DKIM-Signature Canonicalization Registry . . . . . . . . . 52
7.4. DKIM-Signature Canonicalization Registry . . . . . . . . . 54 7.5. _domainkey DNS TXT Resource Record Tag Specifications . . 53
7.5. _domainkey DNS TXT Resource Record Tag Specifications . . 55 7.6. DKIM Key Type Registry . . . . . . . . . . . . . . . . . . 53
7.6. DKIM Key Type Registry . . . . . . . . . . . . . . . . . . 56 7.7. DKIM Hash Algorithms Registry . . . . . . . . . . . . . . 54
7.7. DKIM Hash Algorithms Registry . . . . . . . . . . . . . . 56 7.8. DKIM Service Types Registry . . . . . . . . . . . . . . . 54
7.8. DKIM Service Types Registry . . . . . . . . . . . . . . . 56 7.9. DKIM Selector Flags Registry . . . . . . . . . . . . . . . 55
7.9. DKIM Selector Flags Registry . . . . . . . . . . . . . . . 57 7.10. DKIM-Signature Header Field . . . . . . . . . . . . . . . 55
7.10. DKIM-Signature Header Field . . . . . . . . . . . . . . . 57 8. Security Considerations . . . . . . . . . . . . . . . . . . . 55
8. Security Considerations . . . . . . . . . . . . . . . . . . . 57 8.1. ASCII Art Attacks . . . . . . . . . . . . . . . . . . . . 55
8.1. ASCII Art Attacks . . . . . . . . . . . . . . . . . . . . 57 8.2. Misuse of Body Length Limits ("l=" Tag) . . . . . . . . . 55
8.2. Misuse of Body Length Limits ("l=" Tag) . . . . . . . . . 58 8.3. Misappropriated Private Key . . . . . . . . . . . . . . . 56
8.3. Misappropriated Private Key . . . . . . . . . . . . . . . 58 8.4. Key Server Denial-of-Service Attacks . . . . . . . . . . . 56
8.4. Key Server Denial-of-Service Attacks . . . . . . . . . . . 59 8.5. Attacks against the DNS . . . . . . . . . . . . . . . . . 57
8.5. Attacks Against the DNS . . . . . . . . . . . . . . . . . 59 8.6. Replay/Spam Attacks . . . . . . . . . . . . . . . . . . . 57
8.6. Replay/Spam Attacks . . . . . . . . . . . . . . . . . . . 60 8.7. Limits on Revoking Keys . . . . . . . . . . . . . . . . . 58
8.7. Limits on Revoking Keys . . . . . . . . . . . . . . . . . 60 8.8. Intentionally Malformed Key Records . . . . . . . . . . . 58
8.8. Intentionally Malformed Key Records . . . . . . . . . . . 60 8.9. Intentionally Malformed DKIM-Signature Header Fields . . . 58
8.9. Intentionally Malformed DKIM-Signature Header Fields . . . 61 8.10. Information Leakage . . . . . . . . . . . . . . . . . . . 58
8.10. Information Leakage . . . . . . . . . . . . . . . . . . . 61 8.11. Remote Timing Attacks . . . . . . . . . . . . . . . . . . 59
8.11. Remote Timing Attacks . . . . . . . . . . . . . . . . . . 61 8.12. Reordered Header Fields . . . . . . . . . . . . . . . . . 59
8.12. Reordered Header Fields . . . . . . . . . . . . . . . . . 61 8.13. RSA Attacks . . . . . . . . . . . . . . . . . . . . . . . 59
8.13. RSA Attacks . . . . . . . . . . . . . . . . . . . . . . . 61 8.14. Inappropriate Signing by Parent Domains . . . . . . . . . 59
8.14. Inappropriate Signing by Parent Domains . . . . . . . . . 61 8.15. Attacks Involving Extra Header Fields . . . . . . . . . . 60
8.15. Attacks Involving Extra Header Fields . . . . . . . . . . 62 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 61
9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 63 9.1. Normative References . . . . . . . . . . . . . . . . . . . 61
9.1. Normative References . . . . . . . . . . . . . . . . . . . 63 9.2. Informative References . . . . . . . . . . . . . . . . . . 62
9.2. Informative References . . . . . . . . . . . . . . . . . . 64 Appendix A. Example of Use (INFORMATIVE) . . . . . . . . . . . . 64
Appendix A. Example of Use (INFORMATIVE) . . . . . . . . . . . . 65 A.1. The User Composes an Email . . . . . . . . . . . . . . . . 64
A.1. The User Composes an Email . . . . . . . . . . . . . . . . 66 A.2. The Email is Signed . . . . . . . . . . . . . . . . . . . 65
A.2. The Email is Signed . . . . . . . . . . . . . . . . . . . 66 A.3. The Email Signature is Verified . . . . . . . . . . . . . 66
A.3. The Email Signature is Verified . . . . . . . . . . . . . 67 Appendix B. Usage Examples (INFORMATIVE) . . . . . . . . . . . . 67
Appendix B. Usage Examples (INFORMATIVE) . . . . . . . . . . . . 68 B.1. Alternate Submission Scenarios . . . . . . . . . . . . . . 67
B.1. Alternate Submission Scenarios . . . . . . . . . . . . . . 68 B.2. Alternate Delivery Scenarios . . . . . . . . . . . . . . . 69
B.2. Alternate Delivery Scenarios . . . . . . . . . . . . . . . 70 Appendix C. Creating a Public Key (INFORMATIVE) . . . . . . . . . 71
Appendix C. Creating a Public Key (INFORMATIVE) . . . . . . . . . 72 C.1. Compatibility with DomainKeys Key Records . . . . . . . . 72
C.1. Compatibility with DomainKeys Key Records . . . . . . . . 73 C.2. RFC 4871 Compatibility . . . . . . . . . . . . . . . . . . 73
C.2. RFC4871 Compatibility . . . . . . . . . . . . . . . . . . 73
Appendix D. MUA Considerations (INFORMATIVE) . . . . . . . . . . 73 Appendix D. MUA Considerations (INFORMATIVE) . . . . . . . . . . 73
Appendix E. Changes since RFC4871 . . . . . . . . . . . . . . . . 74 Appendix E. Changes since RFC 4871 . . . . . . . . . . . . . . . 73
Appendix F. Acknowledgements . . . . . . . . . . . . . . . . . . 76 Appendix F. Acknowledgments . . . . . . . . . . . . . . . . . . . 75
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 76
1. Introduction 1. Introduction
DomainKeys Identified Mail (DKIM) permits a person, role, or DomainKeys Identified Mail (DKIM) permits a person, role, or
organization to claim some responsibility for a message by organization to claim some responsibility for a message by
associating a domain name [RFC1034] with the message [RFC5322], which associating a domain name [RFC1034] with the message [RFC5322], which
they are authorized to use. This can be an author's organization, an they are authorized to use. This can be an author's organization, an
operational relay or one of their agents. Assertion of operational relay, or one of their agents. Assertion of
responsibility is validated through a cryptographic signature and responsibility is validated through a cryptographic signature and by
querying the signer's domain directly to retrieve the appropriate querying the Signer's domain directly to retrieve the appropriate
public key. Message transit from author to recipient is through public key. Message transit from author to recipient is through
relays that typically make no substantive change to the message relays that typically make no substantive change to the message
content and thus preserve the DKIM signature. A message can contain content and thus preserve the DKIM signature. A message can contain
multiple signatures, from the same or different organizations multiple signatures, from the same or different organizations
involved with the message. involved with the message.
The approach taken by DKIM differs from previous approaches to The approach taken by DKIM differs from previous approaches to
message signing (e.g., Secure/Multipurpose Internet Mail Extensions message signing (e.g., Secure/Multipurpose Internet Mail Extensions
(S/MIME) [RFC5751], OpenPGP [RFC4880]) in that: (S/MIME) [RFC5751], OpenPGP [RFC4880]) in that:
o the message signature is written as a message header field so that o the message signature is written as a message header field so that
neither human recipients nor existing MUA (Mail User Agent) neither human recipients nor existing MUA (Mail User Agent)
software is confused by signature-related content appearing in the software is confused by signature-related content appearing in the
message body; message body;
o there is no dependency on public and private key pairs being o there is no dependency on public- and private-key pairs being
issued by well-known, trusted certificate authorities; issued by well-known, trusted certificate authorities;
o there is no dependency on the deployment of any new Internet o there is no dependency on the deployment of any new Internet
protocols or services for public key distribution or revocation; protocols or services for public-key distribution or revocation;
o signature verification failure does not force rejection of the o signature verification failure does not force rejection of the
message; message;
o no attempt is made to include encryption as part of the mechanism; o no attempt is made to include encryption as part of the mechanism;
and
o message archiving is not a design goal. o message archiving is not a design goal.
DKIM: DKIM:
o is compatible with the existing email infrastructure and o is compatible with the existing email infrastructure and
transparent to the fullest extent possible; transparent to the fullest extent possible;
o requires minimal new infrastructure; o requires minimal new infrastructure;
o can be implemented independently of clients in order to reduce o can be implemented independently of clients in order to reduce
deployment time; deployment time;
o can be deployed incrementally; o can be deployed incrementally; and
o allows delegation of signing to third parties. o allows delegation of signing to third parties.
1.1. DKIM Architecture Documents 1.1. DKIM Architecture Documents
Readers are advised to be familiar with the material in [RFC4686], Readers are advised to be familiar with the material in [RFC4686],
[RFC5585] and [RFC5863], which respectively provide the background [RFC5585], and [RFC5863], which provide the background for the
for the development of DKIM, an overview of the service, and development of DKIM, an overview of the service, and deployment and
deployment and operations guidance and advice. operations guidance and advice, respectively.
1.2. Signing Identity 1.2. Signing Identity
DKIM separates the question of the identity of the signer of the DKIM separates the question of the identity of the Signer of the
message from the purported author of the message. In particular, a message from the purported author of the message. In particular, a
signature includes the identity of the signer. Verifiers can use the signature includes the identity of the Signer. Verifiers can use the
signing information to decide how they want to process the message. signing information to decide how they want to process the message.
The signing identity is included as part of the signature header The signing identity is included as part of the signature header
field. field.
INFORMATIVE RATIONALE: The signing identity specified by a DKIM INFORMATIVE RATIONALE: The signing identity specified by a DKIM
signature is not required to match an address in any particular signature is not required to match an address in any particular
header field because of the broad methods of interpretation by header field because of the broad methods of interpretation by
recipient mail systems, including MUAs. recipient mail systems, including MUAs.
1.3. Scalability 1.3. Scalability
skipping to change at page 6, line 35 skipping to change at page 6, line 4
INFORMATIVE RATIONALE: The signing identity specified by a DKIM INFORMATIVE RATIONALE: The signing identity specified by a DKIM
signature is not required to match an address in any particular signature is not required to match an address in any particular
header field because of the broad methods of interpretation by header field because of the broad methods of interpretation by
recipient mail systems, including MUAs. recipient mail systems, including MUAs.
1.3. Scalability 1.3. Scalability
DKIM is designed to support the extreme scalability requirements that DKIM is designed to support the extreme scalability requirements that
characterize the email identification problem. There are many characterize the email identification problem. There are many
millions of domains and a much larger number of individual addresses. millions of domains and a much larger number of individual addresses.
DKIM seeks to preserve the positive aspects of the current email DKIM seeks to preserve the positive aspects of the current email
infrastructure, such as the ability for anyone to communicate with infrastructure, such as the ability for anyone to communicate with
anyone else without introduction. anyone else without introduction.
1.4. Simple Key Management 1.4. Simple Key Management
DKIM differs from traditional hierarchical public-key systems in that DKIM differs from traditional hierarchical public-key systems in that
no Certificate Authority infrastructure is required; the verifier no certificate authority infrastructure is required; the Verifier
requests the public key from a repository in the domain of the requests the public key from a repository in the domain of the
claimed signer directly rather than from a third party. claimed Signer directly rather than from a third party.
The DNS is proposed as the initial mechanism for the public keys. The DNS is proposed as the initial mechanism for the public keys.
Thus, DKIM currently depends on DNS administration and the security Thus, DKIM currently depends on DNS administration and the security
of the DNS system. DKIM is designed to be extensible to other key of the DNS system. DKIM is designed to be extensible to other key
fetching services as they become available. fetching services as they become available.
1.5. Data Integrity 1.5. Data Integrity
A DKIM signature associates the d= name with the computed hash of A DKIM signature associates the "d=" name with the computed hash of
some or all of the message (see Section 3.7) in order to prevent the some or all of the message (see Section 3.7) in order to prevent the
re-use of the signature with different messages. Verifying the reuse of the signature with different messages. Verifying the
signature asserts that the hashed content has not changed since it signature asserts that the hashed content has not changed since it
was signed, and asserts nothing else about "protecting" the end-to- was signed and asserts nothing else about "protecting" the end-to-end
end integrity of the message. integrity of the message.
2. Terminology and Definitions 2. Terminology and Definitions
This section defines terms used in the rest of the document. This section defines terms used in the rest of the document.
DKIM is designed to operate within the Internet Mail service, as DKIM is designed to operate within the Internet Mail service, as
defined in [RFC5598]. Basic email terminology is taken from that defined in [RFC5598]. Basic email terminology is taken from that
specification. specification.
Syntax descriptions use Augmented BNF (ABNF) [RFC5234]. Syntax descriptions use Augmented BNF (ABNF) [RFC5234].
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in "OPTIONAL" in this document are to be interpreted as described in
[RFC2119]. These words take their normative meanings only when they [RFC2119]. These words take their normative meanings only when they
are presented in ALL UPPER CASE. are presented in ALL UPPERCASE.
2.1. Signers 2.1. Signers
Elements in the mail system that sign messages on behalf of a domain Elements in the mail system that sign messages on behalf of a domain
are referred to as signers. These may be MUAs (Mail User Agents), are referred to as Signers. These may be MUAs (Mail User Agents),
MSAs (Mail Submission Agents), MTAs (Mail Transfer Agents), or other MSAs (Mail Submission Agents), MTAs (Mail Transfer Agents), or other
agents such as mailing list exploders. In general, any signer will agents such as mailing list exploders. In general, any Signer will
be involved in the injection of a message into the message system in be involved in the injection of a message into the message system in
some way. The key issue is that a message must be signed before it some way. The key issue is that a message must be signed before it
leaves the administrative domain of the signer. leaves the administrative domain of the Signer.
2.2. Verifiers 2.2. Verifiers
Elements in the mail system that verify signatures are referred to as Elements in the mail system that verify signatures are referred to as
verifiers. These may be MTAs, Mail Delivery Agents (MDAs), or MUAs. Verifiers. These may be MTAs, Mail Delivery Agents (MDAs), or MUAs.
In most cases it is expected that verifiers will be close to an end In most cases, it is expected that Verifiers will be close to an end
user (reader) of the message or some consuming agent such as a user (reader) of the message or some consuming agent such as a
mailing list exploder. mailing list exploder.
2.3. Identity 2.3. Identity
A person, role, or organization. In the context of DKIM, examples A person, role, or organization. In the context of DKIM, examples
include the author, the author's organization, an ISP along the include the author, the author's organization, an ISP along the
handling path, an independent trust assessment service, and a mailing handling path, an independent trust assessment service, and a mailing
list operator. list operator.
skipping to change at page 8, line 21 skipping to change at page 7, line 37
2.5. Signing Domain Identifier (SDID) 2.5. Signing Domain Identifier (SDID)
A single domain name that is the mandatory payload output of DKIM and A single domain name that is the mandatory payload output of DKIM and
that refers to the identity claiming some responsibility for the that refers to the identity claiming some responsibility for the
message by signing it. It is specified in Section 3.5. message by signing it. It is specified in Section 3.5.
2.6. Agent or User Identifier (AUID) 2.6. Agent or User Identifier (AUID)
A single identifier that refers to the agent or user on behalf of A single identifier that refers to the agent or user on behalf of
whom the Signing Domain Identifier (SDID) has taken responsibility. whom the Signing Domain Identifier (SDID) has taken responsibility.
The AUID comprises a domain name and an optional <Local-part>. The The AUID comprises a domain name and an optional <local-part>. The
domain name is the same as that used for the SDID or is a sub-domain domain name is the same as that used for the SDID or is a subdomain
of it. For DKIM processing, the domain name portion of the AUID has of it. For DKIM processing, the domain name portion of the AUID has
only basic domain name semantics; any possible owner-specific only basic domain name semantics; any possible owner-specific
semantics are outside the scope of DKIM. It is specified in semantics are outside the scope of DKIM. It is specified in
Section 3.5. Section 3.5.
Note that acceptable values for the AUID may be constrained via a Note that acceptable values for the AUID may be constrained via a
flag in the public key record. (See Section 3.6.1.) flag in the public-key record. (See Section 3.6.1.)
2.7. Identity Assessor 2.7. Identity Assessor
An element in the mail system that consumes DKIM's payload, which is An element in the mail system that consumes DKIM's payload, which is
the responsible Signing Domain Identifier (SDID). The Identity the responsible Signing Domain Identifier (SDID). The Identity
Assessor is dedicated to the assessment of the delivered identifier. Assessor is dedicated to the assessment of the delivered identifier.
Other DKIM (and non-DKIM) values can also be used by the Identity Other DKIM (and non-DKIM) values can also be used by the Identity
Assessor (if they are available) to provide a more general message Assessor (if they are available) to provide a more general message
evaluation filtering engine. However, this additional activity is evaluation filtering engine. However, this additional activity is
outside the scope of the DKIM signature specification. outside the scope of this specification.
2.8. Whitespace 2.8. Whitespace
There are three forms of whitespace: There are three forms of whitespace:
o WSP represents simple whitespace, i.e., a space or a tab character o WSP represents simple whitespace, i.e., a space or a tab character
(formal definition in [RFC5234]). (formal definition in [RFC5234]).
o LWSP is linear whitespace, defined as WSP plus CRLF (formal o LWSP is linear whitespace, defined as WSP plus CRLF (formal
definition in [RFC5234]). definition in [RFC5234]).
skipping to change at page 9, line 24 skipping to change at page 8, line 40
The definition of FWS is identical to that in [RFC5322] except for The definition of FWS is identical to that in [RFC5322] except for
the exclusion of obs-FWS. the exclusion of obs-FWS.
2.9. Imported ABNF Tokens 2.9. Imported ABNF Tokens
The following tokens are imported from other RFCs as noted. Those The following tokens are imported from other RFCs as noted. Those
RFCs should be considered definitive. RFCs should be considered definitive.
The following tokens are imported from [RFC5321]: The following tokens are imported from [RFC5321]:
o "Local-part" (implementation warning: this permits quoted strings) o "local-part" (implementation warning: this permits quoted strings)
o "sub-domain" o "sub-domain"
The following tokens are imported from [RFC5322]: The following tokens are imported from [RFC5322]:
o "field-name" (name of a header field) o "field-name" (name of a header field)
o "dot-atom-text" (in the Local-part of an email address) o "dot-atom-text" (in the local-part of an email address)
The following tokens are imported from [RFC2045]: The following tokens are imported from [RFC2045]:
o "qp-section" (a single line of quoted-printable-encoded text) o "qp-section" (a single line of quoted-printable-encoded text)
o "hex-octet" (a quoted-printable encoded octet) o "hex-octet" (a quoted-printable encoded octet)
INFORMATIVE NOTE: Be aware that the ABNF in [RFC2045] does not INFORMATIVE NOTE: Be aware that the ABNF in [RFC2045] does not
obey the rules of [RFC5234] and must be interpreted accordingly, obey the rules of [RFC5234] and must be interpreted accordingly,
particularly as regards case folding. particularly as regards case folding.
Other tokens not defined herein are imported from [RFC5234]. These Other tokens not defined herein are imported from [RFC5234]. These
are intuitive primitives such as SP, HTAB, WSP, ALPHA, DIGIT, CRLF, are intuitive primitives such as SP, HTAB, WSP, ALPHA, DIGIT, CRLF,
etc. etc.
skipping to change at page 10, line 28 skipping to change at page 9, line 41
the hexadecimal-encoded integer value of that character. All control the hexadecimal-encoded integer value of that character. All control
characters (those with values < %x20), 8-bit characters (values > characters (those with values < %x20), 8-bit characters (values >
%x7F), and the characters DEL (%x7F), SPACE (%x20), and semicolon %x7F), and the characters DEL (%x7F), SPACE (%x20), and semicolon
(";", %x3B) MUST be encoded. Note that all whitespace, including (";", %x3B) MUST be encoded. Note that all whitespace, including
SPACE, CR, and LF characters, MUST be encoded. After encoding, FWS SPACE, CR, and LF characters, MUST be encoded. After encoding, FWS
MAY be added at arbitrary locations in order to avoid excessively MAY be added at arbitrary locations in order to avoid excessively
long lines; such whitespace is NOT part of the value, and MUST be long lines; such whitespace is NOT part of the value, and MUST be
removed before decoding. Use of characters not listed as "mail-safe" removed before decoding. Use of characters not listed as "mail-safe"
in [RFC2049] is NOT RECOMMENDED. in [RFC2049] is NOT RECOMMENDED.
ABNF: ABNF:
dkim-quoted-printable = *(FWS / hex-octet / dkim-safe-char) dkim-quoted-printable = *(FWS / hex-octet / dkim-safe-char)
; hex-octet is from RFC2045 ; hex-octet is from RFC2045
dkim-safe-char = %x21-3A / %x3C / %x3E-7E dkim-safe-char = %x21-3A / %x3C / %x3E-7E
; '!' - ':', '<', '>' - '~' ; '!' - ':', '<', '>' - '~'
INFORMATIVE NOTE: DKIM-Quoted-Printable differs from Quoted- INFORMATIVE NOTE: DKIM-Quoted-Printable differs from Quoted-
Printable as defined in [RFC2045] in several important ways: Printable as defined in [RFC2045] in several important ways:
1. Whitespace in the input text, including CR and LF, must be 1. Whitespace in the input text, including CR and LF, must be
skipping to change at page 11, line 16 skipping to change at page 10, line 30
character on the line) does not apply. character on the line) does not apply.
4. DKIM-Quoted-Printable does not require that encoded lines be 4. DKIM-Quoted-Printable does not require that encoded lines be
no more than 76 characters long (although there may be other no more than 76 characters long (although there may be other
requirements depending on the context in which the encoded requirements depending on the context in which the encoded
text is being used). text is being used).
3. Protocol Elements 3. Protocol Elements
Protocol Elements are conceptual parts of the protocol that are not Protocol Elements are conceptual parts of the protocol that are not
specific to either signers or verifiers. The protocol descriptions specific to either Signers or Verifiers. The protocol descriptions
for signers and verifiers are described in later sections (Signer for Signers and Verifiers are described in later sections ("Signer
Actions (Section 5) and Verifier Actions (Section 6)). NOTE: This Actions" (Section 5) and "Verifier Actions" (Section 6)). NOTE: This
section must be read in the context of those sections. section must be read in the context of those sections.
3.1. Selectors 3.1. Selectors
To support multiple concurrent public keys per signing domain, the To support multiple concurrent public keys per signing domain, the
key namespace is subdivided using "selectors". For example, key namespace is subdivided using "selectors". For example,
selectors might indicate the names of office locations (e.g., selectors might indicate the names of office locations (e.g.,
"sanfrancisco", "coolumbeach", and "reykjavik"), the signing date "sanfrancisco", "coolumbeach", and "reykjavik"), the signing date
(e.g., "january2005", "february2005", etc.), or even an individual (e.g., "january2005", "february2005", etc.), or even an individual
user. user.
skipping to change at page 12, line 5 skipping to change at page 11, line 17
mail submission agent for outgoing mail. mail submission agent for outgoing mail.
Periods are allowed in selectors and are component separators. When Periods are allowed in selectors and are component separators. When
keys are retrieved from the DNS, periods in selectors define DNS keys are retrieved from the DNS, periods in selectors define DNS
label boundaries in a manner similar to the conventional use in label boundaries in a manner similar to the conventional use in
domain names. Selector components might be used to combine dates domain names. Selector components might be used to combine dates
with locations, for example, "march2005.reykjavik". In a DNS with locations, for example, "march2005.reykjavik". In a DNS
implementation, this can be used to allow delegation of a portion of implementation, this can be used to allow delegation of a portion of
the selector namespace. the selector namespace.
ABNF: ABNF:
selector = sub-domain *( "." sub-domain ) selector = sub-domain *( "." sub-domain )
The number of public keys and corresponding selectors for each domain The number of public keys and corresponding selectors for each domain
is determined by the domain owner. Many domain owners will be is determined by the domain owner. Many domain owners will be
satisfied with just one selector, whereas administratively satisfied with just one selector, whereas administratively
distributed organizations can choose to manage disparate selectors distributed organizations can choose to manage disparate selectors
and key pairs in different regions or on different email servers. and key pairs in different regions or on different email servers.
Beyond administrative convenience, selectors make it possible to Beyond administrative convenience, selectors make it possible to
skipping to change at page 12, line 36 skipping to change at page 11, line 48
INFORMATIVE NOTE: A key may also be revoked as described below. INFORMATIVE NOTE: A key may also be revoked as described below.
The distinction between revoking and removing a key selector The distinction between revoking and removing a key selector
record is subtle. When phasing out keys as described above, a record is subtle. When phasing out keys as described above, a
signing domain would probably simply remove the key record after signing domain would probably simply remove the key record after
the transition period. However, a signing domain could elect to the transition period. However, a signing domain could elect to
revoke the key (but maintain the key record) for a further period. revoke the key (but maintain the key record) for a further period.
There is no defined semantic difference between a revoked key and There is no defined semantic difference between a revoked key and
a removed key. a removed key.
While some domains may wish to make selector values well known, While some domains may wish to make selector values well-known,
others will want to take care not to allocate selector names in a way others will want to take care not to allocate selector names in a way
that allows harvesting of data by outside parties. For example, if that allows harvesting of data by outside parties. For example, if
per-user keys are issued, the domain owner will need to make the per-user keys are issued, the domain owner will need to decide
decision as to whether to associate this selector directly with the whether to associate this selector directly with the name of a
name of a registered end-user, or make it some unassociated random registered end user or make it some unassociated random value, such
value, such as a fingerprint of the public key. as a fingerprint of the public key.
INFORMATIVE OPERATIONS NOTE: Reusing a selector with a new key INFORMATIVE OPERATIONS NOTE: Reusing a selector with a new key
(for example, changing the key associated with a user's name) (for example, changing the key associated with a user's name)
makes it impossible to tell the difference between a message that makes it impossible to tell the difference between a message that
didn't verify because the key is no longer valid versus a message didn't verify because the key is no longer valid and a message
that is actually forged. For this reason, signers are ill-advised that is actually forged. For this reason, Signers are ill-advised
to reuse selectors for new keys. A better strategy is to assign to reuse selectors for new keys. A better strategy is to assign
new keys to new selectors. new keys to new selectors.
3.2. Tag=Value Lists 3.2. Tag=Value Lists
DKIM uses a simple "tag=value" syntax in several contexts, including DKIM uses a simple "tag=value" syntax in several contexts, including
in messages and domain signature records. in messages and domain signature records.
Values are a series of strings containing either plain text, "base64" Values are a series of strings containing either plain text, "base64"
text (as defined in [RFC2045], Section 6.8), "qp-section" (ibid, text (as defined in [RFC2045], Section 6.8), "qp-section" (ibid,
Section 6.7), or "dkim-quoted-printable" (as defined in Section 6.7), or "dkim-quoted-printable" (as defined in
Section 2.11). The name of the tag will determine the encoding of Section 2.11). The name of the tag will determine the encoding of
each value. Unencoded semicolon (";") characters MUST NOT occur in each value. Unencoded semicolon (";") characters MUST NOT occur in
the tag value, since that separates tag-specs. the tag value, since that separates tag-specs.
INFORMATIVE IMPLEMENTATION NOTE: Although the "plain text" defined INFORMATIVE IMPLEMENTATION NOTE: Although the "plain text" defined
below (as "tag-value") only includes 7-bit characters, an below (as "tag-value") only includes 7-bit characters, an
implementation that wished to anticipate future standards would be implementation that wished to anticipate future standards would be
advised not to preclude the use of UTF8-encoded ([RFC3629]) text advised not to preclude the use of UTF-8-encoded ([RFC3629]) text
in tag=value lists. in tag=value lists.
Formally, the ABNF syntax rules are as follows: Formally, the ABNF syntax rules are as follows:
tag-list = tag-spec *( ";" tag-spec ) [ ";" ] tag-list = tag-spec *( ";" tag-spec ) [ ";" ]
tag-spec = [FWS] tag-name [FWS] "=" [FWS] tag-value [FWS] tag-spec = [FWS] tag-name [FWS] "=" [FWS] tag-value [FWS]
tag-name = ALPHA *ALNUMPUNC tag-name = ALPHA *ALNUMPUNC
tag-value = [ tval *( 1*(WSP / FWS) tval ) ] tag-value = [ tval *( 1*(WSP / FWS) tval ) ]
; Prohibits WSP and FWS at beginning and end ; Prohibits WSP and FWS at beginning and end
tval = 1*VALCHAR tval = 1*VALCHAR
VALCHAR = %x21-3A / %x3C-7E VALCHAR = %x21-3A / %x3C-7E
; EXCLAMATION to TILDE except SEMICOLON ; EXCLAMATION to TILDE except SEMICOLON
ALNUMPUNC = ALPHA / DIGIT / "_" ALNUMPUNC = ALPHA / DIGIT / "_"
skipping to change at page 14, line 27 skipping to change at page 13, line 40
INFORMATIVE NOTE: Although rsa-sha256 is strongly encouraged, some INFORMATIVE NOTE: Although rsa-sha256 is strongly encouraged, some
senders might prefer to use rsa-sha1 when balancing security senders might prefer to use rsa-sha1 when balancing security
strength against performance, complexity, or other needs. In strength against performance, complexity, or other needs. In
general, however, rsa-sha256 should always be used whenever general, however, rsa-sha256 should always be used whenever
possible. possible.
3.3.1. The rsa-sha1 Signing Algorithm 3.3.1. The rsa-sha1 Signing Algorithm
The rsa-sha1 Signing Algorithm computes a message hash as described The rsa-sha1 Signing Algorithm computes a message hash as described
in Section 3.7 below using SHA-1 [FIPS-180-3-2008] as the hash-alg. in Section 3.7 using SHA-1 [FIPS-180-3-2008] as the hash-alg. That
That hash is then signed by the signer using the RSA algorithm hash is then signed by the Signer using the RSA algorithm (defined in
(defined in PKCS#1 version 1.5 [RFC3447]) as the crypt-alg and the Public-Key Cryptography Standards (PKCS) #1 version 1.5 [RFC3447]) as
signer's private key. The hash MUST NOT be truncated or converted the crypt-alg and the Signer's private key. The hash MUST NOT be
into any form other than the native binary form before being signed. truncated or converted into any form other than the native binary
The signing algorithm SHOULD use a public exponent of 65537. form before being signed. The signing algorithm SHOULD use a public
exponent of 65537.
3.3.2. The rsa-sha256 Signing Algorithm 3.3.2. The rsa-sha256 Signing Algorithm
The rsa-sha256 Signing Algorithm computes a message hash as described The rsa-sha256 Signing Algorithm computes a message hash as described
in Section 3.7 below using SHA-256 [FIPS-180-3-2008] as the hash-alg. in Section 3.7 using SHA-256 [FIPS-180-3-2008] as the hash-alg. That
That hash is then signed by the signer using the RSA algorithm hash is then signed by the Signer using the RSA algorithm (defined in
(defined in PKCS#1 version 1.5 [RFC3447]) as the crypt-alg and the PKCS#1 version 1.5 [RFC3447]) as the crypt-alg and the Signer's
signer's private key. The hash MUST NOT be truncated or converted private key. The hash MUST NOT be truncated or converted into any
into any form other than the native binary form before being signed. form other than the native binary form before being signed. The
The signing algorithm SHOULD use a public exponent of 65537. signing algorithm SHOULD use a public exponent of 65537.
3.3.3. Key Sizes 3.3.3. Key Sizes
Selecting appropriate key sizes is a trade-off between cost, Selecting appropriate key sizes is a trade-off between cost,
performance, and risk. Since short RSA keys more easily succumb to performance, and risk. Since short RSA keys more easily succumb to
off-line attacks, signers MUST use RSA keys of at least 1024 bits for off-line attacks, Signers MUST use RSA keys of at least 1024 bits for
long-lived keys. Verifiers MUST be able to validate signatures with long-lived keys. Verifiers MUST be able to validate signatures with
keys ranging from 512 bits to 2048 bits, and they MAY be able to keys ranging from 512 bits to 2048 bits, and they MAY be able to
validate signatures with larger keys. Verifier policies may use the validate signatures with larger keys. Verifier policies may use the
length of the signing key as one metric for determining whether a length of the signing key as one metric for determining whether a
signature is acceptable. signature is acceptable.
Factors that should influence the key size choice include the Factors that should influence the key size choice include the
following: following:
o The practical constraint that large (e.g., 4096 bit) keys might o The practical constraint that large (e.g., 4096-bit) keys might
not fit within a 512-byte DNS UDP response packet not fit within a 512-byte DNS UDP response packet
o The security constraint that keys smaller than 1024 bits are o The security constraint that keys smaller than 1024 bits are
subject to off-line attacks subject to off-line attacks
o Larger keys impose higher CPU costs to verify and sign email o Larger keys impose higher CPU costs to verify and sign email
o Keys can be replaced on a regular basis, thus their lifetime can o Keys can be replaced on a regular basis; thus, their lifetime can
be relatively short be relatively short
o The security goals of this specification are modest compared to o The security goals of this specification are modest compared to
typical goals of other systems that employ digital signatures typical goals of other systems that employ digital signatures
See [RFC3766] for further discussion on selecting key sizes. See [RFC3766] for further discussion on selecting key sizes.
3.3.4. Other Algorithms 3.3.4. Other Algorithms
Other algorithms MAY be defined in the future. Verifiers MUST ignore Other algorithms MAY be defined in the future. Verifiers MUST ignore
any signatures using algorithms that they do not implement. any signatures using algorithms that they do not implement.
3.4. Canonicalization 3.4. Canonicalization
Some mail systems modify email in transit, potentially invalidating a Some mail systems modify email in transit, potentially invalidating a
signature. For most signers, mild modification of email is signature. For most Signers, mild modification of email is
immaterial to validation of the DKIM domain name's use. For such immaterial to validation of the DKIM domain name's use. For such
signers, a canonicalization algorithm that survives modest in-transit Signers, a canonicalization algorithm that survives modest in-transit
modification is preferred. modification is preferred.
Other signers demand that any modification of the email, however Other Signers demand that any modification of the email, however
minor, result in a signature verification failure. These signers minor, result in a signature verification failure. These Signers
prefer a canonicalization algorithm that does not tolerate in-transit prefer a canonicalization algorithm that does not tolerate in-transit
modification of the signed email. modification of the signed email.
Some signers may be willing to accept modifications to header fields Some Signers may be willing to accept modifications to header fields
that are within the bounds of email standards such as [RFC5322], but that are within the bounds of email standards such as [RFC5322], but
are unwilling to accept any modification to the body of messages. are unwilling to accept any modification to the body of messages.
To satisfy all requirements, two canonicalization algorithms are To satisfy all requirements, two canonicalization algorithms are
defined for each of the header and the body: a "simple" algorithm defined for each of the header and the body: a "simple" algorithm
that tolerates almost no modification and a "relaxed" algorithm that that tolerates almost no modification and a "relaxed" algorithm that
tolerates common modifications such as whitespace replacement and tolerates common modifications such as whitespace replacement and
header field line rewrapping. A signer MAY specify either algorithm header field line rewrapping. A Signer MAY specify either algorithm
for header or body when signing an email. If no canonicalization for header or body when signing an email. If no canonicalization
algorithm is specified by the signer, the "simple" algorithm defaults algorithm is specified by the Signer, the "simple" algorithm defaults
for both header and body. Verifiers MUST implement both for both header and body. Verifiers MUST implement both
canonicalization algorithms. Note that the header and body may use canonicalization algorithms. Note that the header and body may use
different canonicalization algorithms. Further canonicalization different canonicalization algorithms. Further canonicalization
algorithms MAY be defined in the future; verifiers MUST ignore any algorithms MAY be defined in the future; Verifiers MUST ignore any
signatures that use unrecognized canonicalization algorithms. signatures that use unrecognized canonicalization algorithms.
Canonicalization simply prepares the email for presentation to the Canonicalization simply prepares the email for presentation to the
signing or verification algorithm. It MUST NOT change the signing or verification algorithm. It MUST NOT change the
transmitted data in any way. Canonicalization of header fields and transmitted data in any way. Canonicalization of header fields and
body are described below. body are described below.
NOTE: This section assumes that the message is already in "network NOTE: This section assumes that the message is already in "network
normal" format (text is ASCII encoded, lines are separated with CRLF normal" format (text is ASCII encoded, lines are separated with CRLF
characters, etc.). See also Section 5.3 for information about characters, etc.). See also Section 5.3 for information about
skipping to change at page 17, line 42 skipping to change at page 17, line 9
a. Reduce whitespace: a. Reduce whitespace:
* Ignore all whitespace at the end of lines. Implementations * Ignore all whitespace at the end of lines. Implementations
MUST NOT remove the CRLF at the end of the line. MUST NOT remove the CRLF at the end of the line.
* Reduce all sequences of WSP within a line to a single SP * Reduce all sequences of WSP within a line to a single SP
character. character.
b. Ignore all empty lines at the end of the message body. "Empty b. Ignore all empty lines at the end of the message body. "Empty
line" is defined in Section 3.4.3. If the body is non-empty, but line" is defined in Section 3.4.3. If the body is non-empty but
does not end with a CRLF, a CRLF is added. (For email, this is does not end with a CRLF, a CRLF is added. (For email, this is
only possible when using extensions to SMTP or non-SMTP transport only possible when using extensions to SMTP or non-SMTP transport
mechanisms.) mechanisms.)
The SHA-1 value (in base64) for an empty body (canonicalized to a The SHA-1 value (in base64) for an empty body (canonicalized to a
null input) is: null input) is:
2jmj7l5rSw0yVb/vlWAYkK/YBwk= 2jmj7l5rSw0yVb/vlWAYkK/YBwk=
The SHA-256 value is: The SHA-256 value is:
47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=
3.4.5. Canonicalization Examples (INFORMATIVE) 3.4.5. Canonicalization Examples (INFORMATIVE)
In the following examples, actual whitespace is used only for In the following examples, actual whitespace is used only for
clarity. The actual input and output text is designated using clarity. The actual input and output text is designated using
bracketed descriptors: "<SP>" for a space character, "<HTAB>" for a bracketed descriptors: "<SP>" for a space character, "<HTAB>" for a
tab character, and "<CRLF>" for a carriage-return/line-feed sequence. tab character, and "<CRLF>" for a carriage-return/line-feed sequence.
For example, "X <SP> Y" and "X<SP>Y" represent the same three For example, "X <SP> Y" and "X<SP>Y" represent the same three
characters. characters.
skipping to change at page 19, line 16 skipping to change at page 18, line 37
D <SP><HTAB><SP> E <CRLF> D <SP><HTAB><SP> E <CRLF>
3.5. The DKIM-Signature Header Field 3.5. The DKIM-Signature Header Field
The signature of the email is stored in the DKIM-Signature header The signature of the email is stored in the DKIM-Signature header
field. This header field contains all of the signature and key- field. This header field contains all of the signature and key-
fetching data. The DKIM-Signature value is a tag-list as described fetching data. The DKIM-Signature value is a tag-list as described
in Section 3.2. in Section 3.2.
The DKIM-Signature header field SHOULD be treated as though it were a The DKIM-Signature header field SHOULD be treated as though it were a
trace header field as defined in Section 3.6 of [RFC5322], and hence trace header field as defined in Section 3.6 of [RFC5322] and hence
SHOULD NOT be reordered and SHOULD be prepended to the message. SHOULD NOT be reordered and SHOULD be prepended to the message.
The DKIM-Signature header field being created or verified is always The DKIM-Signature header field being created or verified is always
included in the signature calculation, after the rest of the header included in the signature calculation, after the rest of the header
fields being signed; however, when calculating or verifying the fields being signed; however, when calculating or verifying the
signature, the value of the "b=" tag (signature value) of that DKIM- signature, the value of the "b=" tag (signature value) of that DKIM-
Signature header field MUST be treated as though it were an empty Signature header field MUST be treated as though it were an empty
string. Unknown tags in the DKIM-Signature header field MUST be string. Unknown tags in the DKIM-Signature header field MUST be
included in the signature calculation but MUST be otherwise ignored included in the signature calculation but MUST be otherwise ignored
by verifiers. Other DKIM-Signature header fields that are included by Verifiers. Other DKIM-Signature header fields that are included
in the signature should be treated as normal header fields; in in the signature should be treated as normal header fields; in
particular, the "b=" tag is not treated specially. particular, the "b=" tag is not treated specially.
The encodings for each field type are listed below. Tags described The encodings for each field type are listed below. Tags described
as qp-section are encoded as described in Section 6.7 of MIME Part as qp-section are encoded as described in Section 6.7 of MIME Part
One [RFC2045], with the additional conversion of semicolon characters One [RFC2045], with the additional conversion of semicolon characters
to "=3B"; intuitively, this is one line of quoted-printable encoded to "=3B"; intuitively, this is one line of quoted-printable encoded
text. The dkim-quoted-printable syntax is defined in Section 2.11. text. The dkim-quoted-printable syntax is defined in Section 2.11.
Tags on the DKIM-Signature header field along with their type and Tags on the DKIM-Signature header field along with their type and
requirement status are shown below. Unrecognized tags MUST be requirement status are shown below. Unrecognized tags MUST be
ignored. ignored.
v= Version (plain-text; REQUIRED). This tag defines the version of v= Version (plain-text; REQUIRED). This tag defines the version of
this specification that applies to the signature record. It MUST this specification that applies to the signature record. It MUST
have the value "1" for implementations compliant with this version have the value "1" for implementations compliant with this version
of DKIM. of DKIM.
ABNF: ABNF:
sig-v-tag = %x76 [FWS] "=" [FWS] 1*DIGIT
sig-v-tag = %x76 [FWS] "=" [FWS] 1*DIGIT
INFORMATIVE NOTE: DKIM-Signature version numbers may increase INFORMATIVE NOTE: DKIM-Signature version numbers may increase
arithmetically as new versions of this specification are arithmetically as new versions of this specification are
released. released.
a= The algorithm used to generate the signature (plain-text; a= The algorithm used to generate the signature (plain-text;
REQUIRED). Verifiers MUST support "rsa-sha1" and "rsa-sha256"; REQUIRED). Verifiers MUST support "rsa-sha1" and "rsa-sha256";
signers SHOULD sign using "rsa-sha256". See Section 3.3 for a Signers SHOULD sign using "rsa-sha256". See Section 3.3 for a
description of the algorithms. description of the algorithms.
ABNF: ABNF:
sig-a-tag = %x61 [FWS] "=" [FWS] sig-a-tag-alg sig-a-tag = %x61 [FWS] "=" [FWS] sig-a-tag-alg
sig-a-tag-alg = sig-a-tag-k "-" sig-a-tag-h sig-a-tag-alg = sig-a-tag-k "-" sig-a-tag-h
sig-a-tag-k = "rsa" / x-sig-a-tag-k sig-a-tag-k = "rsa" / x-sig-a-tag-k
sig-a-tag-h = "sha1" / "sha256" / x-sig-a-tag-h sig-a-tag-h = "sha1" / "sha256" / x-sig-a-tag-h
x-sig-a-tag-k = ALPHA *(ALPHA / DIGIT) x-sig-a-tag-k = ALPHA *(ALPHA / DIGIT)
; for later extension ; for later extension
x-sig-a-tag-h = ALPHA *(ALPHA / DIGIT) x-sig-a-tag-h = ALPHA *(ALPHA / DIGIT)
; for later extension ; for later extension
b= The signature data (base64; REQUIRED). Whitespace is ignored in b= The signature data (base64; REQUIRED). Whitespace is ignored in
this value and MUST be ignored when reassembling the original this value and MUST be ignored when reassembling the original
signature. In particular, the signing process can safely insert signature. In particular, the signing process can safely insert
FWS in this value in arbitrary places to conform to line-length FWS in this value in arbitrary places to conform to line-length
limits. See Signer Actions (Section 5) for how the signature is limits. See "Signer Actions" (Section 5) for how the signature is
computed. computed.
ABNF: ABNF:
sig-b-tag = %x62 [FWS] "=" [FWS] sig-b-tag-data sig-b-tag = %x62 [FWS] "=" [FWS] sig-b-tag-data
sig-b-tag-data = base64string sig-b-tag-data = base64string
bh= The hash of the canonicalized body part of the message as bh= The hash of the canonicalized body part of the message as
limited by the "l=" tag (base64; REQUIRED). Whitespace is ignored limited by the "l=" tag (base64; REQUIRED). Whitespace is ignored
in this value and MUST be ignored when reassembling the original in this value and MUST be ignored when reassembling the original
signature. In particular, the signing process can safely insert signature. In particular, the signing process can safely insert
FWS in this value in arbitrary places to conform to line-length FWS in this value in arbitrary places to conform to line-length
limits. See Section 3.7 for how the body hash is computed. limits. See Section 3.7 for how the body hash is computed.
ABNF: ABNF:
sig-bh-tag = %x62 %x68 [FWS] "=" [FWS] sig-bh-tag-data sig-bh-tag = %x62 %x68 [FWS] "=" [FWS] sig-bh-tag-data
sig-bh-tag-data = base64string sig-bh-tag-data = base64string
c= Message canonicalization (plain-text; OPTIONAL, default is c= Message canonicalization (plain-text; OPTIONAL, default is
"simple/simple"). This tag informs the verifier of the type of "simple/simple"). This tag informs the Verifier of the type of
canonicalization used to prepare the message for signing. It canonicalization used to prepare the message for signing. It
consists of two names separated by a "slash" (%d47) character, consists of two names separated by a "slash" (%d47) character,
corresponding to the header and body canonicalization algorithms corresponding to the header and body canonicalization algorithms,
respectively. These algorithms are described in Section 3.4. If respectively. These algorithms are described in Section 3.4. If
only one algorithm is named, that algorithm is used for the header only one algorithm is named, that algorithm is used for the header
and "simple" is used for the body. For example, "c=relaxed" is and "simple" is used for the body. For example, "c=relaxed" is
treated the same as "c=relaxed/simple". treated the same as "c=relaxed/simple".
ABNF: ABNF:
sig-c-tag = %x63 [FWS] "=" [FWS] sig-c-tag-alg sig-c-tag = %x63 [FWS] "=" [FWS] sig-c-tag-alg
["/" sig-c-tag-alg] ["/" sig-c-tag-alg]
sig-c-tag-alg = "simple" / "relaxed" / x-sig-c-tag-alg sig-c-tag-alg = "simple" / "relaxed" / x-sig-c-tag-alg
x-sig-c-tag-alg = hyphenated-word ; for later extension x-sig-c-tag-alg = hyphenated-word ; for later extension
d= The SDID claiming responsibility for an introduction of a message d= The SDID claiming responsibility for an introduction of a message
into the mail stream (plain-text; REQUIRED). Hence, the SDID into the mail stream (plain-text; REQUIRED). Hence, the SDID
value is used to form the query for the public key. The SDID MUST value is used to form the query for the public key. The SDID MUST
correspond to a valid DNS name under which the DKIM key record is correspond to a valid DNS name under which the DKIM key record is
published. The conventions and semantics used by a signer to published. The conventions and semantics used by a Signer to
create and use a specific SDID are outside the scope of the DKIM create and use a specific SDID are outside the scope of this
Signing specification, as is any use of those conventions and specification, as is any use of those conventions and semantics.
semantics. When presented with a signature that does not meet When presented with a signature that does not meet these
these requirements, verifiers MUST consider the signature invalid. requirements, Verifiers MUST consider the signature invalid.
Internationalized domain names MUST be encoded as A-Labels, as Internationalized domain names MUST be encoded as A-labels, as
described in Section 2.3 of [RFC5890]. described in Section 2.3 of [RFC5890].
ABNF: ABNF:
sig-d-tag = %x64 [FWS] "=" [FWS] domain-name sig-d-tag = %x64 [FWS] "=" [FWS] domain-name
domain-name = sub-domain 1*("." sub-domain) domain-name = sub-domain 1*("." sub-domain)
; from RFC5321 Domain, excluding address-literal ; from [RFC5321] Domain,
; excluding address-literal
h= Signed header fields (plain-text, but see description; REQUIRED). h= Signed header fields (plain-text, but see description; REQUIRED).
A colon-separated list of header field names that identify the A colon-separated list of header field names that identify the
header fields presented to the signing algorithm. The field MUST header fields presented to the signing algorithm. The field MUST
contain the complete list of header fields in the order presented contain the complete list of header fields in the order presented
to the signing algorithm. The field MAY contain names of header to the signing algorithm. The field MAY contain names of header
fields that do not exist when signed; nonexistent header fields do fields that do not exist when signed; nonexistent header fields do
not contribute to the signature computation (that is, they are not contribute to the signature computation (that is, they are
treated as the null input, including the header field name, the treated as the null input, including the header field name, the
separating colon, the header field value, and any CRLF separating colon, the header field value, and any CRLF
terminator). The field MAY contain multiple instances of a header terminator). The field MAY contain multiple instances of a header
field name, meaning multiple occurrences of the corresponding field name, meaning multiple occurrences of the corresponding
header field are included in the header hash. The field MUST NOT header field are included in the header hash. The field MUST NOT
include the DKIM-Signature header field that is being created or include the DKIM-Signature header field that is being created or
verified, but may include others. Folding whitespace (FWS) MAY be verified but may include others. Folding whitespace (FWS) MAY be
included on either side of the colon separator. Header field included on either side of the colon separator. Header field
names MUST be compared against actual header field names in a names MUST be compared against actual header field names in a
case-insensitive manner. This list MUST NOT be empty. See case-insensitive manner. This list MUST NOT be empty. See
Section 5.4 for a discussion of choosing header fields to sign, Section 5.4 for a discussion of choosing header fields to sign and
and Section 5.4.2 for requirements when signing multiple instances Section 5.4.2 for requirements when signing multiple instances of
of a single field. a single field.
ABNF: ABNF:
sig-h-tag = %x68 [FWS] "=" [FWS] hdr-name sig-h-tag = %x68 [FWS] "=" [FWS] hdr-name
*( [FWS] ":" [FWS] hdr-name ) *( [FWS] ":" [FWS] hdr-name )
INFORMATIVE EXPLANATION: By "signing" header fields that do not INFORMATIVE EXPLANATION: By "signing" header fields that do not
actually exist, a signer can allow a verifier to detect actually exist, a Signer can allow a Verifier to detect
insertion of those header fields after signing. However, since insertion of those header fields after signing. However, since
a signer cannot possibly know what header fields might be a Signer cannot possibly know what header fields might be
defined in the future, this mechanism can't be used to prevent defined in the future, this mechanism cannot be used to prevent
the addition of any possible unknown header fields. the addition of any possible unknown header fields.
INFORMATIVE NOTE: "Signing" fields that are not present at the INFORMATIVE NOTE: "Signing" fields that are not present at the
time of signing not only prevents fields and values from being time of signing not only prevents fields and values from being
added, but also prevents adding fields with no values. added but also prevents adding fields with no values.
i= The Agent or User Identifier (AUID) on behalf of which the SDID is i= The Agent or User Identifier (AUID) on behalf of which the SDID is
taking responsibility (dkim-quoted-printable; OPTIONAL, default is taking responsibility (dkim-quoted-printable; OPTIONAL, default is
an empty Local-part followed by an "@" followed by the domain from an empty local-part followed by an "@" followed by the domain from
the "d=" tag). the "d=" tag).
The syntax is a standard email address where the Local-part MAY be The syntax is a standard email address where the local-part MAY be
omitted. The domain part of the address MUST be the same as, or a omitted. The domain part of the address MUST be the same as, or a
subdomain of, the value of the "d=" tag. subdomain of, the value of the "d=" tag.
Internationalized domain names MUST be encoded as A-Labels, as Internationalized domain names MUST be encoded as A-labels, as
described in Section 2.3 of [RFC5890]. described in Section 2.3 of [RFC5890].
ABNF: ABNF:
sig-i-tag = %x69 [FWS] "=" [FWS] [ Local-part ] sig-i-tag = %x69 [FWS] "=" [FWS] [ Local-part ]
"@" domain-name "@" domain-name
The AUID is specified as having the same syntax as an email The AUID is specified as having the same syntax as an email
address, but need not have the same semantics. Notably, the address but it need not have the same semantics. Notably, the
domain name need not be registered in the DNS -- so it might not domain name need not be registered in the DNS -- so it might not
resolve in a query -- and the Local-part MAY be drawn from a resolve in a query -- and the local-part MAY be drawn from a
namespace unrelated to any mailbox. The details of the structure namespace unrelated to any mailbox. The details of the structure
and semantics for the namespace are determined by the Signer. Any and semantics for the namespace are determined by the Signer. Any
knowledge or use of those details by verifiers or assessors is knowledge or use of those details by Verifiers or Assessors is
outside the scope of the DKIM Signing specification. The Signer outside the scope of this specification. The Signer MAY choose to
MAY choose to use the same namespace for its AUIDs as its users' use the same namespace for its AUIDs as its users' email addresses
email addresses or MAY choose other means of representing its or MAY choose other means of representing its users. However, the
users. However, the signer SHOULD use the same AUID for each Signer SHOULD use the same AUID for each message intended to be
message intended to be evaluated as being within the same sphere evaluated as being within the same sphere of responsibility, if it
of responsibility, if it wishes to offer receivers the option of wishes to offer receivers the option of using the AUID as a stable
using the AUID as a stable identifier that is finer grained than identifier that is finer grained than the SDID.
the SDID.
INFORMATIVE NOTE: The Local-part of the "i=" tag is optional INFORMATIVE NOTE: The local-part of the "i=" tag is optional
because in some cases a signer may not be able to establish a because in some cases a Signer may not be able to establish a
verified individual identity. In such cases, the signer might verified individual identity. In such cases, the Signer might
wish to assert that although it is willing to go as far as wish to assert that although it is willing to go as far as
signing for the domain, it is unable or unwilling to commit to signing for the domain, it is unable or unwilling to commit to
an individual user name within their domain. It can do so by an individual user name within the domain. It can do so by
including the domain part but not the Local-part of the including the domain part but not the local-part of the
identity. identity.
INFORMATIVE DISCUSSION: This specification does not require the INFORMATIVE DISCUSSION: This specification does not require the
value of the "i=" tag to match the identity in any message value of the "i=" tag to match the identity in any message
header fields. This is considered to be a verifier policy header fields. This is considered to be a Verifier policy
issue. Constraints between the value of the "i=" tag and other issue. Constraints between the value of the "i=" tag and other
identities in other header fields seek to apply basic identities in other header fields seek to apply basic
authentication into the semantics of trust associated with a authentication into the semantics of trust associated with a
role such as content author. Trust is a broad and complex role such as content author. Trust is a broad and complex
topic and trust mechanisms are subject to highly creative topic, and trust mechanisms are subject to highly creative
attacks. The real-world efficacy of any but the most basic attacks. The real-world efficacy of any but the most basic
bindings between the "i=" value and other identities is not bindings between the "i=" value and other identities is not
well established, nor is its vulnerability to subversion by an well established, nor is its vulnerability to subversion by an
attacker. Hence reliance on the use of these options should be attacker. Hence, reliance on the use of these options should
strictly limited. In particular, it is not at all clear to be strictly limited. In particular, it is not at all clear to
what extent a typical end-user recipient can rely on any what extent a typical end-user recipient can rely on any
assurances that might be made by successful use of the "i=" assurances that might be made by successful use of the "i="
options. options.
l= Body length count (plain-text unsigned decimal integer; OPTIONAL, l= Body length count (plain-text unsigned decimal integer; OPTIONAL,
default is entire body). This tag informs the verifier of the default is entire body). This tag informs the Verifier of the
number of octets in the body of the email after canonicalization number of octets in the body of the email after canonicalization
included in the cryptographic hash, starting from 0 immediately included in the cryptographic hash, starting from 0 immediately
following the CRLF preceding the body. This value MUST NOT be following the CRLF preceding the body. This value MUST NOT be
larger than the actual number of octets in the canonicalized larger than the actual number of octets in the canonicalized
message body. See further discussion in Section 8.2. message body. See further discussion in Section 8.2.
INFORMATIVE NOTE: The value of the "l=" tag is constrained to INFORMATIVE NOTE: The value of the "l=" tag is constrained to
76 decimal digits. This constraint is not intended to predict 76 decimal digits. This constraint is not intended to predict
the size of future messages or to require implementations to the size of future messages or to require implementations to
use an integer representation large enough to represent the use an integer representation large enough to represent the
maximum possible value, but is intended to remind the maximum possible value but is intended to remind the
implementer to check the length of this and all other tags implementer to check the length of this and all other tags
during verification and to test for integer overflow when during verification and to test for integer overflow when
decoding the value. Implementers may need to limit the actual decoding the value. Implementers may need to limit the actual
value expressed to a value smaller than 10^76, e.g., to allow a value expressed to a value smaller than 10^76, e.g., to allow a
message to fit within the available storage space. message to fit within the available storage space.
ABNF: ABNF:
sig-l-tag = %x6c [FWS] "=" [FWS] sig-l-tag = %x6c [FWS] "=" [FWS]
1*76DIGIT 1*76DIGIT
q= A colon-separated list of query methods used to retrieve the q= A colon-separated list of query methods used to retrieve the
public key (plain-text; OPTIONAL, default is "dns/txt"). Each public key (plain-text; OPTIONAL, default is "dns/txt"). Each
query method is of the form "type[/options]", where the syntax and query method is of the form "type[/options]", where the syntax and
semantics of the options depend on the type and specified options. semantics of the options depend on the type and specified options.
If there are multiple query mechanisms listed, the choice of query If there are multiple query mechanisms listed, the choice of query
mechanism MUST NOT change the interpretation of the signature. mechanism MUST NOT change the interpretation of the signature.
Implementations MUST use the recognized query mechanisms in the Implementations MUST use the recognized query mechanisms in the
order presented. Unrecognized query mechanisms MUST be ignored. order presented. Unrecognized query mechanisms MUST be ignored.
Currently, the only valid value is "dns/txt", which defines the Currently, the only valid value is "dns/txt", which defines the
DNS TXT resource record (RR) lookup algorithm described elsewhere DNS TXT resource record (RR) lookup algorithm described elsewhere
in this document. The only option defined for the "dns" query in this document. The only option defined for the "dns" query
type is "txt", which MUST be included. Verifiers and signers MUST type is "txt", which MUST be included. Verifiers and Signers MUST
support "dns/txt". support "dns/txt".
ABNF: ABNF:
sig-q-tag = %x71 [FWS] "=" [FWS] sig-q-tag-method sig-q-tag = %x71 [FWS] "=" [FWS] sig-q-tag-method
*([FWS] ":" [FWS] sig-q-tag-method) *([FWS] ":" [FWS] sig-q-tag-method)
sig-q-tag-method = "dns/txt" / x-sig-q-tag-type
["/" x-sig-q-tag-args] sig-q-tag-method = "dns/txt" / x-sig-q-tag-type
x-sig-q-tag-type = hyphenated-word ; for future extension ["/" x-sig-q-tag-args]
x-sig-q-tag-args = qp-hdr-value x-sig-q-tag-type = hyphenated-word ; for future extension
x-sig-q-tag-args = qp-hdr-value
s= The selector subdividing the namespace for the "d=" (domain) tag s= The selector subdividing the namespace for the "d=" (domain) tag
(plain-text; REQUIRED). (plain-text; REQUIRED).
Internationalized selector names MUST be encoded as A-Labels, as Internationalized selector names MUST be encoded as A-labels, as
described in Section 2.3 of [RFC5890]. described in Section 2.3 of [RFC5890].
ABNF: ABNF:
sig-s-tag = %x73 [FWS] "=" [FWS] selector sig-s-tag = %x73 [FWS] "=" [FWS] selector
t= Signature Timestamp (plain-text unsigned decimal integer; t= Signature Timestamp (plain-text unsigned decimal integer;
RECOMMENDED, default is an unknown creation time). The time that RECOMMENDED, default is an unknown creation time). The time that
this signature was created. The format is the number of seconds this signature was created. The format is the number of seconds
since 00:00:00 on January 1, 1970 in the UTC time zone. The value since 00:00:00 on January 1, 1970 in the UTC time zone. The value
is expressed as an unsigned integer in decimal ASCII. This value is expressed as an unsigned integer in decimal ASCII. This value
is not constrained to fit into a 31- or 32-bit integer. is not constrained to fit into a 31- or 32-bit integer.
Implementations SHOULD be prepared to handle values up to at least Implementations SHOULD be prepared to handle values up to at least
10^12 (until approximately AD 200,000; this fits into 40 bits). 10^12 (until approximately AD 200,000; this fits into 40 bits).
To avoid denial-of-service attacks, implementations MAY consider To avoid denial-of-service attacks, implementations MAY consider
any value longer than 12 digits to be infinite. Leap seconds are any value longer than 12 digits to be infinite. Leap seconds are
not counted. Implementations MAY ignore signatures that have a not counted. Implementations MAY ignore signatures that have a
timestamp in the future. timestamp in the future.
ABNF: ABNF:
sig-t-tag = %x74 [FWS] "=" [FWS] 1*12DIGIT sig-t-tag = %x74 [FWS] "=" [FWS] 1*12DIGIT
x= Signature Expiration (plain-text unsigned decimal integer; x= Signature Expiration (plain-text unsigned decimal integer;
RECOMMENDED, default is no expiration). The format is the same as RECOMMENDED, default is no expiration). The format is the same as
in the "t=" tag, represented as an absolute date, not as a time in the "t=" tag, represented as an absolute date, not as a time
delta from the signing timestamp. The value is expressed as an delta from the signing timestamp. The value is expressed as an
unsigned integer in decimal ASCII, with the same constraints on unsigned integer in decimal ASCII, with the same constraints on
the value in the "t=" tag. Signatures MAY be considered invalid the value in the "t=" tag. Signatures MAY be considered invalid
if the verification time at the verifier is past the expiration if the verification time at the Verifier is past the expiration
date. The verification time should be the time that the message date. The verification time should be the time that the message
was first received at the administrative domain of the verifier if was first received at the administrative domain of the Verifier if
that time is reliably available; otherwise the current time should that time is reliably available; otherwise, the current time
be used. The value of the "x=" tag MUST be greater than the value should be used. The value of the "x=" tag MUST be greater than
of the "t=" tag if both are present. the value of the "t=" tag if both are present.
INFORMATIVE NOTE: The "x=" tag is not intended as an anti- INFORMATIVE NOTE: The "x=" tag is not intended as an anti-
replay defense. replay defense.
INFORMATIVE NOTE: Due to clock drift, the receiver's notion of INFORMATIVE NOTE: Due to clock drift, the receiver's notion of
when to consider the signature expired may not match exactly when to consider the signature expired may not exactly match
when the sender is expecting. Receivers MAY add a 'fudge what the sender is expecting. Receivers MAY add a 'fudge
factor' to allow for such possible drift. factor' to allow for such possible drift.
ABNF: ABNF:
sig-x-tag = %x78 [FWS] "=" [FWS] sig-x-tag = %x78 [FWS] "=" [FWS]
1*12DIGIT 1*12DIGIT
z= Copied header fields (dkim-quoted-printable, but see description; z= Copied header fields (dkim-quoted-printable, but see description;
OPTIONAL, default is null). A vertical-bar-separated list of OPTIONAL, default is null). A vertical-bar-separated list of
selected header fields present when the message was signed, selected header fields present when the message was signed,
including both the field name and value. It is not required to including both the field name and value. It is not required to
include all header fields present at the time of signing. This include all header fields present at the time of signing. This
field need not contain the same header fields listed in the "h=" field need not contain the same header fields listed in the "h="
tag. The header field text itself must encode the vertical bar tag. The header field text itself must encode the vertical bar
("|", %x7C) character (i.e., vertical bars in the "z=" text are ("|", %x7C) character (i.e., vertical bars in the "z=" text are
meta-characters, and any actual vertical bar characters in a meta-characters, and any actual vertical bar characters in a
copied header field must be encoded). Note that all whitespace copied header field must be encoded). Note that all whitespace
must be encoded, including whitespace between the colon and the must be encoded, including whitespace between the colon and the
header field value. After encoding, FWS MAY be added at arbitrary header field value. After encoding, FWS MAY be added at arbitrary
locations in order to avoid excessively long lines; such locations in order to avoid excessively long lines; such
whitespace is NOT part of the value of the header field, and MUST whitespace is NOT part of the value of the header field and MUST
be removed before decoding. be removed before decoding.
The header fields referenced by the "h=" tag refer to the fields The header fields referenced by the "h=" tag refer to the fields
in the [RFC5322] header of the message, not to any copied fields in the [RFC5322] header of the message, not to any copied fields
in the "z=" tag. Copied header field values are for diagnostic in the "z=" tag. Copied header field values are for diagnostic
use. use.
ABNF: ABNF:
sig-z-tag = %x7A [FWS] "=" [FWS] sig-z-tag-copy sig-z-tag = %x7A [FWS] "=" [FWS] sig-z-tag-copy
*( "|" [FWS] sig-z-tag-copy ) *( "|" [FWS] sig-z-tag-copy )
sig-z-tag-copy = hdr-name [FWS] ":" qp-hdr-value sig-z-tag-copy = hdr-name [FWS] ":" qp-hdr-value
INFORMATIVE EXAMPLE of a signature header field spread across INFORMATIVE EXAMPLE of a signature header field spread across
multiple continuation lines: multiple continuation lines:
DKIM-Signature: v=1; a=rsa-sha256; d=example.net; s=brisbane; DKIM-Signature: v=1; a=rsa-sha256; d=example.net; s=brisbane;
c=simple; q=dns/txt; i=@eng.example.net; c=simple; q=dns/txt; i=@eng.example.net;
t=1117574938; x=1118006938; t=1117574938; x=1118006938;
h=from:to:subject:date; h=from:to:subject:date;
z=From:foo@eng.example.net|To:joe@example.com| z=From:foo@eng.example.net|To:joe@example.com|
Subject:demo=20run|Date:July=205,=202005=203:44:08=20PM=20-0700; Subject:demo=20run|Date:July=205,=202005=203:44:08=20PM=20-0700;
bh=MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=; bh=MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=;
b=dzdVyOfAKCdLXdJOc9G2q8LoXSlEniSbav+yuU4zGeeruD00lszZVoG4ZHRNiYzR b=dzdVyOfAKCdLXdJOc9G2q8LoXSlEniSbav+yuU4zGeeruD00lszZVoG4ZHRNiYzR
3.6. Key Management and Representation 3.6. Key Management and Representation
skipping to change at page 28, line 8 skipping to change at page 26, line 8
t=1117574938; x=1118006938; t=1117574938; x=1118006938;
h=from:to:subject:date; h=from:to:subject:date;
z=From:foo@eng.example.net|To:joe@example.com| z=From:foo@eng.example.net|To:joe@example.com|
Subject:demo=20run|Date:July=205,=202005=203:44:08=20PM=20-0700; Subject:demo=20run|Date:July=205,=202005=203:44:08=20PM=20-0700;
bh=MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=; bh=MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=;
b=dzdVyOfAKCdLXdJOc9G2q8LoXSlEniSbav+yuU4zGeeruD00lszZVoG4ZHRNiYzR b=dzdVyOfAKCdLXdJOc9G2q8LoXSlEniSbav+yuU4zGeeruD00lszZVoG4ZHRNiYzR
3.6. Key Management and Representation 3.6. Key Management and Representation
Signature applications require some level of assurance that the Signature applications require some level of assurance that the
verification public key is associated with the claimed signer. Many verification public key is associated with the claimed Signer. Many
applications achieve this by using public key certificates issued by applications achieve this by using public-key certificates issued by
a trusted third party. However, DKIM can achieve a sufficient level a trusted third party. However, DKIM can achieve a sufficient level
of security, with significantly enhanced scalability, by simply of security, with significantly enhanced scalability, by simply
having the verifier query the purported signer's DNS entry (or some having the Verifier query the purported Signer's DNS entry (or some
security-equivalent) in order to retrieve the public key. security-equivalent) in order to retrieve the public key.
DKIM keys can potentially be stored in multiple types of key servers DKIM keys can potentially be stored in multiple types of key servers
and in multiple formats. The storage and format of keys are and in multiple formats. The storage and format of keys are
irrelevant to the remainder of the DKIM algorithm. irrelevant to the remainder of the DKIM algorithm.
Parameters to the key lookup algorithm are the type of the lookup Parameters to the key lookup algorithm are the type of the lookup
(the "q=" tag), the domain of the signer (the "d=" tag of the DKIM- (the "q=" tag), the domain of the Signer (the "d=" tag of the DKIM-
Signature header field), and the selector (the "s=" tag). Signature header field), and the selector (the "s=" tag).
public_key = dkim_find_key(q_val, d_val, s_val) public_key = dkim_find_key(q_val, d_val, s_val)
This document defines a single binding, using DNS TXT RRs to This document defines a single binding, using DNS TXT RRs to
distribute the keys. Other bindings may be defined in the future. distribute the keys. Other bindings may be defined in the future.
3.6.1. Textual Representation 3.6.1. Textual Representation
It is expected that many key servers will choose to present the keys It is expected that many key servers will choose to present the keys
skipping to change at page 28, line 45 skipping to change at page 26, line 45
The overall syntax is a tag-list as described in Section 3.2. The The overall syntax is a tag-list as described in Section 3.2. The
current valid tags are described below. Other tags MAY be present current valid tags are described below. Other tags MAY be present
and MUST be ignored by any implementation that does not understand and MUST be ignored by any implementation that does not understand
them. them.
v= Version of the DKIM key record (plain-text; RECOMMENDED, default v= Version of the DKIM key record (plain-text; RECOMMENDED, default
is "DKIM1"). If specified, this tag MUST be set to "DKIM1" is "DKIM1"). If specified, this tag MUST be set to "DKIM1"
(without the quotes). This tag MUST be the first tag in the (without the quotes). This tag MUST be the first tag in the
record. Records beginning with a "v=" tag with any other value record. Records beginning with a "v=" tag with any other value
MUST be discarded. Note that verifiers must do a string MUST be discarded. Note that Verifiers must do a string
comparison on this value; for example, "DKIM1" is not the same as comparison on this value; for example, "DKIM1" is not the same as
"DKIM1.0". "DKIM1.0".
ABNF: ABNF:
key-v-tag = %x76 [FWS] "=" [FWS] %x44.4B.49.4D.31
key-v-tag = %x76 [FWS] "=" [FWS] %x44.4B.49.4D.31
h= Acceptable hash algorithms (plain-text; OPTIONAL, defaults to h= Acceptable hash algorithms (plain-text; OPTIONAL, defaults to
allowing all algorithms). A colon-separated list of hash allowing all algorithms). A colon-separated list of hash
algorithms that might be used. Unrecognized algorithms MUST be algorithms that might be used. Unrecognized algorithms MUST be
ignored. Refer to Section 3.3 for a discussion of the hash ignored. Refer to Section 3.3 for a discussion of the hash
algorithms implemented by Signers and Verifiers. The set of algorithms implemented by Signers and Verifiers. The set of
algorithms listed in this tag in each record is an operational algorithms listed in this tag in each record is an operational
choice made by the Signer. choice made by the Signer.
ABNF: ABNF:
key-h-tag = %x68 [FWS] "=" [FWS] key-h-tag-alg key-h-tag = %x68 [FWS] "=" [FWS] key-h-tag-alg
*( [FWS] ":" [FWS] key-h-tag-alg ) *( [FWS] ":" [FWS] key-h-tag-alg )
key-h-tag-alg = "sha1" / "sha256" / x-key-h-tag-alg key-h-tag-alg = "sha1" / "sha256" / x-key-h-tag-alg
x-key-h-tag-alg = hyphenated-word ; for future extension x-key-h-tag-alg = hyphenated-word ; for future extension
k= Key type (plain-text; OPTIONAL, default is "rsa"). Signers and k= Key type (plain-text; OPTIONAL, default is "rsa"). Signers and
verifiers MUST support the "rsa" key type. The "rsa" key type Verifiers MUST support the "rsa" key type. The "rsa" key type
indicates that an ASN.1 DER-encoded [ITU-X660-1997] RSAPublicKey indicates that an ASN.1 DER-encoded [ITU-X660-1997] RSAPublicKey
[RFC3447] (see Sections Section 3.1 and A.1.1) is being used in (see [RFC3447], Sections 3.1 and A.1.1) is being used in the "p="
the "p=" tag. (Note: the "p=" tag further encodes the value using tag. (Note: the "p=" tag further encodes the value using the
the base64 algorithm.) Unrecognized key types MUST be ignored. base64 algorithm.) Unrecognized key types MUST be ignored.
ABNF: ABNF:
key-k-tag = %x76 [FWS] "=" [FWS] key-k-tag-type key-k-tag = %x76 [FWS] "=" [FWS] key-k-tag-type
key-k-tag-type = "rsa" / x-key-k-tag-type key-k-tag-type = "rsa" / x-key-k-tag-type
x-key-k-tag-type = hyphenated-word ; for future extension x-key-k-tag-type = hyphenated-word ; for future extension
n= Notes that might be of interest to a human (qp-section; OPTIONAL, n= Notes that might be of interest to a human (qp-section; OPTIONAL,
default is empty). No interpretation is made by any program. default is empty). No interpretation is made by any program.
This tag should be used sparingly in any key server mechanism that This tag should be used sparingly in any key server mechanism that
has space limitations (notably DNS). This is intended for use by has space limitations (notably DNS). This is intended for use by
administrators, not end users. administrators, not end users.
ABNF: ABNF:
key-n-tag = %x6e [FWS] "=" [FWS] qp-section key-n-tag = %x6e [FWS] "=" [FWS] qp-section
p= Public-key data (base64; REQUIRED). An empty value means that p= Public-key data (base64; REQUIRED). An empty value means that
this public key has been revoked. The syntax and semantics of this public key has been revoked. The syntax and semantics of
this tag value before being encoded in base64 are defined by the this tag value before being encoded in base64 are defined by the
"k=" tag. "k=" tag.
INFORMATIVE RATIONALE: If a private key has been compromised or INFORMATIVE RATIONALE: If a private key has been compromised or
otherwise disabled (e.g., an outsourcing contract has been otherwise disabled (e.g., an outsourcing contract has been
terminated), a signer might want to explicitly state that it terminated), a Signer might want to explicitly state that it
knows about the selector, but all messages using that selector knows about the selector, but all messages using that selector
should fail verification. Verifiers SHOULD return an error should fail verification. Verifiers SHOULD return an error
code for any DKIM-Signature header field with a selector code for any DKIM-Signature header field with a selector
referencing a revoked key. (See Section 6.1.2 for details.) referencing a revoked key. (See Section 6.1.2 for details.)
ABNF: ABNF:
key-p-tag = %x70 [FWS] "=" [ [FWS] base64string] key-p-tag = %x70 [FWS] "=" [ [FWS] base64string]
INFORMATIVE NOTE: A base64string is permitted to include white INFORMATIVE NOTE: A base64string is permitted to include
space (FWS) at arbitrary places; however, any CRLFs must be whitespace (FWS) at arbitrary places; however, any CRLFs must
followed by at least one WSP character. Implementors and be followed by at least one WSP character. Implementers and
administrators are cautioned to ensure that selector TXT RRs administrators are cautioned to ensure that selector TXT RRs
conform to this specification. conform to this specification.
s= Service Type (plain-text; OPTIONAL; default is "*"). A colon- s= Service Type (plain-text; OPTIONAL; default is "*"). A colon-
separated list of service types to which this record applies. separated list of service types to which this record applies.
Verifiers for a given service type MUST ignore this record if the Verifiers for a given service type MUST ignore this record if the
appropriate type is not listed. Unrecognized service types MUST appropriate type is not listed. Unrecognized service types MUST
be ignored. Currently defined service types are as follows: be ignored. Currently defined service types are as follows:
* matches all service types * matches all service types
email electronic mail (not necessarily limited to SMTP) email electronic mail (not necessarily limited to SMTP)
This tag is intended to constrain the use of keys for other This tag is intended to constrain the use of keys for other
purposes, should use of DKIM be defined by other services in the purposes, should use of DKIM be defined by other services in the
future. future.
ABNF: ABNF:
key-s-tag = %x73 [FWS] "=" [FWS] key-s-tag-type key-s-tag = %x73 [FWS] "=" [FWS] key-s-tag-type
*( [FWS] ":" [FWS] key-s-tag-type ) *( [FWS] ":" [FWS] key-s-tag-type )
key-s-tag-type = "email" / "*" / x-key-s-tag-type key-s-tag-type = "email" / "*" / x-key-s-tag-type
x-key-s-tag-type = hyphenated-word ; for future extension x-key-s-tag-type = hyphenated-word ; for future extension
t= Flags, represented as a colon-separated list of names (plain- t= Flags, represented as a colon-separated list of names (plain-
text; OPTIONAL, default is no flags set). Unrecognized flags MUST text; OPTIONAL, default is no flags set). Unrecognized flags MUST
be ignored. The defined flags are as follows: be ignored. The defined flags are as follows:
y This domain is testing DKIM. Verifiers MUST NOT treat messages y This domain is testing DKIM. Verifiers MUST NOT treat messages
from signers in testing mode differently from unsigned email, even from Signers in testing mode differently from unsigned email,
should the signature fail to verify. Verifiers MAY wish to track even should the signature fail to verify. Verifiers MAY wish
testing mode results to assist the signer. to track testing mode results to assist the Signer.
s Any DKIM-Signature header fields using the "i=" tag MUST have the s Any DKIM-Signature header fields using the "i=" tag MUST have
same domain value on the right-hand side of the "@" in the "i=" the same domain value on the right-hand side of the "@" in the
tag and the value of the "d=" tag. That is, the "i=" domain MUST "i=" tag and the value of the "d=" tag. That is, the "i="
NOT be a subdomain of "d=". Use of this flag is RECOMMENDED domain MUST NOT be a subdomain of "d=". Use of this flag is
unless subdomaining is required. RECOMMENDED unless subdomaining is required.
ABNF: ABNF:
key-t-tag = %x74 [FWS] "=" [FWS] key-t-tag-flag key-t-tag = %x74 [FWS] "=" [FWS] key-t-tag-flag
*( [FWS] ":" [FWS] key-t-tag-flag ) *( [FWS] ":" [FWS] key-t-tag-flag )
key-t-tag-flag = "y" / "s" / x-key-t-tag-flag key-t-tag-flag = "y" / "s" / x-key-t-tag-flag
x-key-t-tag-flag = hyphenated-word ; for future extension x-key-t-tag-flag = hyphenated-word ; for future extension
3.6.2. DNS Binding 3.6.2. DNS Binding
A binding using DNS TXT RRs as a key service is hereby defined. All A binding using DNS TXT RRs as a key service is hereby defined. All
implementations MUST support this binding. implementations MUST support this binding.
3.6.2.1. Namespace 3.6.2.1. Namespace
All DKIM keys are stored in a subdomain named "_domainkey". Given a All DKIM keys are stored in a subdomain named "_domainkey". Given a
DKIM-Signature field with a "d=" tag of "example.com" and an "s=" tag DKIM-Signature field with a "d=" tag of "example.com" and an "s=" tag
skipping to change at page 32, line 23 skipping to change at page 29, line 48
intervening whitespace. TXT RRs MUST be unique for a particular intervening whitespace. TXT RRs MUST be unique for a particular
selector name; that is, if there are multiple records in an RRset, selector name; that is, if there are multiple records in an RRset,
the results are undefined. the results are undefined.
TXT RRs are encoded as described in Section 3.6.1. TXT RRs are encoded as described in Section 3.6.1.
3.7. Computing the Message Hashes 3.7. Computing the Message Hashes
Both signing and verifying message signatures start with a step of Both signing and verifying message signatures start with a step of
computing two cryptographic hashes over the message. Signers will computing two cryptographic hashes over the message. Signers will
choose the parameters of the signature as described in Signer Actions choose the parameters of the signature as described in "Signer
(Section 5); verifiers will use the parameters specified in the DKIM- Actions" (Section 5); Verifiers will use the parameters specified in
Signature header field being verified. In the following discussion, the DKIM-Signature header field being verified. In the following
the names of the tags in the DKIM-Signature header field that either discussion, the names of the tags in the DKIM-Signature header field
exists (when verifying) or will be created (when signing) are used. that either exists (when verifying) or will be created (when signing)
Note that canonicalization (Section 3.4) is only used to prepare the are used. Note that canonicalization (Section 3.4) is only used to
email for signing or verifying; it does not affect the transmitted prepare the email for signing or verifying; it does not affect the
email in any way. transmitted email in any way.
The signer/verifier MUST compute two hashes, one over the body of the The Signer/Verifier MUST compute two hashes: one over the body of the
message and one over the selected header fields of the message. message and one over the selected header fields of the message.
Signers MUST compute them in the order shown. Verifiers MAY compute Signers MUST compute them in the order shown. Verifiers MAY compute
them in any order convenient to the verifier, provided that the them in any order convenient to the Verifier, provided that the
result is semantically identical to the semantics that would be the result is semantically identical to the semantics that would be the
case had they been computed in this order. case had they been computed in this order.
In hash step 1, the signer/verifier MUST hash the message body, In hash step 1, the Signer/Verifier MUST hash the message body,
canonicalized using the body canonicalization algorithm specified in canonicalized using the body canonicalization algorithm specified in
the "c=" tag and then truncated to the length specified in the "l=" the "c=" tag and then truncated to the length specified in the "l="
tag. That hash value is then converted to base64 form and inserted tag. That hash value is then converted to base64 form and inserted
into (signers) or compared to (verifiers) the "bh=" tag of the DKIM- into (Signers) or compared to (Verifiers) the "bh=" tag of the DKIM-
Signature header field. Signature header field.
In hash step 2, the signer/verifier MUST pass the following to the In hash step 2, the Signer/Verifier MUST pass the following to the
hash algorithm in the indicated order. hash algorithm in the indicated order.
1. The header fields specified by the "h=" tag, in the order 1. The header fields specified by the "h=" tag, in the order
specified in that tag, and canonicalized using the header specified in that tag, and canonicalized using the header
canonicalization algorithm specified in the "c=" tag. Each canonicalization algorithm specified in the "c=" tag. Each
header field MUST be terminated with a single CRLF. header field MUST be terminated with a single CRLF.
2. The DKIM-Signature header field that exists (verifying) or will 2. The DKIM-Signature header field that exists (verifying) or will
be inserted (signing) in the message, with the value of the "b=" be inserted (signing) in the message, with the value of the "b="
tag (including all surrounding whitespace) deleted (i.e., treated tag (including all surrounding whitespace) deleted (i.e., treated
as the empty string), canonicalized using the header as the empty string), canonicalized using the header
canonicalization algorithm specified in the "c=" tag, and without canonicalization algorithm specified in the "c=" tag, and without
a trailing CRLF. a trailing CRLF.
All tags and their values in the DKIM-Signature header field are All tags and their values in the DKIM-Signature header field are
included in the cryptographic hash with the sole exception of the included in the cryptographic hash with the sole exception of the
value portion of the "b=" (signature) tag, which MUST be treated as value portion of the "b=" (signature) tag, which MUST be treated as
the null string. All tags MUST be included even if they might not be the null string. All tags MUST be included even if they might not be
understood by the verifier. The header field MUST be presented to understood by the Verifier. The header field MUST be presented to
the hash algorithm after the body of the message rather than with the the hash algorithm after the body of the message rather than with the
rest of the header fields and MUST be canonicalized as specified in rest of the header fields and MUST be canonicalized as specified in
the "c=" (canonicalization) tag. The DKIM-Signature header field the "c=" (canonicalization) tag. The DKIM-Signature header field
MUST NOT be included in its own h= tag, although other DKIM-Signature MUST NOT be included in its own "h=" tag, although other DKIM-
header fields MAY be signed (see Section 4). Signature header fields MAY be signed (see Section 4).
When calculating the hash on messages that will be transmitted using When calculating the hash on messages that will be transmitted using
base64 or quoted-printable encoding, signers MUST compute the hash base64 or quoted-printable encoding, Signers MUST compute the hash
after the encoding. Likewise, the verifier MUST incorporate the after the encoding. Likewise, the Verifier MUST incorporate the
values into the hash before decoding the base64 or quoted-printable values into the hash before decoding the base64 or quoted-printable
text. However, the hash MUST be computed before transport level text. However, the hash MUST be computed before transport-level
encodings such as SMTP "dot-stuffing" (the modification of lines encodings such as SMTP "dot-stuffing" (the modification of lines
beginning with a "." to avoid confusion with the SMTP end-of-message beginning with a "." to avoid confusion with the SMTP end-of-message
marker, as specified in [RFC5321]). marker, as specified in [RFC5321]).
With the exception of the canonicalization procedure described in With the exception of the canonicalization procedure described in
Section 3.4, the DKIM signing process treats the body of messages as Section 3.4, the DKIM signing process treats the body of messages as
simply a string of octets. DKIM messages MAY be either in plain-text simply a string of octets. DKIM messages MAY be either in plain-text
or in MIME format; no special treatment is afforded to MIME content. or in MIME format; no special treatment is afforded to MIME content.
Message attachments in MIME format MUST be included in the content Message attachments in MIME format MUST be included in the content
that is signed. that is signed.
More formally, pseudo-code for the signature algorithm is: More formally, pseudo-code for the signature algorithm is:
body-hash = hash-alg (canon-body, l-param)
body-hash = hash-alg (canon-body, l-param)
data-hash = hash-alg (h-headers, D-SIG, body-hash) data-hash = hash-alg (h-headers, D-SIG, body-hash)
signature = sig-alg (d-domain, selector, data-hash) signature = sig-alg (d-domain, selector, data-hash)
where: where:
body-hash: is the output from hashing the body, using hash-alg. body-hash: is the output from hashing the body, using hash-alg.
hash-alg: is the hashing algorithm specified in the "a" hash-alg: is the hashing algorithm specified in the "a" parameter.
parameter.
canon-body: is a canonicalized representation of the body, canon-body: is a canonicalized representation of the body, produced
produced by using the body algorithm specified in the "c" using the body algorithm specified in the "c" parameter,
parameter, as defined in Section 3.4 and excluding the as defined in Section 3.4 and excluding the
DKIM-Signature field. DKIM-Signature field.
l-param: is the length-of-body value of the "l" parameter. l-param: is the length-of-body value of the "l" parameter.
data-hash: is the output from using the hash-alg algorithm, to data-hash: is the output from using the hash-alg algorithm, to hash
hash the header including the DKIM-Signature header, and the the header including the DKIM-Signature header, and the
body hash. body hash.
h-headers: is the list of headers to be signed, as specified in h-headers: is the list of headers to be signed, as specified in the
the "h" parameter. "h" parameter.
D-SIG: is the canonicalized DKIM-Signature field without the D-SIG: is the canonicalized DKIM-Signature field itself without
signature value portion of the parameter, itself; that is, an the signature value portion of the parameter, that is, an
empty parameter value. empty parameter value.
signature: is the signature value produced by the signing signature: is the signature value produced by the signing algorithm.
algorithm.
sig-alg: is the signature algorithm specified by the "a" sig-alg: is the signature algorithm specified by the "a"
parameter. parameter.
d-domain: is the domain name specified in the "d" parameter. d-domain: is the domain name specified in the "d" parameter.
selector: is the selector value specified in the "s" parameter. selector: is the selector value specified in the "s" parameter.
NOTE: Many digital signature APIs provide both hashing and NOTE: Many digital signature APIs provide both hashing and
application of the RSA private key using a single "sign()" application of the RSA private key using a single "sign()"
primitive. When using such an API, the last two steps in the primitive. When using such an API, the last two steps in the
algorithm would probably be combined into a single call that would algorithm would probably be combined into a single call that would
perform both the "a-hash-alg" and the "sig-alg". perform both the "a-hash-alg" and the "sig-alg".
3.8. Input Requirements 3.8. Input Requirements
A message that is not compliant with RFC5322, RFC2045 and RFC2047 can A message that is not compliant with [RFC5322], [RFC2045], and
be subject to attempts by intermediaries to correct or interpret such [RFC2047] can be subject to attempts by intermediaries to correct or
content. See Section 8 of [RFC4409] for examples of changes that are interpret such content. See Section 8 of [RFC4409] for examples of
commonly made. Such "corrections" may invalidate DKIM signatures or changes that are commonly made. Such "corrections" may invalidate
have other undesirable effects, including some that involve changes DKIM signatures or have other undesirable effects, including some
to the way a message is presented to an end user. that involve changes to the way a message is presented to an end
user.
Accordingly, DKIM's design is predicated on valid input. Therefore, Accordingly, DKIM's design is predicated on valid input. Therefore,
signers and verifiers SHOULD take reasonable steps to ensure that the Signers and Verifiers SHOULD take reasonable steps to ensure that the
messages they are processing are valid according to [RFC5322], messages they are processing are valid according to [RFC5322],
[RFC2045], and any other relevant message format standards. [RFC2045], and any other relevant message format standards.
See Section 8.15 for additional discussion. See Section 8.15 for additional discussion.
3.9. Output Requirements 3.9. Output Requirements
The evaluation of each signature ends in one of three states, which The evaluation of each signature ends in one of three states, which
this document refers to as follows: this document refers to as follows:
skipping to change at page 36, line 21 skipping to change at page 33, line 44
single responsible Agent or User Identifier (AUID). single responsible Agent or User Identifier (AUID).
Hence, DKIM's mandatory output to a receive-side Identity Assessor is Hence, DKIM's mandatory output to a receive-side Identity Assessor is
a single domain name. Within the scope of its use as DKIM output, a single domain name. Within the scope of its use as DKIM output,
the name has only basic domain name semantics; any possible owner- the name has only basic domain name semantics; any possible owner-
specific semantics are outside the scope of DKIM. That is, within specific semantics are outside the scope of DKIM. That is, within
its role as a DKIM identifier, additional semantics cannot be assumed its role as a DKIM identifier, additional semantics cannot be assumed
by an Identity Assessor. by an Identity Assessor.
Upon successfully verifying the signature, a receive-side DKIM Upon successfully verifying the signature, a receive-side DKIM
verifier MUST communicate the Signing Domain Identifier (d=) to a Verifier MUST communicate the Signing Domain Identifier (d=) to a
consuming Identity Assessor module and MAY communicate the Agent or consuming Identity Assessor module and MAY communicate the Agent or
User Identifier (i=) if present. User Identifier (i=) if present.
To the extent that a receiver attempts to intuit any structured To the extent that a receiver attempts to intuit any structured
semantics for either of the identifiers, this is a heuristic function semantics for either of the identifiers, this is a heuristic function
that is outside the scope of DKIM's specification and semantics. that is outside the scope of DKIM's specification and semantics.
Hence, it is relegated to a higher-level service, such as a delivery
Hence, it is relegated to a higher-level service, such as a delivery-
handling filter that integrates a variety of inputs and performs handling filter that integrates a variety of inputs and performs
heuristic analysis of them. heuristic analysis of them.
INFORMATIVE DISCUSSION: This document does not require the value INFORMATIVE DISCUSSION: This document does not require the value
of the SDID or AUID to match an identifier in any other message of the SDID or AUID to match an identifier in any other message
header field. This requirement is, instead, an assessor policy header field. This requirement is, instead, an Assessor policy
issue. The purpose of such a linkage would be to authenticate the issue. The purpose of such a linkage would be to authenticate the
value in that other header field. This, in turn, is the basis for value in that other header field. This, in turn, is the basis for
applying a trust assessment based on the identifier value. Trust applying a trust assessment based on the identifier value. Trust
is a broad and complex topic and trust mechanisms are subject to is a broad and complex topic, and trust mechanisms are subject to
highly creative attacks. The real-world efficacy of any but the highly creative attacks. The real-world efficacy of any but the
most basic bindings between the SDID or AUID and other identities most basic bindings between the SDID or AUID and other identities
is not well established, nor is its vulnerability to subversion by is not well established, nor is its vulnerability to subversion by
an attacker. Hence, reliance on the use of such bindings should an attacker. Hence, reliance on the use of such bindings should
be strictly limited. In particular, it is not at all clear to be strictly limited. In particular, it is not at all clear to
what extent a typical end-user recipient can rely on any what extent a typical end-user recipient can rely on any
assurances that might be made by successful use of the SDID or assurances that might be made by successful use of the SDID or
AUID. AUID.
4. Semantics of Multiple Signatures 4. Semantics of Multiple Signatures
4.1. Example Scenarios 4.1. Example Scenarios
There are many reasons why a message might have multiple signatures. There are many reasons why a message might have multiple signatures.
For example, suppose SHA-256 is in the future found to be For example, suppose SHA-256 is in the future found to be
insufficiently strong, and DKIM usage transitions to SHA-1024. A insufficiently strong, and DKIM usage transitions to SHA-1024. A
signer might immediately sign using the newer algorithm, but also Signer might immediately sign using the newer algorithm but also
continue to sign using the older algorithm for interoperability with continue to sign using the older algorithm for interoperability with
verifiers that had not yet upgraded. The signer would do this by Verifiers that had not yet upgraded. The Signer would do this by
adding two DKIM-Signature header fields, one using each algorithm. adding two DKIM-Signature header fields, one using each algorithm.
Older verifiers that did not recognize SHA-1024 as an acceptable Older Verifiers that did not recognize SHA-1024 as an acceptable
algorithm would skip that signature and use the older algorithm; algorithm would skip that signature and use the older algorithm;
newer verifiers could use either signature at their option, and all newer Verifiers could use either signature at their option and, all
other things being equal might not even attempt to verify the other other things being equal, might not even attempt to verify the other
signature. signature.
Similarly, a signer might sign a message including all header fields Similarly, a Signer might sign a message including all header fields
and no "l=" tag (to satisfy strict verifiers) and a second time with and no "l=" tag (to satisfy strict Verifiers) and a second time with
a limited set of header fields and an "l=" tag (in anticipation of a limited set of header fields and an "l=" tag (in anticipation of
possible message modifications en route to other verifiers). possible message modifications en route to other Verifiers).
Verifiers could then choose which signature they preferred. Verifiers could then choose which signature they prefer.
Of course, a message might also have multiple signatures because it Of course, a message might also have multiple signatures because it
passed through multiple signers. A common case is expected to be passed through multiple Signers. A common case is expected to be
that of a signed message that passes through a mailing list that also that of a signed message that passes through a mailing list that also
signs all messages. Assuming both of those signatures verify, a signs all messages. Assuming both of those signatures verify, a
recipient might choose to accept the message if either of those recipient might choose to accept the message if either of those
signatures were known to come from trusted sources. signatures were known to come from trusted sources.
In particular, recipients might choose to whitelist mailing lists to In particular, recipients might choose to whitelist mailing lists to
which they have subscribed and that have acceptable anti-abuse which they have subscribed and that have acceptable anti-abuse
policies so as to accept messages sent to that list even from unknown policies so as to accept messages sent to that list even from unknown
authors. They might also subscribe to less trusted mailing lists authors. They might also subscribe to less trusted mailing lists
(e.g., those without anti-abuse protection) and be willing to accept (e.g., those without anti-abuse protection) and be willing to accept
all messages from specific authors, but insist on doing additional all messages from specific authors but insist on doing additional
abuse scanning for other messages. abuse scanning for other messages.
Another related example of multiple signers might be forwarding Another related example of multiple Signers might be forwarding
services, such as those commonly associated with academic alumni services, such as those commonly associated with academic alumni
sites. For example, a recipient might have an address at sites. For example, a recipient might have an address at
members.example.org, a site that has anti-abuse protection that is members.example.org, a site that has anti-abuse protection that is
somewhat less effective than the recipient would prefer. Such a somewhat less effective than the recipient would prefer. Such a
recipient might have specific authors whose messages would be trusted recipient might have specific authors whose messages would be trusted
absolutely, but messages from unknown authors that had passed the absolutely, but messages from unknown authors that had passed the
forwarder's scrutiny would have only medium trust. forwarder's scrutiny would have only medium trust.
4.2. Interpretation 4.2. Interpretation
A signer that is adding a signature to a message merely creates a new A Signer that is adding a signature to a message merely creates a new
DKIM-Signature header, using the usual semantics of the h= option. A DKIM-Signature header, using the usual semantics of the "h=" option.
signer MAY sign previously existing DKIM-Signature header fields A Signer MAY sign previously existing DKIM-Signature header fields
using the method described in Section 5.4 to sign trace header using the method described in Section 5.4 to sign trace header
fields. fields.
Note that signers should be cognizant that signing DKIM-Signature Note that Signers should be cognizant that signing DKIM-Signature
header fields may result in signature failures with intermediaries header fields may result in signature failures with intermediaries
that do not recognize that DKIM-Signature header fields are trace that do not recognize that DKIM-Signature header fields are trace
header fields and unwittingly reorder them, thus breaking such header fields and unwittingly reorder them, thus breaking such
signatures. For this reason, signing existing DKIM-Signature header signatures. For this reason, signing existing DKIM-Signature header
fields is unadvised, albeit legal. fields is unadvised, albeit legal.
INFORMATIVE NOTE: If a header field with multiple instances is INFORMATIVE NOTE: If a header field with multiple instances is
signed, those header fields are always signed from the bottom up. signed, those header fields are always signed from the bottom up.
Thus, it is not possible to sign only specific DKIM-Signature Thus, it is not possible to sign only specific DKIM-Signature
header fields. For example, if the message being signed already header fields. For example, if the message being signed already
contains three DKIM-Signature header fields A, B, and C, it is contains three DKIM-Signature header fields A, B, and C, it is
possible to sign all of them, B and C only, or C only, but not A possible to sign all of them, B and C only, or C only, but not A
only, B only, A and B only, or A and C only. only, B only, A and B only, or A and C only.
A signer MAY add more than one DKIM-Signature header field using A Signer MAY add more than one DKIM-Signature header field using
different parameters. For example, during a transition period a different parameters. For example, during a transition period, a
signer might want to produce signatures using two different hash Signer might want to produce signatures using two different hash
algorithms. algorithms.
Signers SHOULD NOT remove any DKIM-Signature header fields from Signers SHOULD NOT remove any DKIM-Signature header fields from
messages they are signing, even if they know that the signatures messages they are signing, even if they know that the signatures
cannot be verified. cannot be verified.
When evaluating a message with multiple signatures, a verifier SHOULD When evaluating a message with multiple signatures, a Verifier SHOULD
evaluate signatures independently and on their own merits. For evaluate signatures independently and on their own merits. For
example, a verifier that by policy chooses not to accept signatures example, a Verifier that by policy chooses not to accept signatures
with deprecated cryptographic algorithms would consider such with deprecated cryptographic algorithms would consider such
signatures invalid. Verifiers MAY process signatures in any order of signatures invalid. Verifiers MAY process signatures in any order of
their choice; for example, some verifiers might choose to process their choice; for example, some Verifiers might choose to process
signatures corresponding to the From field in the message header signatures corresponding to the From field in the message header
before other signatures. See Section 6.1 for more information about before other signatures. See Section 6.1 for more information about
signature choices. signature choices.
INFORMATIVE IMPLEMENTATION NOTE: Verifier attempts to correlate INFORMATIVE IMPLEMENTATION NOTE: Verifier attempts to correlate
valid signatures with invalid signatures in an attempt to guess valid signatures with invalid signatures in an attempt to guess
why a signature failed are ill-advised. In particular, there is why a signature failed are ill-advised. In particular, there is
no general way that a verifier can determine that an invalid no general way that a Verifier can determine that an invalid
signature was ever valid. signature was ever valid.
Verifiers SHOULD continue to check signatures until a signature Verifiers SHOULD continue to check signatures until a signature
successfully verifies to the satisfaction of the verifier. To limit successfully verifies to the satisfaction of the Verifier. To limit
potential denial-of-service attacks, verifiers MAY limit the total potential denial-of-service attacks, Verifiers MAY limit the total
number of signatures they will attempt to verify. number of signatures they will attempt to verify.
If a verifier module reports signatures whose evaluations produced If a Verifier module reports signatures whose evaluations produced
PERMFAIL results, identity assessors SHOULD ignore those signatures PERMFAIL results, Identity Assessors SHOULD ignore those signatures
(see Section 6.1), acting as though they were not present in the (see Section 6.1), acting as though they were not present in the
message. message.
5. Signer Actions 5. Signer Actions
The following steps are performed in order by signers. The following steps are performed in order by Signers.
5.1. Determine Whether the Email Should Be Signed and by Whom 5.1. Determine Whether the Email Should Be Signed and by Whom
A signer can obviously only sign email for domains for which it has a A Signer can obviously only sign email for domains for which it has a
private key and the necessary knowledge of the corresponding public private key and the necessary knowledge of the corresponding public
key and selector information. However, there are a number of other key and selector information. However, there are a number of other
reasons beyond the lack of a private key why a signer could choose reasons beyond the lack of a private key why a Signer could choose
not to sign an email. not to sign an email.
INFORMATIVE NOTE: A signer can be implemented as part of any INFORMATIVE NOTE: A Signer can be implemented as part of any
portion of the mail system as deemed appropriate, including an portion of the mail system as deemed appropriate, including an
MUA, a SUBMISSION server, or an MTA. Wherever implemented, MUA, a SUBMISSION server, or an MTA. Wherever implemented,
signers should beware of signing (and thereby asserting Signers should beware of signing (and thereby asserting
responsibility for) messages that may be problematic. In responsibility for) messages that may be problematic. In
particular, within a trusted enclave the signing domain might be particular, within a trusted enclave, the signing domain might be
derived from the header according to local policy; SUBMISSION derived from the header according to local policy; SUBMISSION
servers might only sign messages from users that are properly servers might only sign messages from users that are properly
authenticated and authorized. authenticated and authorized.
INFORMATIVE IMPLEMENTER ADVICE: SUBMISSION servers should not sign INFORMATIVE IMPLEMENTER ADVICE: SUBMISSION servers should not sign
Received header fields if the outgoing gateway MTA obfuscates Received header fields if the outgoing gateway MTA obfuscates
Received header fields, for example, to hide the details of Received header fields, for example, to hide the details of
internal topology. internal topology.
If an email cannot be signed for some reason, it is a local policy If an email cannot be signed for some reason, it is a local policy
decision as to what to do with that email. decision as to what to do with that email.
5.2. Select a Private Key and Corresponding Selector Information 5.2. Select a Private Key and Corresponding Selector Information
This specification does not define the basis by which a signer should This specification does not define the basis by which a Signer should
choose which private key and selector information to use. Currently, choose which private key and selector information to use. Currently,
all selectors are equal as far as this specification is concerned, so all selectors are equal as far as this specification is concerned, so
the decision should largely be a matter of administrative the decision should largely be a matter of administrative
convenience. Distribution and management of private keys is also convenience. Distribution and management of private keys is also
outside the scope of this document. outside the scope of this document.
INFORMATIVE OPERATIONS ADVICE: A signer should not sign with a INFORMATIVE OPERATIONS ADVICE: A Signer should not sign with a
private key when the selector containing the corresponding public private key when the selector containing the corresponding public
key is expected to be revoked or removed before the verifier has key is expected to be revoked or removed before the Verifier has
an opportunity to validate the signature. The signer should an opportunity to validate the signature. The Signer should
anticipate that verifiers can choose to defer validation, perhaps anticipate that Verifiers can choose to defer validation, perhaps
until the message is actually read by the final recipient. In until the message is actually read by the final recipient. In
particular, when rotating to a new key pair, signing should particular, when rotating to a new key pair, signing should
immediately commence with the new private key and the old public immediately commence with the new private key, and the old public
key should be retained for a reasonable validation interval before key should be retained for a reasonable validation interval before
being removed from the key server. being removed from the key server.
5.3. Normalize the Message to Prevent Transport Conversions 5.3. Normalize the Message to Prevent Transport Conversions
Some messages, particularly those using 8-bit characters, are subject Some messages, particularly those using 8-bit characters, are subject
to modification during transit, notably conversion to 7-bit form. to modification during transit, notably conversion to 7-bit form.
Such conversions will break DKIM signatures. In order to minimize Such conversions will break DKIM signatures. In order to minimize
the chances of such breakage, signers SHOULD convert the message to a the chances of such breakage, Signers SHOULD convert the message to a
suitable MIME content transfer encoding such as quoted-printable or suitable MIME content-transfer encoding such as quoted-printable or
base64 as described in [RFC2045] before signing. Such conversion is base64 as described in [RFC2045] before signing. Such conversion is
outside the scope of DKIM; the actual message SHOULD be converted to outside the scope of DKIM; the actual message SHOULD be converted to
7-bit MIME by an MUA or MSA prior to presentation to the DKIM 7-bit MIME by an MUA or MSA prior to presentation to the DKIM
algorithm. algorithm.
If the message is submitted to the signer with any local encoding If the message is submitted to the Signer with any local encoding
that will be modified before transmission, that modification to that will be modified before transmission, that modification to
canonical [RFC5322] form MUST be done before signing. In particular, canonical [RFC5322] form MUST be done before signing. In particular,
bare CR or LF characters (used by some systems as a local line bare CR or LF characters (used by some systems as a local line
separator convention) MUST be converted to the SMTP-standard CRLF separator convention) MUST be converted to the SMTP-standard CRLF
sequence before the message is signed. Any conversion of this sort sequence before the message is signed. Any conversion of this sort
SHOULD be applied to the message actually sent to the recipient(s), SHOULD be applied to the message actually sent to the recipient(s),
not just to the version presented to the signing algorithm. not just to the version presented to the signing algorithm.
More generally, the signer MUST sign the message as it is expected to More generally, the Signer MUST sign the message as it is expected to
be received by the verifier rather than in some local or internal be received by the Verifier rather than in some local or internal
form. form.
5.3.1. Body Length Limits 5.3.1. Body Length Limits
A body length count MAY be specified to limit the signature A body length count MAY be specified to limit the signature
calculation to an initial prefix of the body text, measured in calculation to an initial prefix of the body text, measured in
octets. If the body length count is not specified, the entire octets. If the body length count is not specified, the entire
message body is signed. message body is signed.
INFORMATIVE RATIONALE: This capability is provided because it is INFORMATIVE RATIONALE: This capability is provided because it is
very common for mailing lists to add trailers to messages (e.g., very common for mailing lists to add trailers to messages (e.g.,
instructions how to get off the list). Until those messages are instructions on how to get off the list). Until those messages
also signed, the body length count is a useful tool for the are also signed, the body length count is a useful tool for the
verifier since it may as a matter of policy accept messages having Verifier since it can, as a matter of policy, accept messages
valid signatures with extraneous data. having valid signatures with extraneous data.
The length actually hashed should be inserted in the "l=" tag of the The length actually hashed should be inserted in the "l=" tag of the
DKIM-Signature header field. (See Section 3.5.) DKIM-Signature header field. (See Section 3.5.)
The body length count allows the signer of a message to permit data The body length count allows the Signer of a message to permit data
to be appended to the end of the body of a signed message. The body to be appended to the end of the body of a signed message. The body
length count MUST be calculated following the canonicalization length count MUST be calculated following the canonicalization
algorithm; for example, any whitespace ignored by a canonicalization algorithm; for example, any whitespace ignored by a canonicalization
algorithm is not included as part of the body length count. algorithm is not included as part of the body length count.
A body length count of zero means that the body is completely A body length count of zero means that the body is completely
unsigned. unsigned.
Signers wishing to ensure that no modification of any sort can occur Signers wishing to ensure that no modification of any sort can occur
should specify the "simple" canonicalization algorithm for both should specify the "simple" canonicalization algorithm for both
skipping to change at page 41, line 34 skipping to change at page 39, line 6
See Section 8.2 for further discussion. See Section 8.2 for further discussion.
5.4. Determine the Header Fields to Sign 5.4. Determine the Header Fields to Sign
The From header field MUST be signed (that is, included in the "h=" The From header field MUST be signed (that is, included in the "h="
tag of the resulting DKIM-Signature header field). Signers SHOULD tag of the resulting DKIM-Signature header field). Signers SHOULD
NOT sign an existing header field likely to be legitimately modified NOT sign an existing header field likely to be legitimately modified
or removed in transit. In particular, [RFC5321] explicitly permits or removed in transit. In particular, [RFC5321] explicitly permits
modification or removal of the Return-Path header field in transit. modification or removal of the Return-Path header field in transit.
Signers MAY include any other header fields present at the time of Signers MAY include any other header fields present at the time of
signing at the discretion of the signer. signing at the discretion of the Signer.
INFORMATIVE OPERATIONS NOTE: The choice of which header fields to INFORMATIVE OPERATIONS NOTE: The choice of which header fields to
sign is non-obvious. One strategy is to sign all existing, non- sign is non-obvious. One strategy is to sign all existing, non-
repeatable header fields. An alternative strategy is to sign only repeatable header fields. An alternative strategy is to sign only
header fields that are likely to be displayed to or otherwise be header fields that are likely to be displayed to or otherwise be
likely to affect the processing of the message at the receiver. A likely to affect the processing of the message at the receiver. A
third strategy is to sign only "well known" headers. Note that third strategy is to sign only "well-known" headers. Note that
verifiers may treat unsigned header fields with extreme Verifiers may treat unsigned header fields with extreme
skepticism, including refusing to display them to the end user or skepticism, including refusing to display them to the end user or
even ignoring the signature if it does not cover certain header even ignoring the signature if it does not cover certain header
fields. For this reason, signing fields present in the message fields. For this reason, signing fields present in the message
such as Date, Subject, Reply-To, Sender, and all MIME header such as Date, Subject, Reply-To, Sender, and all MIME header
fields are highly advised. fields are highly advised.
The DKIM-Signature header field is always implicitly signed and MUST The DKIM-Signature header field is always implicitly signed and MUST
NOT be included in the "h=" tag except to indicate that other NOT be included in the "h=" tag except to indicate that other
preexisting signatures are also signed. preexisting signatures are also signed.
Signers MAY claim to have signed header fields that do not exist Signers MAY claim to have signed header fields that do not exist
(that is, signers MAY include the header field name in the "h=" tag (that is, Signers MAY include the header field name in the "h=" tag
even if that header field does not exist in the message). When even if that header field does not exist in the message). When
computing the signature, the non-existing header field MUST be computing the signature, the nonexisting header field MUST be treated
treated as the null string (including the header field name, header as the null string (including the header field name, header field
field value, all punctuation, and the trailing CRLF). value, all punctuation, and the trailing CRLF).
INFORMATIVE RATIONALE: This allows signers to explicitly assert INFORMATIVE RATIONALE: This allows Signers to explicitly assert
the absence of a header field; if that header field is added later the absence of a header field; if that header field is added
the signature will fail. later, the signature will fail.
INFORMATIVE NOTE: A header field name need only be listed once INFORMATIVE NOTE: A header field name need only be listed once
more than the actual number of that header field in a message at more than the actual number of that header field in a message at
the time of signing in order to prevent any further additions. the time of signing in order to prevent any further additions.
For example, if there is a single Comments header field at the For example, if there is a single Comments header field at the
time of signing, listing Comments twice in the "h=" tag is time of signing, listing Comments twice in the "h=" tag is
sufficient to prevent any number of Comments header fields from sufficient to prevent any number of Comments header fields from
being appended; it is not necessary (but is legal) to list being appended; it is not necessary (but is legal) to list
Comments three or more times in the "h=" tag. Comments three or more times in the "h=" tag.
skipping to change at page 42, line 41 skipping to change at page 40, line 13
header fields might be inserted after the signed instance or header fields might be inserted after the signed instance or
otherwise reordered. Trace header fields (such as Received) and otherwise reordered. Trace header fields (such as Received) and
Resent-* blocks are the only fields prohibited by [RFC5322] from Resent-* blocks are the only fields prohibited by [RFC5322] from
being reordered. In particular, since DKIM-Signature header fields being reordered. In particular, since DKIM-Signature header fields
may be reordered by some intermediate MTAs, signing existing DKIM- may be reordered by some intermediate MTAs, signing existing DKIM-
Signature header fields is error-prone. Signature header fields is error-prone.
INFORMATIVE ADMONITION: Despite the fact that [RFC5322] does not INFORMATIVE ADMONITION: Despite the fact that [RFC5322] does not
prohibit the reordering of header fields, reordering of signed prohibit the reordering of header fields, reordering of signed
header fields with multiple instances by intermediate MTAs will header fields with multiple instances by intermediate MTAs will
cause DKIM signatures to be broken; such anti-social behavior cause DKIM signatures to be broken; such antisocial behavior
should be avoided. should be avoided.
INFORMATIVE IMPLEMENTER'S NOTE: Although not required by this INFORMATIVE IMPLEMENTER'S NOTE: Although not required by this
specification, all end-user visible header fields should be signed specification, all end-user visible header fields should be signed
to avoid possible "indirect spamming". For example, if the to avoid possible "indirect spamming". For example, if the
Subject header field is not signed, a spammer can resend a Subject header field is not signed, a spammer can resend a
previously signed mail, replacing the legitimate subject with a previously signed mail, replacing the legitimate subject with a
one-line spam. one-line spam.
5.4.1. Recommended Signature Content 5.4.1. Recommended Signature Content
The purpose of the DKIM cryptographic algorithm is to affix an The purpose of the DKIM cryptographic algorithm is to affix an
identifier to the message in a way that is both robust against normal identifier to the message in a way that is both robust against normal
transit-related changes and resistant to kinds of replay attacks. An transit-related changes and resistant to kinds of replay attacks. An
essential aspect of satisfying these requirements is choosing what essential aspect of satisfying these requirements is choosing what
header fields to include in the hash and what fields to exclude. header fields to include in the hash and what fields to exclude.
The basic rule for choosing fields to include is to select those The basic rule for choosing fields to include is to select those
fields that constitute the "core" of the message content. Hence, any fields that constitute the "core" of the message content. Hence, any
replay attack will have to include these in order to have the replay attack will have to include these in order to have the
signature succeed; but with these included, the core of the message signature succeed; however, with these included, the core of the
is valid, even if sent on to new recipients. message is valid, even if sent on to new recipients.
Common examples of fields with addresses and fields with textual Common examples of fields with addresses and fields with textual
content related to the body are: content related to the body are:
o From (REQUIRED; see Section 5.4) o From (REQUIRED; see Section 5.4)
o Reply-To o Reply-To
o Subject o Subject
skipping to change at page 43, line 44 skipping to change at page 41, line 14
o In-Reply-To, References o In-Reply-To, References
o List-Id, List-Help, List-Unsubscribe, List-Subscribe, List-Post, o List-Id, List-Help, List-Unsubscribe, List-Subscribe, List-Post,
List-Owner, List-Archive List-Owner, List-Archive
If the "l=" signature tag is in use (see Section 3.5), the Content- If the "l=" signature tag is in use (see Section 3.5), the Content-
Type field is also a candidate for being included as it could be Type field is also a candidate for being included as it could be
replaced in a way that causes completely different content to be replaced in a way that causes completely different content to be
rendered to the receiving user. rendered to the receiving user.
There are tradeoffs in the decision of what constitutes the "core" of There are trade-offs in the decision of what constitutes the "core"
the message, which for some fields is a subjective concept. of the message, which for some fields is a subjective concept.
Including fields such as "Message-ID" for example is useful if one Including fields such as "Message-ID", for example, is useful if one
considers a mechanism for being able to distinguish separate considers a mechanism for being able to distinguish separate
instances of the same message to be core content. Similarly, "In- instances of the same message to be core content. Similarly, "In-
Reply-To" and "References" might be desirable to include if one Reply-To" and "References" might be desirable to include if one
considers message threading to be a core part of the message. considers message threading to be a core part of the message.
Another class of fields that may be of interest are those that convey Another class of fields that may be of interest are those that convey
security-related information about the message, such as security-related information about the message, such as
Authentication-Results [RFC5451]. Authentication-Results [RFC5451].
The basic rule for choosing fields to exclude is to select those The basic rule for choosing fields to exclude is to select those
fields for which there are multiple fields with the same name, and fields for which there are multiple fields with the same name and
fields that are modified in transit. Examples of these are: fields that are modified in transit. Examples of these are:
o Return-Path o Return-Path
o Received o Received
o Comments, Keywords o Comments, Keywords
Note that the DKIM-Signature field is also excluded from the header Note that the DKIM-Signature field is also excluded from the header
hash, because its handling is specified separately. hash because its handling is specified separately.
Typically, it is better to exclude other, optional fields because of Typically, it is better to exclude other optional fields because of
the potential that additional fields of the same name will be the potential that additional fields of the same name will be
legitimately added or re-ordered prior to verification. There are legitimately added or reordered prior to verification. There are
likely to be legitimate exceptions to this rule, because of the wide likely to be legitimate exceptions to this rule because of the wide
variety of application-specific header fields that might be applied variety of application-specific header fields that might be applied
to a message, some of which are unlikely to be duplicated, modified, to a message, some of which are unlikely to be duplicated, modified,
or reordered. or reordered.
Signers SHOULD choose canonicalization algorithms based on the types Signers SHOULD choose canonicalization algorithms based on the types
of messages they process and their aversion to risk. For example, of messages they process and their aversion to risk. For example,
e-commerce sites sending primarily purchase receipts, which are not e-commerce sites sending primarily purchase receipts, which are not
expected to be processed by mailing lists or other software likely to expected to be processed by mailing lists or other software likely to
modify messages, will generally prefer "simple" canonicalization. modify messages, will generally prefer "simple" canonicalization.
Sites sending primarily person-to-person email will likely prefer to Sites sending primarily person-to-person email will likely prefer to
be more resilient to modification during transport by using "relaxed" be more resilient to modification during transport by using "relaxed"
canonicalization. canonicalization.
Unless mail is processed through intermediaries, such as mailing Unless mail is processed through intermediaries, such as mailing
lists that might add "unsubscribe" instructions to the bottom of the lists that might add "unsubscribe" instructions to the bottom of the
message body, the "l=" tag is likely to convey no additional benefit message body, the "l=" tag is likely to convey no additional benefit
while providing an avenue for unauthorized addition of text to a while providing an avenue for unauthorized addition of text to a
message. The use of "l=0" takes this to the extreme, allowing message. The use of "l=0" takes this to the extreme, allowing
complete alteration of the text of the message without invalidating complete alteration of the text of the message without invalidating
skipping to change at page 44, line 43 skipping to change at page 42, line 15
Sites sending primarily person-to-person email will likely prefer to Sites sending primarily person-to-person email will likely prefer to
be more resilient to modification during transport by using "relaxed" be more resilient to modification during transport by using "relaxed"
canonicalization. canonicalization.
Unless mail is processed through intermediaries, such as mailing Unless mail is processed through intermediaries, such as mailing
lists that might add "unsubscribe" instructions to the bottom of the lists that might add "unsubscribe" instructions to the bottom of the
message body, the "l=" tag is likely to convey no additional benefit message body, the "l=" tag is likely to convey no additional benefit
while providing an avenue for unauthorized addition of text to a while providing an avenue for unauthorized addition of text to a
message. The use of "l=0" takes this to the extreme, allowing message. The use of "l=0" takes this to the extreme, allowing
complete alteration of the text of the message without invalidating complete alteration of the text of the message without invalidating
the signature. Moreover, a verifier would be within its rights to the signature. Moreover, a Verifier would be within its rights to
consider a partly-signed message body as unacceptable. Judicious use consider a partly signed message body as unacceptable. Judicious use
is advised. is advised.
5.4.2. Signatures Involving Multiple Instances of a Field 5.4.2. Signatures Involving Multiple Instances of a Field
Signers choosing to sign an existing header field that occurs more Signers choosing to sign an existing header field that occurs more
than once in the message (such as Received) MUST sign the physically than once in the message (such as Received) MUST sign the physically
last instance of that header field in the header block. Signers last instance of that header field in the header block. Signers
wishing to sign multiple instances of such a header field MUST wishing to sign multiple instances of such a header field MUST
include the header field name multiple times in the h= tag of the include the header field name multiple times in the "h=" tag of the
DKIM-Signature header field, and MUST sign such header fields in DKIM-Signature header field and MUST sign such header fields in order
order from the bottom of the header field block to the top. The from the bottom of the header field block to the top. The Signer MAY
signer MAY include more instances of a header field name in "h=" than include more instances of a header field name in "h=" than there are
there are actual corresponding header fields so that the signature actual corresponding header fields so that the signature will not
will not verify if additional header fields of that name are added. verify if additional header fields of that name are added.
INFORMATIVE EXAMPLE: INFORMATIVE EXAMPLE:
If the signer wishes to sign two existing Received header fields, If the Signer wishes to sign two existing Received header fields,
and the existing header contains: and the existing header contains:
Received: <A>
Received: <B> Received: <A>
Received: <C> Received: <B>
Received: <C>
then the resulting DKIM-Signature header field should read: then the resulting DKIM-Signature header field should read:
DKIM-Signature: ... h=Received : Received :... DKIM-Signature: ... h=Received : Received :...
and Received header fields <C> and <B> will be signed in that and Received header fields <C> and <B> will be signed in that
order. order.
5.5. Compute the Message Hash and Signature 5.5. Compute the Message Hash and Signature
The signer MUST compute the message hash as described in Section 3.7 The Signer MUST compute the message hash as described in Section 3.7
and then sign it using the selected public-key algorithm. This will and then sign it using the selected public-key algorithm. This will
result in a DKIM-Signature header field that will include the body result in a DKIM-Signature header field that will include the body
hash and a signature of the header hash, where that header includes hash and a signature of the header hash, where that header includes
the DKIM-Signature header field itself. the DKIM-Signature header field itself.
Entities such as mailing list managers that implement DKIM and that Entities such as mailing list managers that implement DKIM and that
modify the message or a header field (for example, inserting modify the message or a header field (for example, inserting
unsubscribe information) before retransmitting the message SHOULD unsubscribe information) before retransmitting the message SHOULD
check any existing signature on input and MUST make such check any existing signature on input and MUST make such
modifications before re-signing the message. modifications before re-signing the message.
5.6. Insert the DKIM-Signature Header Field 5.6. Insert the DKIM-Signature Header Field
Finally, the signer MUST insert the DKIM-Signature header field Finally, the Signer MUST insert the DKIM-Signature header field
created in the previous step prior to transmitting the email. The created in the previous step prior to transmitting the email. The
DKIM-Signature header field MUST be the same as used to compute the DKIM-Signature header field MUST be the same as used to compute the
hash as described above, except that the value of the "b=" tag MUST hash as described above, except that the value of the "b=" tag MUST
be the appropriately signed hash computed in the previous step, be the appropriately signed hash computed in the previous step,
signed using the algorithm specified in the "a=" tag of the DKIM- signed using the algorithm specified in the "a=" tag of the DKIM-
Signature header field and using the private key corresponding to the Signature header field and using the private key corresponding to the
selector given in the "s=" tag of the DKIM-Signature header field, as selector given in the "s=" tag of the DKIM-Signature header field, as
chosen above in Section 5.2 chosen above in Section 5.2.
The DKIM-Signature header field MUST be inserted before any other The DKIM-Signature header field MUST be inserted before any other
DKIM-Signature fields in the header block. DKIM-Signature fields in the header block.
INFORMATIVE IMPLEMENTATION NOTE: The easiest way to achieve this INFORMATIVE IMPLEMENTATION NOTE: The easiest way to achieve this
is to insert the DKIM-Signature header field at the beginning of is to insert the DKIM-Signature header field at the beginning of
the header block. In particular, it may be placed before any the header block. In particular, it may be placed before any
existing Received header fields. This is consistent with treating existing Received header fields. This is consistent with treating
DKIM-Signature as a trace header field. DKIM-Signature as a trace header field.
6. Verifier Actions 6. Verifier Actions
Since a signer MAY remove or revoke a public key at any time, it is Since a Signer MAY remove or revoke a public key at any time, it is
advised that verification occur in a timely manner. In many advised that verification occur in a timely manner. In many
configurations, the most timely place is during acceptance by the configurations, the most timely place is during acceptance by the
border MTA or shortly thereafter. In particular, deferring border MTA or shortly thereafter. In particular, deferring
verification until the message is accessed by the end user is verification until the message is accessed by the end user is
discouraged. discouraged.
A border or intermediate MTA MAY verify the message signature(s). An A border or intermediate MTA MAY verify the message signature(s). An
MTA who has performed verification MAY communicate the result of that MTA who has performed verification MAY communicate the result of that
verification by adding a verification header field to incoming verification by adding a verification header field to incoming
messages. This considerably simplifies things for the user, who can messages. This simplifies things considerably for the user, who can
now use an existing mail user agent. Most MUAs have the ability to now use an existing mail user agent. Most MUAs have the ability to
filter messages based on message header fields or content; these filter messages based on message header fields or content; these
filters would be used to implement whatever policy the user wishes filters would be used to implement whatever policy the user wishes
with respect to unsigned mail. with respect to unsigned mail.
A verifying MTA MAY implement a policy with respect to unverifiable A verifying MTA MAY implement a policy with respect to unverifiable
mail, regardless of whether or not it applies the verification header mail, regardless of whether or not it applies the verification header
field to signed messages. field to signed messages.
Verifiers MUST produce a result that is semantically equivalent to Verifiers MUST produce a result that is semantically equivalent to
applying the following steps in the order listed. In practice, applying the steps listed in Sections 6.1, 6.1.1, and 6.1.2 in order.
several of these steps can be performed in parallel in order to In practice, several of these steps can be performed in parallel in
improve performance. order to improve performance.
6.1. Extract Signatures from the Message 6.1. Extract Signatures from the Message
The order in which verifiers try DKIM-Signature header fields is not The order in which Verifiers try DKIM-Signature header fields is not
defined; verifiers MAY try signatures in any order they like. For defined; Verifiers MAY try signatures in any order they like. For
example, one implementation might try the signatures in textual example, one implementation might try the signatures in textual
order, whereas another might try signatures by identities that match order, whereas another might try signatures by identities that match
the contents of the From header field before trying other signatures. the contents of the From header field before trying other signatures.
Verifiers MUST NOT attribute ultimate meaning to the order of Verifiers MUST NOT attribute ultimate meaning to the order of
multiple DKIM-Signature header fields. In particular, there is multiple DKIM-Signature header fields. In particular, there is
reason to believe that some relays will reorder the header fields in reason to believe that some relays will reorder the header fields in
potentially arbitrary ways. potentially arbitrary ways.
INFORMATIVE IMPLEMENTATION NOTE: Verifiers might use the order as INFORMATIVE IMPLEMENTATION NOTE: Verifiers might use the order as
a clue to signing order in the absence of any other information. a clue to signing order in the absence of any other information.
However, other clues as to the semantics of multiple signatures However, other clues as to the semantics of multiple signatures
(such as correlating the signing host with Received header fields) (such as correlating the signing host with Received header fields)
might also be considered. might also be considered.
Survivability of signatures after transit is not guaranteed, and Survivability of signatures after transit is not guaranteed, and
signatures can fail to verify through no fault of the signer. signatures can fail to verify through no fault of the Signer.
Therefore, a verifier SHOULD NOT treat a message that has one or more Therefore, a Verifier SHOULD NOT treat a message that has one or more
bad signatures and no good signatures differently from a message with bad signatures and no good signatures differently from a message with
no signature at all. no signature at all.
When a signature successfully verifies, a verifier will either stop When a signature successfully verifies, a Verifier will either stop
processing or attempt to verify any other signatures, at the processing or attempt to verify any other signatures, at the
discretion of the implementation. A verifier MAY limit the number of discretion of the implementation. A Verifier MAY limit the number of
signatures it tries, in order to avoid denial-of-service attacks (see signatures it tries, in order to avoid denial-of-service attacks (see
Section 8.4 for further discussion). Section 8.4 for further discussion).
In the following description, text reading "return status In the following description, text reading "return status
(explanation)" (where "status" is one of "PERMFAIL" or "TEMPFAIL") (explanation)" (where "status" is one of "PERMFAIL" or "TEMPFAIL")
means that the verifier MUST immediately cease processing that means that the Verifier MUST immediately cease processing that
signature. The verifier SHOULD proceed to the next signature, if any signature. The Verifier SHOULD proceed to the next signature, if one
is present, and completely ignore the bad signature. If the status is present, and completely ignore the bad signature. If the status
is "PERMFAIL", the signature failed and should not be reconsidered. is "PERMFAIL", the signature failed and should not be reconsidered.
If the status is "TEMPFAIL", the signature could not be verified at If the status is "TEMPFAIL", the signature could not be verified at
this time but may be tried again later. A verifier MAY either this time but may be tried again later. A Verifier MAY either
arrange to defer the message for later processing, or try another arrange to defer the message for later processing or try another
signature; if no good signature is found and any of the signatures signature; if no good signature is found and any of the signatures
resulted in a TEMPFAIL status, the verifier MAY arrange to defer the resulted in a TEMPFAIL status, the Verifier MAY arrange to defer the
message for later processing. The "(explanation)" is not normative message for later processing. The "(explanation)" is not normative
text; it is provided solely for clarification. text; it is provided solely for clarification.
Verifiers that are prepared to validate multiple signature header Verifiers that are prepared to validate multiple signature header
fields SHOULD proceed to the next signature header field, if one fields SHOULD proceed to the next signature header field, if one
exists. However, verifiers MAY make note of the fact that an invalid exists. However, Verifiers MAY make note of the fact that an invalid
signature was present for consideration at a later step. signature was present for consideration at a later step.
INFORMATIVE NOTE: The rationale of this requirement is to permit INFORMATIVE NOTE: The rationale of this requirement is to permit
messages that have invalid signatures but also a valid signature messages that have invalid signatures but also a valid signature
to work. For example, a mailing list exploder might opt to leave to work. For example, a mailing list exploder might opt to leave
the original submitter signature in place even though the exploder the original submitter signature in place even though the exploder
knows that it is modifying the message in some way that will break knows that it is modifying the message in some way that will break
that signature, and the exploder inserts its own signature. In that signature, and the exploder inserts its own signature. In
this case, the message should succeed even in the presence of the this case, the message should succeed even in the presence of the
known-broken signature. known-broken signature.
For each signature to be validated, the following steps should be For each signature to be validated, the following steps should be
performed in such a manner as to produce a result that is performed in such a manner as to produce a result that is
semantically equivalent to performing them in the indicated order. semantically equivalent to performing them in the indicated order.
6.1.1. Validate the Signature Header Field 6.1.1. Validate the Signature Header Field
Implementers MUST meticulously validate the format and values in the Implementers MUST meticulously validate the format and values in the
DKIM-Signature header field; any inconsistency or unexpected values DKIM-Signature header field; any inconsistency or unexpected values
MUST cause the header field to be completely ignored and the verifier MUST cause the header field to be completely ignored and the Verifier
to return PERMFAIL (signature syntax error). Being "liberal in what to return PERMFAIL (signature syntax error). Being "liberal in what
you accept" is definitely a bad strategy in this security context. you accept" is definitely a bad strategy in this security context.
Note however that this does not include the existence of unknown tags Note, however, that this does not include the existence of unknown
in a DKIM-Signature header field, which are explicitly permitted. tags in a DKIM-Signature header field, which are explicitly
Verifiers MUST return PERMFAIL (incompatible version) when presented permitted. Verifiers MUST return PERMFAIL (incompatible version)
a DKIM-Signature header field with a "v=" tag that is inconsistent when presented a DKIM-Signature header field with a "v=" tag that is
with this specification. inconsistent with this specification.
INFORMATIVE IMPLEMENTATION NOTE: An implementation may, of course, INFORMATIVE IMPLEMENTATION NOTE: An implementation may, of course,
choose to also verify signatures generated by older versions of choose to also verify signatures generated by older versions of
this specification. this specification.
If any tag listed as "required" in Section 3.5 is omitted from the If any tag listed as "required" in Section 3.5 is omitted from the
DKIM-Signature header field, the verifier MUST ignore the DKIM- DKIM-Signature header field, the Verifier MUST ignore the DKIM-
Signature header field and return PERMFAIL (signature missing Signature header field and return PERMFAIL (signature missing
required tag). required tag).
INFORMATIONAL NOTE: The tags listed as required in Section 3.5 are INFORMATIVE NOTE: The tags listed as required in Section 3.5 are
"v=", "a=", "b=", "bh=", "d=", "h=", and "s=". Should there be a "v=", "a=", "b=", "bh=", "d=", "h=", and "s=". Should there be a
conflict between this note and Section 3.5, Section 3.5 is conflict between this note and Section 3.5, Section 3.5 is
normative. normative.
If the DKIM-Signature header field does not contain the "i=" tag, the If the DKIM-Signature header field does not contain the "i=" tag, the
verifier MUST behave as though the value of that tag were "@d", where Verifier MUST behave as though the value of that tag were "@d", where
"d" is the value from the "d=" tag. "d" is the value from the "d=" tag.
Verifiers MUST confirm that the domain specified in the "d=" tag is Verifiers MUST confirm that the domain specified in the "d=" tag is
the same as or a parent domain of the domain part of the "i=" tag. the same as or a parent domain of the domain part of the "i=" tag.
If not, the DKIM-Signature header field MUST be ignored and the If not, the DKIM-Signature header field MUST be ignored, and the
verifier should return PERMFAIL (domain mismatch). Verifier should return PERMFAIL (domain mismatch).
If the "h=" tag does not include the From header field, the verifier If the "h=" tag does not include the From header field, the Verifier
MUST ignore the DKIM-Signature header field and return PERMFAIL (From MUST ignore the DKIM-Signature header field and return PERMFAIL (From
field not signed). field not signed).
Verifiers MAY ignore the DKIM-Signature header field and return Verifiers MAY ignore the DKIM-Signature header field and return
PERMFAIL (signature expired) if it contains an "x=" tag and the PERMFAIL (signature expired) if it contains an "x=" tag and the
signature has expired. signature has expired.
Verifiers MAY ignore the DKIM-Signature header field if the domain Verifiers MAY ignore the DKIM-Signature header field if the domain
used by the signer in the "d=" tag is not associated with a valid used by the Signer in the "d=" tag is not associated with a valid
signing entity. For example, signatures with "d=" values such as signing entity. For example, signatures with "d=" values such as
"com" and "co.uk" could be ignored. The list of unacceptable domains "com" and "co.uk" could be ignored. The list of unacceptable domains
SHOULD be configurable. SHOULD be configurable.
Verifiers MAY ignore the DKIM-Signature header field and return Verifiers MAY ignore the DKIM-Signature header field and return
PERMFAIL (unacceptable signature header) for any other reason, for PERMFAIL (unacceptable signature header) for any other reason, for
example, if the signature does not sign header fields that the example, if the signature does not sign header fields that the
verifier views to be essential. As a case in point, if MIME header Verifier views to be essential. As a case in point, if MIME header
fields are not signed, certain attacks may be possible that the fields are not signed, certain attacks may be possible that the
verifier would prefer to avoid. Verifier would prefer to avoid.
6.1.2. Get the Public Key 6.1.2. Get the Public Key
The public key for a signature is needed to complete the verification The public key for a signature is needed to complete the verification
process. The process of retrieving the public key depends on the process. The process of retrieving the public key depends on the
query type as defined by the "q=" tag in the DKIM-Signature header query type as defined by the "q=" tag in the DKIM-Signature header
field. Obviously, a public key need only be retrieved if the process field. Obviously, a public key need only be retrieved if the process
of extracting the signature information is completely successful. of extracting the signature information is completely successful.
Details of key management and representation are described in Details of key management and representation are described in
Section 3.6. The verifier MUST validate the key record and MUST Section 3.6. The Verifier MUST validate the key record and MUST
ignore any public key records that are malformed. ignore any public-key records that are malformed.
NOTE: The use of a wildcard TXT RR that covers a queried DKIM domain NOTE: The use of a wildcard TXT RR that covers a queried DKIM
name will produce a response to a DKIM query that is unlikely to domain name will produce a response to a DKIM query that is
be valid DKIM key record. This problem is not specific to DKIM unlikely to be a valid DKIM key record. This problem is not
and applies to many other types of queries. Client software that specific to DKIM and applies to many other types of queries.
processes DNS responses needs to take this problem into account. Client software that processes DNS responses needs to take this
problem into account.
When validating a message, a verifier MUST perform the following When validating a message, a Verifier MUST perform the following
steps in a manner that is semantically the same as performing them in steps in a manner that is semantically the same as performing them in
the order indicated -- in some cases the implementation may the order indicated; in some cases, the implementation may
parallelize or reorder these steps, as long as the semantics remain parallelize or reorder these steps, as long as the semantics remain
unchanged: unchanged:
1. Retrieve the public key as described in Section 3.6 using the 1. The Verifier retrieves the public key as described in Section 3.6
algorithm in the "q=" tag, the domain from the "d=" tag, and the using the algorithm in the "q=" tag, the domain from the "d="
selector from the "s=" tag. tag, and the selector from the "s=" tag.
2. If the query for the public key fails to respond, the verifier 2. If the query for the public key fails to respond, the Verifier
MAY seek a later verification attempt by returning TEMPFAIL (key MAY seek a later verification attempt by returning TEMPFAIL (key
unavailable). unavailable).
3. If the query for the public key fails because the corresponding 3. If the query for the public key fails because the corresponding
key record does not exist, the verifier MUST immediately return key record does not exist, the Verifier MUST immediately return
PERMFAIL (no key for signature). PERMFAIL (no key for signature).
4. If the query for the public key returns multiple key records, the 4. If the query for the public key returns multiple key records, the
verifier can choose one of the key records or may cycle through Verifier can choose one of the key records or may cycle through
the key records performing the remainder of these steps on each the key records, performing the remainder of these steps on each
record at the discretion of the implementer. The order of the record at the discretion of the implementer. The order of the
key records is unspecified. If the verifier chooses to cycle key records is unspecified. If the Verifier chooses to cycle
through the key records, then the "return ..." wording in the through the key records, then the "return ..." wording in the
remainder of this section means "try the next key record, if any; remainder of this section means "try the next key record, if any;
if none, return to try another signature in the usual way". if none, return to try another signature in the usual way".
5. If the result returned from the query does not adhere to the 5. If the result returned from the query does not adhere to the
format defined in this specification, the verifier MUST ignore format defined in this specification, the Verifier MUST ignore
the key record and return PERMFAIL (key syntax error). Verifiers the key record and return PERMFAIL (key syntax error). Verifiers
are urged to validate the syntax of key records carefully to are urged to validate the syntax of key records carefully to
avoid attempted attacks. In particular, the verifier MUST ignore avoid attempted attacks. In particular, the Verifier MUST ignore
keys with a version code ("v=" tag) that they do not implement. keys with a version code ("v=" tag) that they do not implement.
6. If the "h=" tag exists in the public key record and the hash 6. If the "h=" tag exists in the public-key record and the hash
algorithm implied by the "a=" tag in the DKIM-Signature header algorithm implied by the "a=" tag in the DKIM-Signature header
field is not included in the contents of the "h=" tag, the field is not included in the contents of the "h=" tag, the
verifier MUST ignore the key record and return PERMFAIL Verifier MUST ignore the key record and return PERMFAIL
(inappropriate hash algorithm). (inappropriate hash algorithm).
7. If the public key data (the "p=" tag) is empty, then this key has 7. If the public-key data (the "p=" tag) is empty, then this key has
been revoked and the verifier MUST treat this as a failed been revoked and the Verifier MUST treat this as a failed
signature check and return PERMFAIL (key revoked). There is no signature check and return PERMFAIL (key revoked). There is no
defined semantic difference between a key that has been revoked defined semantic difference between a key that has been revoked
and a key record that has been removed. and a key record that has been removed.
8. If the public key data is not suitable for use with the algorithm 8. If the public-key data is not suitable for use with the algorithm
and key types defined by the "a=" and "k=" tags in the DKIM- and key types defined by the "a=" and "k=" tags in the DKIM-
Signature header field, the verifier MUST immediately return Signature header field, the Verifier MUST immediately return
PERMFAIL (inappropriate key algorithm). PERMFAIL (inappropriate key algorithm).
6.1.3. Compute the Verification 6.1.3. Compute the Verification
Given a signer and a public key, verifying a signature consists of Given a Signer and a public key, verifying a signature consists of
actions semantically equivalent to the following steps. actions semantically equivalent to the following steps.
1. Based on the algorithm defined in the "c=" tag, the body length 1. Based on the algorithm defined in the "c=" tag, the body length
specified in the "l=" tag, and the header field names in the "h=" specified in the "l=" tag, and the header field names in the "h="
tag, prepare a canonicalized version of the message as is tag, prepare a canonicalized version of the message as is
described in Section 3.7 (note that this canonicalized version described in Section 3.7 (note that this canonicalized version
does not actually replace the original content). When matching does not actually replace the original content). When matching
header field names in the "h=" tag against the actual message header field names in the "h=" tag against the actual message
header field, comparisons MUST be case-insensitive. header field, comparisons MUST be case-insensitive.
2. Based on the algorithm indicated in the "a=" tag, compute the 2. Based on the algorithm indicated in the "a=" tag, compute the
message hashes from the canonical copy as described in message hashes from the canonical copy as described in
Section 3.7. Section 3.7.
3. Verify that the hash of the canonicalized message body computed 3. Verify that the hash of the canonicalized message body computed
in the previous step matches the hash value conveyed in the "bh=" in the previous step matches the hash value conveyed in the "bh="
tag. If the hash does not match, the verifier SHOULD ignore the tag. If the hash does not match, the Verifier SHOULD ignore the
signature and return PERMFAIL (body hash did not verify). signature and return PERMFAIL (body hash did not verify).
4. Using the signature conveyed in the "b=" tag, verify the 4. Using the signature conveyed in the "b=" tag, verify the
signature against the header hash using the mechanism appropriate signature against the header hash using the mechanism appropriate
for the public key algorithm described in the "a=" tag. If the for the public-key algorithm described in the "a=" tag. If the
signature does not validate, the verifier SHOULD ignore the signature does not validate, the Verifier SHOULD ignore the
signature and return PERMFAIL (signature did not verify). signature and return PERMFAIL (signature did not verify).
5. Otherwise, the signature has correctly verified. 5. Otherwise, the signature has correctly verified.
INFORMATIVE IMPLEMENTER'S NOTE: Implementations might wish to INFORMATIVE IMPLEMENTER'S NOTE: Implementations might wish to
initiate the public-key query in parallel with calculating the initiate the public-key query in parallel with calculating the
hash as the public key is not needed until the final decryption is hash as the public key is not needed until the final decryption is
calculated. Implementations may also verify the signature on the calculated. Implementations may also verify the signature on the
message header before validating that the message hash listed in message header before validating that the message hash listed in
the "bh=" tag in the DKIM-Signature header field matches that of the "bh=" tag in the DKIM-Signature header field matches that of
the actual message body; however, if the body hash does not match, the actual message body; however, if the body hash does not match,
the entire signature must be considered to have failed. the entire signature must be considered to have failed.
A body length specified in the "l=" tag of the signature limits the A body length specified in the "l=" tag of the signature limits the
number of bytes of the body passed to the verification algorithm. number of bytes of the body passed to the verification algorithm.
All data beyond that limit is not validated by DKIM. Hence, All data beyond that limit is not validated by DKIM. Hence,
verifiers might treat a message that contains bytes beyond the Verifiers might treat a message that contains bytes beyond the
indicated body length with suspicion, and can choose to treat the indicated body length with suspicion and can choose to treat the
signature as if it were invalid (e.g., by returning PERMFAIL signature as if it were invalid (e.g., by returning PERMFAIL
(unsigned content)). (unsigned content)).
Should the algorithm reach this point, the verification has Should the algorithm reach this point, the verification has
succeeded, and DKIM reports SUCCESS for this signature. succeeded, and DKIM reports SUCCESS for this signature.
6.2. Communicate Verification Results 6.2. Communicate Verification Results
Verifiers wishing to communicate the results of verification to other Verifiers wishing to communicate the results of verification to other
parts of the mail system may do so in whatever manner they see fit. parts of the mail system may do so in whatever manner they see fit.
For example, implementations might choose to add an email header For example, implementations might choose to add an email header
field to the message before passing it on. Any such header field field to the message before passing it on. Any such header field
SHOULD be inserted before any existing DKIM-Signature or preexisting SHOULD be inserted before any existing DKIM-Signature or preexisting
authentication status header fields in the header field block. The authentication status header fields in the header field block. The
Authentication-Results: header field ([RFC5451]) MAY be used for this Authentication-Results: header field ([RFC5451]) MAY be used for this
purpose. purpose.
INFORMATIVE ADVICE to MUA filter writers: Patterns intended to INFORMATIVE ADVICE to MUA filter writers: Patterns intended to
search for results header fields to visibly mark authenticated search for results header fields to visibly mark authenticated
mail for end users should verify that such header field was added mail for end users should verify that such a header field was
by the appropriate verifying domain and that the verified identity added by the appropriate verifying domain and that the verified
matches the author identity that will be displayed by the MUA. In identity matches the author identity that will be displayed by the
particular, MUA filters should not be influenced by bogus results MUA. In particular, MUA filters should not be influenced by bogus
header fields added by attackers. To circumvent this attack, results header fields added by attackers. To circumvent this
verifiers MAY wish to request deletion of existing results header attack, Verifiers MAY wish to request deletion of existing results
fields after verification and before arranging to add a new header header fields after verification and before arranging to add a new
field. header field.
6.3. Interpret Results/Apply Local Policy 6.3. Interpret Results/Apply Local Policy
It is beyond the scope of this specification to describe what actions It is beyond the scope of this specification to describe what actions
an Identity Assessor can make, but mail carrying a validated SDID an Identity Assessor can make, but mail carrying a validated SDID
presents an opportunity to an Identity Assessor that unauthenticated presents an opportunity to an Identity Assessor that unauthenticated
email does not. Specifically, an authenticated email creates a email does not. Specifically, an authenticated email creates a
predictable identifier by which other decisions can reliably be predictable identifier by which other decisions can reliably be
managed, such as trust and reputation. Conversely, unauthenticated managed, such as trust and reputation. Conversely, unauthenticated
email lacks a reliable identifier that can be used to assign trust email lacks a reliable identifier that can be used to assign trust
skipping to change at page 52, line 32 skipping to change at page 50, line 26
In general, modules that consume DKIM verification output SHOULD NOT In general, modules that consume DKIM verification output SHOULD NOT
determine message acceptability based solely on a lack of any determine message acceptability based solely on a lack of any
signature or on an unverifiable signature; such rejection would cause signature or on an unverifiable signature; such rejection would cause
severe interoperability problems. If an MTA does wish to reject such severe interoperability problems. If an MTA does wish to reject such
messages during an SMTP session (for example, when communicating with messages during an SMTP session (for example, when communicating with
a peer who, by prior agreement, agrees to only send signed messages), a peer who, by prior agreement, agrees to only send signed messages),
and a signature is missing or does not verify, the handling MTA and a signature is missing or does not verify, the handling MTA
SHOULD use a 550/5.7.x reply code. SHOULD use a 550/5.7.x reply code.
Where the verifier is integrated within the MTA and it is not Where the Verifier is integrated within the MTA and it is not
possible to fetch the public key, perhaps because the key server is possible to fetch the public key, perhaps because the key server is
not available, a temporary failure message MAY be generated using a not available, a temporary failure message MAY be generated using a
451/4.7.5 reply code, such as: 451/4.7.5 reply code, such as:
451 4.7.5 Unable to verify signature - key server unavailable 451 4.7.5 Unable to verify signature - key server unavailable
Temporary failures such as inability to access the key server or Temporary failures such as inability to access the key server or
other external service are the only conditions that SHOULD use a 4xx other external service are the only conditions that SHOULD use a 4xx
SMTP reply code. In particular, cryptographic signature verification SMTP reply code. In particular, cryptographic signature verification
failures MUST NOT provoke 4xx SMTP replies. failures MUST NOT provoke 4xx SMTP replies.
Once the signature has been verified, that information MUST be Once the signature has been verified, that information MUST be
conveyed to the Identity Assessor (such as an explicit allow/ conveyed to the Identity Assessor (such as an explicit allow/
whitelist and reputation system) and/or to the end user. If the SDID whitelist and reputation system) and/or to the end user. If the SDID
skipping to change at page 53, line 10 skipping to change at page 51, line 4
the reader. the reader.
While the symptoms of a failed verification are obvious -- the While the symptoms of a failed verification are obvious -- the
signature doesn't verify -- establishing the exact cause can be more signature doesn't verify -- establishing the exact cause can be more
difficult. If a selector cannot be found, is that because the difficult. If a selector cannot be found, is that because the
selector has been removed, or was the value changed somehow in selector has been removed, or was the value changed somehow in
transit? If the signature line is missing, is that because it was transit? If the signature line is missing, is that because it was
never there, or was it removed by an overzealous filter? For never there, or was it removed by an overzealous filter? For
diagnostic purposes, the exact reason why the verification fails diagnostic purposes, the exact reason why the verification fails
SHOULD be made available and possibly recorded in the system logs. SHOULD be made available and possibly recorded in the system logs.
If the email cannot be verified, then it SHOULD be treated the same If the email cannot be verified, then it SHOULD be treated the same
as all unverified email regardless of whether or not it looks like it as all unverified email, regardless of whether or not it looks like
was signed. it was signed.
See Section 8.15 for additional discussion. See Section 8.15 for additional discussion.
7. IANA Considerations 7. IANA Considerations
DKIM has registered namespaces with IANA. In all cases, new values DKIM has registered namespaces with IANA. In all cases, new values
are assigned only for values that have been documented in a published are assigned only for values that have been documented in a published
RFC that has IETF Consensus [RFC5226]. RFC that has IETF Consensus [RFC5226].
This memo updates these registries as described below. Of note is This memo updates these registries as described below. Of note is
the addition of a new "status" column. All registrations into these the addition of a new "status" column. All registrations into these
namespaces MUST include the name being registered, the document in namespaces MUST include the name being registered, the document in
which it was registered or updated, and an indication of its current which it was registered or updated, and an indication of its current
status which MUST be one of "active" (in current use) or "historic" status, which MUST be one of "active" (in current use) or "historic"
(no longer in current use). (no longer in current use).
No new tags are defined in this specification compared to [RFC4871], No new tags are defined in this specification compared to [RFC4871],
but one has been designated as "historic". but one has been designated as "historic".
Also, the Email Authentication Methods Registry is revised to refer Also, the "Email Authentication Methods" registry is revised to refer
to this update. to this update.
7.1. Email Authentication Methods Registry 7.1. Email Authentication Methods Registry
The Email Authentication Methods registry is updated to indicate that The "Email Authentication Methods" registry is updated to indicate
"dkim" is defined in this memo. that "dkim" is defined in this memo.
7.2. DKIM-Signature Tag Specifications 7.2. DKIM-Signature Tag Specifications
A DKIM-Signature provides for a list of tag specifications. IANA has A DKIM-Signature provides for a list of tag specifications. IANA has
established the DKIM-Signature Tag Specification Registry for tag established the "DKIM-Signature Tag Specifications" registry for tag
specifications that can be used in DKIM-Signature fields. specifications that can be used in DKIM-Signature fields.
The updated entries in the registry comprise:
+------+-----------------+--------+ +------+-----------------+--------+
| TYPE | REFERENCE | STATUS | | TYPE | REFERENCE | STATUS |
+------+-----------------+--------+ +------+-----------------+--------+
| v | (this document) | active | | v | (this document) | active |
| a | (this document) | active | | a | (this document) | active |
| b | (this document) | active | | b | (this document) | active |
| bh | (this document) | active | | bh | (this document) | active |
| c | (this document) | active | | c | (this document) | active |
| d | (this document) | active | | d | (this document) | active |
| h | (this document) | active | | h | (this document) | active |
| i | (this document) | active | | i | (this document) | active |
| l | (this document) | active | | l | (this document) | active |
| q | (this document) | active | | q | (this document) | active |
| s | (this document) | active | | s | (this document) | active |
| t | (this document) | active | | t | (this document) | active |
| x | (this document) | active | | x | (this document) | active |
| z | (this document) | active | | z | (this document) | active |
+------+-----------------+--------+ +------+-----------------+--------+
Table 1: DKIM-Signature Tag Specification Registry Updated Values Table 1: DKIM-Signature Tag Specifications Registry Updated Values
7.3. DKIM-Signature Query Method Registry 7.3. DKIM-Signature Query Method Registry
The "q=" tag-spec (specified in Section 3.5) provides for a list of The "q=" tag-spec (specified in Section 3.5) provides for a list of
query methods. query methods.
IANA has established the DKIM-Signature Query Method Registry for IANA has established the "DKIM-Signature Query Method" registry for
mechanisms that can be used to retrieve the key that will permit mechanisms that can be used to retrieve the key that will permit
validation processing of a message signed using DKIM. validation processing of a message signed using DKIM.
The updated entry in the registry comprises:
+------+--------+-----------------+--------+ +------+--------+-----------------+--------+
| TYPE | OPTION | REFERENCE | STATUS | | TYPE | OPTION | REFERENCE | STATUS |
+------+--------+-----------------+--------+ +------+--------+-----------------+--------+
| dns | txt | (this document) | active | | dns | txt | (this document) | active |
+------+--------+-----------------+--------+ +------+--------+-----------------+--------+
DKIM-Signature Query Method Registry Updated Values Table 2: DKIM-Signature Query Method Registry Updated Values
7.4. DKIM-Signature Canonicalization Registry 7.4. DKIM-Signature Canonicalization Registry
The "c=" tag-spec (specified in Section 3.5) provides for a specifier The "c=" tag-spec (specified in Section 3.5) provides for a specifier
for canonicalization algorithms for the header and body of the for canonicalization algorithms for the header and body of the
message. message.
IANA has established the DKIM-Signature Canonicalization Algorithm IANA has established the "DKIM-Signature Canonicalization Header"
Registry for algorithms for converting a message into a canonical Registry for algorithms for converting a message into a canonical
form before signing or verifying using DKIM. form before signing or verifying using DKIM.
The updated entries in the header registry comprise:
+---------+-----------------+--------+ +---------+-----------------+--------+
| TYPE | REFERENCE | STATUS | | TYPE | REFERENCE | STATUS |
+---------+-----------------+--------+ +---------+-----------------+--------+
| simple | (this document) | active | | simple | (this document) | active |
| relaxed | (this document) | active | | relaxed | (this document) | active |
+---------+-----------------+--------+ +---------+-----------------+--------+
DKIM-Signature Header Canonicalization Algorithm Registry Table 3: DKIM-Signature Canonicalization Header Registry Updated
Updated Values Values
The updated entries in the body registry comprise:
+---------+-----------------+--------+ +---------+-----------------+--------+
| TYPE | REFERENCE | STATUS | | TYPE | REFERENCE | STATUS |
+---------+-----------------+--------+ +---------+-----------------+--------+
| simple | (this document) | active | | simple | (this document) | active |
| relaxed | (this document) | active | | relaxed | (this document) | active |
+---------+-----------------+--------+ +---------+-----------------+--------+
DKIM-Signature Body Canonicalization Algorithm Registry Table 4: DKIM-Signature Canonicalization Body Registry Updated Values
Updated Values
7.5. _domainkey DNS TXT Resource Record Tag Specifications 7.5. _domainkey DNS TXT Resource Record Tag Specifications
A _domainkey DNS TXT RR provides for a list of tag specifications. A _domainkey DNS TXT RR provides for a list of tag specifications.
IANA has established the DKIM _domainkey DNS TXT Tag Specification IANA has established the DKIM "_domainkey DNS TXT Record Tag
Registry for tag specifications that can be used in DNS TXT resource Specifications" registry for tag specifications that can be used in
records. DNS TXT resource records.
The updated entries in the registry comprise:
+------+-----------------+----------+ +------+-----------------+----------+
| TYPE | REFERENCE | STATUS | | TYPE | REFERENCE | STATUS |
+------+-----------------+----------+ +------+-----------------+----------+
| v | (this document) | active | | v | (this document) | active |
| g | [RFC4871] | historic | | g | [RFC4871] | historic |
| h | (this document) | active | | h | (this document) | active |
| k | (this document) | active | | k | (this document) | active |
| n | (this document) | active | | n | (this document) | active |
| p | (this document) | active | | p | (this document) | active |
| s | (this document) | active | | s | (this document) | active |
| t | (this document) | active | | t | (this document) | active |
+------+-----------------+----------+ +------+-----------------+----------+
DKIM _domainkey DNS TXT Tag Specification Registry Table 5: _domainkey DNS TXT Record Tag Specifications Registry
Updated Values Updated Values
7.6. DKIM Key Type Registry 7.6. DKIM Key Type Registry
The "k=" <key-k-tag> (specified in Section 3.6.1) and the "a=" <sig- The "k=" <key-k-tag> (specified in Section 3.6.1) and the "a=" <sig-
a-tag-k> (specified in Section 3.5) tags provide for a list of a-tag-k> (specified in Section 3.5) tags provide for a list of
mechanisms that can be used to decode a DKIM signature. mechanisms that can be used to decode a DKIM signature.
IANA has established the DKIM Key Type Registry for such mechanisms. IANA has established the "DKIM Key Type" registry for such
mechanisms.
The updated entry in the registry comprises:
+------+-----------+--------+ +------+-----------+--------+
| TYPE | REFERENCE | STATUS | | TYPE | REFERENCE | STATUS |
+------+-----------+--------+ +------+-----------+--------+
| rsa | [RFC3447] | active | | rsa | [RFC3447] | active |
+------+-----------+--------+ +------+-----------+--------+
DKIM Key Type Updated Values Table 6: DKIM Key Type Registry Updated Values
7.7. DKIM Hash Algorithms Registry 7.7. DKIM Hash Algorithms Registry
The "h=" <key-h-tag> (specified in Section 3.6.1) and the "a=" <sig- The "h=" <key-h-tag> (specified in Section 3.6.1) and the "a=" <sig-
a-tag-h> (specified in Section 3.5) tags provide for a list of a-tag-h> (specified in Section 3.5) tags provide for a list of
mechanisms that can be used to produce a digest of message data. mechanisms that can be used to produce a digest of message data.
IANA has established the DKIM Hash Algorithms Registry for such IANA has established the "DKIM Hash Algorithms" registry for such
mechanisms. mechanisms.
The updated entries in the registry comprise:
+--------+-------------------+--------+ +--------+-------------------+--------+
| TYPE | REFERENCE | STATUS | | TYPE | REFERENCE | STATUS |
+--------+-------------------+--------+ +--------+-------------------+--------+
| sha1 | [FIPS-180-3-2008] | active | | sha1 | [FIPS-180-3-2008] | active |
| sha256 | [FIPS-180-3-2008] | active | | sha256 | [FIPS-180-3-2008] | active |
+--------+-------------------+--------+ +--------+-------------------+--------+
DKIM Hash Algorithms Updated Values Table 7: DKIM Hash Algorithms Registry Updated Values
7.8. DKIM Service Types Registry 7.8. DKIM Service Types Registry
The "s=" <key-s-tag> tag (specified in Section 3.6.1) provides for a The "s=" <key-s-tag> tag (specified in Section 3.6.1) provides for a
list of service types to which this selector may apply. list of service types to which this selector may apply.
IANA has established the DKIM Service Types Registry for service IANA has established the "DKIM Service Types" registry for service
types. types.
The updated entries in the registry comprise:
+-------+-----------------+--------+ +-------+-----------------+--------+
| TYPE | REFERENCE | STATUS | | TYPE | REFERENCE | STATUS |
+-------+-----------------+--------+ +-------+-----------------+--------+
| email | (this document) | active | | email | (this document) | active |
| * | (this document) | active | | * | (this document) | active |
+-------+-----------------+--------+ +-------+-----------------+--------+
DKIM Service Types Registry Updated Values Table 8: DKIM Service Types Registry Updated Values
7.9. DKIM Selector Flags Registry 7.9. DKIM Selector Flags Registry
The "t=" <key-t-tag> tag (specified in Section 3.6.1) provides for a The "t=" <key-t-tag> tag (specified in Section 3.6.1) provides for a
list of flags to modify interpretation of the selector. list of flags to modify interpretation of the selector.
IANA has established the DKIM Selector Flags Registry for additional IANA has established the "DKIM Selector Flags" registry for
flags. additional flags.
The updated entries in the registry comprise:
+------+-----------------+--------+ +------+-----------------+--------+
| TYPE | REFERENCE | STATUS | | TYPE | REFERENCE | STATUS |
+------+-----------------+--------+ +------+-----------------+--------+
| y | (this document) | active | | y | (this document) | active |
| s | (this document) | active | | s | (this document) | active |
+------+-----------------+--------+ +------+-----------------+--------+
DKIM Selector Flags Registry Updated Values Table 9: DKIM Selector Flags Registry Updated Values
7.10. DKIM-Signature Header Field 7.10. DKIM-Signature Header Field
IANA has added DKIM-Signature to the "Permanent Message Header IANA has added DKIM-Signature to the "Permanent Message Header Field
Fields" registry (see [RFC3864]) for the "mail" protocol, using this Names" registry (see [RFC3864]) for the "mail" protocol, using this
document as the reference. document as the reference.
8. Security Considerations 8. Security Considerations
It has been observed that any mechanism that is introduced that It has been observed that any introduced mechanism that attempts to
attempts to stem the flow of spam is subject to intensive attack. stem the flow of spam is subject to intensive attack. DKIM needs to
DKIM needs to be carefully scrutinized to identify potential attack be carefully scrutinized to identify potential attack vectors and the
vectors and the vulnerability to each. See also [RFC4686]. vulnerability to each. See also [RFC4686].
8.1. ASCII Art Attacks 8.1. ASCII Art Attacks
The relaxed body canonicalization algorithm may enable certain types The relaxed body canonicalization algorithm may enable certain types
of extremely crude "ASCII Art" attacks where a message may be of extremely crude "ASCII Art" attacks where a message may be
conveyed by adjusting the spacing between words. If this is a conveyed by adjusting the spacing between words. If this is a
concern, the "simple" body canonicalization algorithm should be used concern, the "simple" body canonicalization algorithm should be used
instead. instead.
8.2. Misuse of Body Length Limits ("l=" Tag) 8.2. Misuse of Body Length Limits ("l=" Tag)
Use of the "l=" tag might allow display of fraudulent content without Use of the "l=" tag might allow display of fraudulent content without
appropriate warning to end users. The "l=" tag is intended for appropriate warning to end users. The "l=" tag is intended for
increasing signature robustness when sending to mailing lists that increasing signature robustness when sending to mailing lists that
both modify their content and do not sign their modified messages. both modify their content and do not sign their modified messages.
However, using the "l=" tag enables attacks in which an intermediary However, using the "l=" tag enables attacks in which an intermediary
with malicious intent modifies a message to include content that with malicious intent can modify a message to include content that
solely benefits the attacker. It is possible for the appended solely benefits the attacker. It is possible for the appended
content to completely replace the original content in the end content to completely replace the original content in the end
recipient's eyes and to defeat duplicate message detection recipient's eyes and to defeat duplicate message detection
algorithms. algorithms.
An example of such an attack includes alterations to the MIME An example of such an attack includes altering the MIME structure,
structure or exploiting lax HTML parsing in the MUA, and to defeat exploiting lax HTML parsing in the MUA, and defeating duplicate
duplicate message detection algorithms. message detection algorithms.
To avoid this attack, signers should be extremely wary of using this To avoid this attack, Signers should be extremely wary of using this
tag, and assessors might wish to ignore signatures that use the tag. tag, and Assessors might wish to ignore signatures that use the tag.
8.3. Misappropriated Private Key 8.3. Misappropriated Private Key
As with any other security application that uses private/public key As with any other security application that uses private- or public-
pairs, DKIM requires caution around the handling and protection of key pairs, DKIM requires caution around the handling and protection
keys. A compromised private key or access to one means an intruder of keys. A compromised private key or access to one means an
or malware can send mail signed by the domain that advertises the intruder or malware can send mail signed by the domain that
matching public key. advertises the matching public key.
Thus, private keys issued to users, rather than one used by an ADMD Thus, private keys issued to users, rather than one used by an
itself, create the usual problem of securing data stored on personal ADministrative Management Domain (ADMD) itself, create the usual
resources that can affect the ADMD. problem of securing data stored on personal resources that can affect
the ADMD.
A more secure architecture involves sending messages through an A more secure architecture involves sending messages through an
outgoing MTA that can authenticate the submitter using existing outgoing MTA that can authenticate the submitter using existing
techniques (e.g., SMTP Authentication), possibly validate the message techniques (e.g., SMTP Authentication), possibly validate the message
itself (e.g., verify that the header is legitimate and that the itself (e.g., verify that the header is legitimate and that the
content passes a spam content check), and sign the message using a content passes a spam content check), and sign the message using a
key appropriate for the submitter address. Such an MTA can also key appropriate for the submitter address. Such an MTA can also
apply controls on the volume of outgoing mail each user is permitted apply controls on the volume of outgoing mail each user is permitted
to originate in order to further limit the ability of malware to to originate in order to further limit the ability of malware to
generate bulk email. generate bulk email.
skipping to change at page 59, line 17 skipping to change at page 56, line 50
Since the key servers are distributed (potentially separate for each Since the key servers are distributed (potentially separate for each
domain), the number of servers that would need to be attacked to domain), the number of servers that would need to be attacked to
defeat this mechanism on an Internet-wide basis is very large. defeat this mechanism on an Internet-wide basis is very large.
Nevertheless, key servers for individual domains could be attacked, Nevertheless, key servers for individual domains could be attacked,
impeding the verification of messages from that domain. This is not impeding the verification of messages from that domain. This is not
significantly different from the ability of an attacker to deny significantly different from the ability of an attacker to deny
service to the mail exchangers for a given domain, although it service to the mail exchangers for a given domain, although it
affects outgoing, not incoming, mail. affects outgoing, not incoming, mail.
A variation on this attack involves a very large amount of mail being A variation on this attack involves a very large amount of mail being
sent using spoofed signatures from a given domain, the key servers sent using spoofed signatures from a given domain: the key servers
for that domain could be overwhelmed with requests in a denial-of- for that domain could be overwhelmed with requests in a denial-of-
service attack (see [RFC4732]). However, given the low overhead of service attack (see [RFC4732]). However, given the low overhead of
verification compared with handling of the email message itself, such verification compared with handling of the email message itself, such
an attack would be difficult to mount. an attack would be difficult to mount.
8.5. Attacks Against the DNS 8.5. Attacks against the DNS
Since the DNS is a required binding for key services, specific Since the DNS is a required binding for key services, specific
attacks against the DNS must be considered. attacks against the DNS must be considered.
While the DNS is currently insecure [RFC3833], these security While the DNS is currently insecure [RFC3833], these security
problems are the motivation behind DNS Security (DNSSEC) [RFC4033], problems are the motivation behind DNS Security (DNSSEC) [RFC4033],
and all users of the DNS will reap the benefit of that work. and all users of the DNS will reap the benefit of that work.
DKIM is only intended as a "sufficient" method of proving DKIM is only intended as a "sufficient" method of proving
authenticity. It is not intended to provide strong cryptographic authenticity. It is not intended to provide strong cryptographic
skipping to change at page 59, line 45 skipping to change at page 57, line 30
OpenPGP [RFC4880] and S/MIME [RFC5751] address those requirements. OpenPGP [RFC4880] and S/MIME [RFC5751] address those requirements.
A second security issue related to the DNS revolves around the A second security issue related to the DNS revolves around the
increased DNS traffic as a consequence of fetching selector-based increased DNS traffic as a consequence of fetching selector-based
data as well as fetching signing domain policy. Widespread data as well as fetching signing domain policy. Widespread
deployment of DKIM will result in a significant increase in DNS deployment of DKIM will result in a significant increase in DNS
queries to the claimed signing domain. In the case of forgeries on a queries to the claimed signing domain. In the case of forgeries on a
large scale, DNS servers could see a substantial increase in queries. large scale, DNS servers could see a substantial increase in queries.
A specific DNS security issue that should be considered by DKIM A specific DNS security issue that should be considered by DKIM
verifiers is the name chaining attack described in Section 2.3 of Verifiers is the name chaining attack described in Section 2.3 of
[RFC3833]. A DKIM verifier, while verifying a DKIM-Signature header [RFC3833]. A DKIM Verifier, while verifying a DKIM-Signature header
field, could be prompted to retrieve a key record of an attacker's field, could be prompted to retrieve a key record of an attacker's
choosing. This threat can be minimized by ensuring that name choosing. This threat can be minimized by ensuring that name
servers, including recursive name servers, used by the verifier servers, including recursive name servers, used by the Verifier
enforce strict checking of "glue" and other additional information in enforce strict checking of "glue" and other additional information in
DNS responses and are therefore not vulnerable to this attack. DNS responses and are therefore not vulnerable to this attack.
8.6. Replay/Spam Attacks 8.6. Replay/Spam Attacks
In this attack, a spammer sends a piece of spam through an MTA that In this attack, a spammer sends a piece of spam through an MTA that
signs it, banking on the reputation of the signing domain (e.g., a signs it, banking on the reputation of the signing domain (e.g., a
large popular mailbox provider) rather than its own, and then re- large popular mailbox provider) rather than its own, and then re-
sends that message to a large number of intended recipients. The sends that message to a large number of intended recipients. The
recipients observe the valid signature from the well-known domain, recipients observe the valid signature from the well-known domain,
elevating their trust in the message and increasing the likelihood of elevating their trust in the message and increasing the likelihood of
delivery and presentation to the user. delivery and presentation to the user.
Partial solutions to this problem involve the use of reputation Partial solutions to this problem involve the use of reputation
services to convey the fact that the specific email address is being services to convey the fact that the specific email address is being
used for spam and that messages from that signer are likely to be used for spam and that messages from that Signer are likely to be
spam. This requires a real-time detection mechanism in order to spam. This requires a real-time detection mechanism in order to
react quickly enough. However, such measures might be prone to react quickly enough. However, such measures might be prone to
abuse, if for example an attacker resent a large number of messages abuse, if, for example, an attacker re-sent a large number of
received from a victim in order to make them appear to be a spammer. messages received from a victim in order to make the victim appear to
be a spammer.
Large verifiers might be able to detect unusually large volumes of Large Verifiers might be able to detect unusually large volumes of
mails with the same signature in a short time period. Smaller mails with the same signature in a short time period. Smaller
verifiers can get substantially the same volume of information via Verifiers can get substantially the same volume of information via
existing collaborative systems. existing collaborative systems.
8.7. Limits on Revoking Keys 8.7. Limits on Revoking Keys
When a large domain detects undesirable behavior on the part of one When a large domain detects undesirable behavior on the part of one
of its users, it might wish to revoke the key used to sign that of its users, it might wish to revoke the key used to sign that
user's messages in order to disavow responsibility for messages that user's messages in order to disavow responsibility for messages that
have not yet been verified or that are the subject of a replay have not yet been verified or that are the subject of a replay
attack. However, the ability of the domain to do so can be limited attack. However, the ability of the domain to do so can be limited
if the same key, for scalability reasons, is used to sign messages if the same key, for scalability reasons, is used to sign messages
for many other users. Mechanisms for explicitly revoking keys on a for many other users. Mechanisms for explicitly revoking keys on a
per-address basis have been proposed but require further study as to per-address basis have been proposed but require further study as to
their utility and the DNS load they represent. their utility and the DNS load they represent.
8.8. Intentionally Malformed Key Records 8.8. Intentionally Malformed Key Records
It is possible for an attacker to publish key records in DNS that are It is possible for an attacker to publish key records in DNS that are
intentionally malformed, with the intent of causing a denial-of- intentionally malformed, with the intent of causing a denial-of-
service attack on a non-robust verifier implementation. The attacker service attack on a non-robust Verifier implementation. The attacker
could then cause a verifier to read the malformed key record by could then cause a Verifier to read the malformed key record by
sending a message to one of its users referencing the malformed sending a message to one of its users referencing the malformed
record in a (not necessarily valid) signature. Verifiers MUST record in a (not necessarily valid) signature. Verifiers MUST
thoroughly verify all key records retrieved from the DNS and be thoroughly verify all key records retrieved from the DNS and be
robust against intentionally as well as unintentionally malformed key robust against intentionally as well as unintentionally malformed key
records. records.
8.9. Intentionally Malformed DKIM-Signature Header Fields 8.9. Intentionally Malformed DKIM-Signature Header Fields
Verifiers MUST be prepared to receive messages with malformed DKIM- Verifiers MUST be prepared to receive messages with malformed DKIM-
Signature header fields, and thoroughly verify the header field Signature header fields and thoroughly verify the header field before
before depending on any of its contents. depending on any of its contents.
8.10. Information Leakage 8.10. Information Leakage
An attacker could determine when a particular signature was verified An attacker could determine when a particular signature was verified
by using a per-message selector and then monitoring their DNS traffic by using a per-message selector and then monitoring their DNS traffic
for the key lookup. This would act as the equivalent of a "web bug" for the key lookup. This would act as the equivalent of a "web bug"
for verification time rather than when the message was read. for verification time rather than the time the message was read.
8.11. Remote Timing Attacks 8.11. Remote Timing Attacks
In some cases it may be possible to extract private keys using a In some cases, it may be possible to extract private keys using a
remote timing attack [BONEH03]. Implementations should consider remote timing attack [BONEH03]. Implementations should consider
obfuscating the timing to prevent such attacks. obfuscating the timing to prevent such attacks.
8.12. Reordered Header Fields 8.12. Reordered Header Fields
Existing standards allow intermediate MTAs to reorder header fields. Existing standards allow intermediate MTAs to reorder header fields.
If a signer signs two or more header fields of the same name, this If a Signer signs two or more header fields of the same name, this
can cause spurious verification errors on otherwise legitimate can cause spurious verification errors on otherwise legitimate
messages. In particular, signers that sign any existing DKIM- messages. In particular, Signers that sign any existing DKIM-
Signature fields run the risk of having messages incorrectly fail to Signature fields run the risk of having messages incorrectly fail to
verify. verify.
8.13. RSA Attacks 8.13. RSA Attacks
An attacker could create a large RSA signing key with a small An attacker could create a large RSA signing key with a small
exponent, thus requiring that the verification key have a large exponent, thus requiring that the verification key have a large
exponent. This will force verifiers to use considerable computing exponent. This will force Verifiers to use considerable computing
resources to verify the signature. Verifiers might avoid this attack resources to verify the signature. Verifiers might avoid this attack
by refusing to verify signatures that reference selectors with public by refusing to verify signatures that reference selectors with public
keys having unreasonable exponents. keys having unreasonable exponents.
In general, an attacker might try to overwhelm a verifier by flooding In general, an attacker might try to overwhelm a Verifier by flooding
it with messages requiring verification. This is similar to other it with messages requiring verification. This is similar to other
MTA denial-of-service attacks and should be dealt with in a similar MTA denial-of-service attacks and should be dealt with in a similar
fashion. fashion.
8.14. Inappropriate Signing by Parent Domains 8.14. Inappropriate Signing by Parent Domains
The trust relationship described in Section 3.10 could conceivably be The trust relationship described in Section 3.10 could conceivably be
used by a parent domain to sign messages with identities in a used by a parent domain to sign messages with identities in a
subdomain not administratively related to the parent. For example, subdomain not administratively related to the parent. For example,
the ".com" registry could create messages with signatures using an the ".com" registry could create messages with signatures using an
"i=" value in the example.com domain. There is no general solution "i=" value in the example.com domain. There is no general solution
to this problem, since the administrative cut could occur anywhere in to this problem, since the administrative cut could occur anywhere in
the domain name. For example, in the domain "example.podunk.ca.us" the domain name. For example, in the domain "example.podunk.ca.us",
there are three administrative cuts (podunk.ca.us, ca.us, and us), there are three administrative cuts (podunk.ca.us, ca.us, and us),
any of which could create messages with an identity in the full any of which could create messages with an identity in the full
domain. domain.
INFORMATIVE NOTE: This is considered an acceptable risk for the INFORMATIVE NOTE: This is considered an acceptable risk for the
same reason that it is acceptable for domain delegation. For same reason that it is acceptable for domain delegation. For
example, in the example above any of the domains could potentially example, in the case above, any of the domains could potentially
simply delegate "example.podunk.ca.us" to a server of their choice simply delegate "example.podunk.ca.us" to a server of their choice
and completely replace all DNS-served information. Note that a and completely replace all DNS-served information. Note that a
verifier MAY ignore signatures that come from an unlikely domain Verifier MAY ignore signatures that come from an unlikely domain
such as ".com", as discussed in Section 6.1.1. such as ".com", as discussed in Section 6.1.1.
8.15. Attacks Involving Extra Header Fields 8.15. Attacks Involving Extra Header Fields
Many email components, including MTAs, MSAs, MUAs and filtering Many email components, including MTAs, MSAs, MUAs, and filtering
modules, implement message format checks only loosely. This is done modules, implement message format checks only loosely. This is done
out of years of industry pressure to be liberal in what is accepted out of years of industry pressure to be liberal in what is accepted
into the mail stream for the sake of reducing support costs; into the mail stream for the sake of reducing support costs;
improperly formed messages are often silently fixed in transit, improperly formed messages are often silently fixed in transit,
delivered unrepaired, or displayed inappropriately (e.g., by showing delivered unrepaired, or displayed inappropriately (e.g., by showing
only the first of multiple From: fields). only the first of multiple From: fields).
Agents that evaluate or apply DKIM output need to be aware that a Agents that evaluate or apply DKIM output need to be aware that a
DKIM signer can sign messages that are malformed (e.g., violate DKIM Signer can sign messages that are malformed (e.g., violate
[RFC5322], such as by having multiple instances of a field that is [RFC5322], such as by having multiple instances of a field that is
only permitted once), or that become malformed in transit, or that only permitted once), that become malformed in transit, or that
contain header or body content that is not true or valid. Use of contain header or body content that is not true or valid. Use of
DKIM on such messages might constitute an attack against a receiver, DKIM on such messages might constitute an attack against a receiver,
especially where additional credence is given to a signed message especially where additional credence is given to a signed message
without adequate evaluation of the signer. without adequate evaluation of the Signer.
These can represent serious attacks, but they have nothing to do with These can represent serious attacks, but they have nothing to do with
DKIM; they are attacks on the recipient, or on the wrongly identified DKIM; they are attacks on the recipient or on the wrongly identified
author. author.
Moreover, an agent would be incorrect to infer that all instances of Moreover, an agent would be incorrect to infer that all instances of
a header field are signed just because one is. a header field are signed just because one is.
A genuine signature from the domain under attack can be obtained by A genuine signature from the domain under attack can be obtained by
legitimate means, but extra header fields can then be added, either legitimate means, but extra header fields can then be added, either
by interception or by replay. In this scenario, DKIM can aid in by interception or by replay. In this scenario, DKIM can aid in
detecting addition of specific fields in transit. This is done by detecting addition of specific fields in transit. This is done by
having the signer list the field name(s) in the "h=" tag an extra having the Signer list the field name(s) in the "h=" tag an extra
time (e.g., "h=from:from:..." for a message with one From field), so time (e.g., "h=from:from:..." for a message with one From field), so
that addition of an instance of that field downstream will render the that addition of an instance of that field downstream will render the
signature unable to be verified. (See Section 3.5 for details.) signature unable to be verified. (See Section 3.5 for details.)
This in essence is an explicit indication that the signer repudiates This, in essence, is an explicit indication that the Signer
responsibility for such a malformed message. repudiates responsibility for such a malformed message.
DKIM signs and validates the data it is told to and works correctly. DKIM signs and validates the data it is told to and works correctly.
So in this case, DKIM has done its job of delivering a validated So in this case, DKIM has done its job of delivering a validated
domain (the "d=" value) and, given the semantics of a DKIM signature, domain (the "d=" value) and, given the semantics of a DKIM signature,
essentially the signer has taken some responsibility for a essentially the Signer has taken some responsibility for a
problematic message. It is up to the identity assessor or some other problematic message. It is up to the Identity Assessor or some other
subsequent agent to act on such messages as needed, such as degrading subsequent agent to act on such messages as needed, such as degrading
the trust of the message (or, indeed, of the signer), or by warning the trust of the message (or, indeed, of the Signer), warning the
the recipient, or even refusing delivery. recipient, or even refusing delivery.
All components of the mail system that perform loose enforcement of All components of the mail system that perform loose enforcement of
other mail standards will need to revisit that posture when other mail standards will need to revisit that posture when
incorporating DKIM, especially when considering matters of potential incorporating DKIM, especially when considering matters of potential
attacks such as those described. attacks such as those described.
9. References 9. References
9.1. Normative References 9.1. Normative References
[FIPS-180-3-2008] [FIPS-180-3-2008]
U.S. Department of Commerce, "Secure Hash Standard", FIPS U.S. Department of Commerce, "Secure Hash Standard", FIPS
PUB 180-3, October 2008. PUB 180-3, October 2008.
[ITU-X660-1997] [ITU-X660-1997]
"Information Technology - ASN.1 encoding rules: "Information Technology - ASN.1 encoding rules:
Specification of Basic Encoding Rules (BER), Canonical Specification of Basic Encoding Rules (BER), Canonical
Encoding Rules (CER) and Distinguished Encoding Rules Encoding Rules (CER) and Distinguished Encoding Rules
(DER)", 1997. (DER)", 1997.
[RFC1034] Mockapetris, P., "DOMAIN NAMES - CONCEPTS AND FACILITIES", [RFC1034] Mockapetris, P., "Domain names - concepts and facilities",
RFC 1034, November 1987. STD 13, RFC 1034, November 1987.
[RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part One: Format of Internet Message Extensions (MIME) Part One: Format of Internet Message
Bodies", RFC 2045, November 1996. Bodies", RFC 2045, November 1996.
[RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Extensions (MIME) Part Five: Conformance Criteria and Extensions (MIME) Part Five: Conformance Criteria and
Examples", RFC 2049, November 1996. Examples", RFC 2049, November 1996.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography
Standards (PKCS) #1: RSA Cryptography Specifications Standards (PKCS) #1: RSA Cryptography Specifications
Version 2.1", RFC 3447, February 2003. Version 2.1", RFC 3447, February 2003.
[RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax [RFC5234] Crocker, D. and P. Overell, "Augmented BNF for Syntax
Specifications: ABNF", RFC 5234, January 2008. Specifications: ABNF", STD 68, RFC 5234, January 2008.
[RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321,
October 2008. October 2008.
[RFC5322] Resnick, P., "Internet Message Format", RFC 5322, [RFC5322] Resnick, P., Ed., "Internet Message Format", RFC 5322,
October 2008. October 2008.
[RFC5598] Crocker, D., "Internet Mail Architecture", RFC 5598, [RFC5598] Crocker, D., "Internet Mail Architecture", RFC 5598,
July 2009. July 2009.
[RFC5890] Klensin, J., "Internationalizing Domain Names in [RFC5890] Klensin, J., "Internationalized Domain Names for
Applications (IDNA): Definitions and Document Framework", Applications (IDNA): Definitions and Document Framework",
RFC 5890, August 2010. RFC 5890, August 2010.
9.2. Informative References 9.2. Informative References
[BONEH03] "Remote Timing Attacks are Practical", Proceedings 12th [BONEH03] "Remote Timing Attacks are Practical", Proceedings 12th
USENIX Security Symposium, 2003. USENIX Security Symposium, 2003.
[I-D.DKIM-MAILINGLISTS] [RFC2047] Moore, K., "MIME (Multipurpose Internet Mail Extensions)
Kucherawy, M., "DKIM And Mailing Lists", Part Three: Message Header Extensions for Non-ASCII Text",
I-D draft-ietf-dkim-mailinglists, June 2011. RFC 2047, November 1996.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
10646", RFC 3629, June 2011. 10646", STD 63, RFC 3629, November 2003.
[RFC3766] Orman, H. and P. Hoffman, "Determining Strengths For [RFC3766] Orman, H. and P. Hoffman, "Determining Strengths For
Public Keys Used For Exchanging Symmetric Keys", BCP 86, Public Keys Used For Exchanging Symmetric Keys", BCP 86,
RFC 3766, April 2004. RFC 3766, April 2004.
[RFC3833] Atkins, D. and R. Austein, "Threat Analysis of the Domain [RFC3833] Atkins, D. and R. Austein, "Threat Analysis of the Domain
Name System (DNS)", RFC 3833, August 2004. Name System (DNS)", RFC 3833, August 2004.
[RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration
Procedures for Message Header Fields", BCP 90, RFC 3864, Procedures for Message Header Fields", BCP 90, RFC 3864,
skipping to change at page 65, line 8 skipping to change at page 62, line 48
[RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S. [RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S.
Rose, "DNS Security Introduction and Requirements", Rose, "DNS Security Introduction and Requirements",
RFC 4033, March 2005. RFC 4033, March 2005.
[RFC4409] Gellens, R. and J. Klensin, "Message Submission for Mail", [RFC4409] Gellens, R. and J. Klensin, "Message Submission for Mail",
RFC 4409, April 2006. RFC 4409, April 2006.
[RFC4686] Fenton, J., "Analysis of Threats Motivating DomainKeys [RFC4686] Fenton, J., "Analysis of Threats Motivating DomainKeys
Identified Mail (DKIM)", RFC 4686, September 2006. Identified Mail (DKIM)", RFC 4686, September 2006.
[RFC4732] Handley, M., Ed., Rescorla, E., Ed., and IAB, "Internet [RFC4732] Handley, M., Rescorla, E., and IAB, "Internet Denial-of-
Denial-of-Service Considerations", RFC 4732, Service Considerations", RFC 4732, December 2006.
November 2006.
[RFC4870] Delany, M., "Domain-Based Email Authentication Using [RFC4870] Delany, M., "Domain-Based Email Authentication Using
Public Keys Advertised in the DNS (DomainKeys)", RFC 4870, Public Keys Advertised in the DNS (DomainKeys)", RFC 4870,
May 2007. May 2007.
[RFC4871] Allman, E., Callas, J., Delany, M., Libbey, M., Fenton, [RFC4871] Allman, E., Callas, J., Delany, M., Libbey, M., Fenton,
J., and M. Thomas, "DomainKeys Identified Mail (DKIM) J., and M. Thomas, "DomainKeys Identified Mail (DKIM)
Signatures", RFC 4871, May 2007. Signatures", RFC 4871, May 2007.
[RFC4880] Callas, J., Donnerhacke, L., Finney, H., and R. Thayer, [RFC4880] Callas, J., Donnerhacke, L., Finney, H., Shaw, D., and R.
"OpenPGP Message Format", RFC 4880, November 2007. Thayer, "OpenPGP Message Format", RFC 4880, November 2007.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", BCP 26, RFC 5226, IANA Considerations Section in RFCs", BCP 26, RFC 5226,
May 2008. May 2008.
[RFC5451] Kucherawy, M., "Message Header Field for Indicating [RFC5451] Kucherawy, M., "Message Header Field for Indicating
Message Authentication Status", RFC 5451, April 2009. Message Authentication Status", RFC 5451, April 2009.
[RFC5585] Hansen, T., Crocker, D., and P. Hallam-Baker, "DomainKeys [RFC5585] Hansen, T., Crocker, D., and P. Hallam-Baker, "DomainKeys
Identified Mail (DKIM) Service Overview", RFC 5585, Identified Mail (DKIM) Service Overview", RFC 5585,
July 2009. July 2009.
[RFC5672] Crocker, D., Ed., "RFC 4871 DomainKeys Identified Mail [RFC5672] Crocker, D., "RFC 4871 DomainKeys Identified Mail (DKIM)
(DKIM) Signatures -- Update", RFC 5672, August 2009. Signatures -- Update", RFC 5672, August 2009.
[RFC5751] Ramsdell, B., "Secure/Multipurpose Internet Mail [RFC5751] Ramsdell, B. and S. Turner, "Secure/Multipurpose Internet
Extensions (S/MIME) Version 3.1 Message Specification", Mail Extensions (S/MIME) Version 3.2 Message
RFC 5751, January 2010. Specification", RFC 5751, January 2010.
[RFC5863] Hansen, T., Siegel, E., Hallam-Baker, P., and D. Crocker, [RFC5863] Hansen, T., Siegel, E., Hallam-Baker, P., and D. Crocker,
"DomainKeys Identified Mail (DKIM) Development, "DomainKeys Identified Mail (DKIM) Development,
Deployment, and Operations", RFC 5863, May 2010. Deployment, and Operations", RFC 5863, May 2010.
[RFC6377] Kucherawy, M., "DomainKeys Identified Mail (DKIM) and
Mailing Lists", RFC 6377, September 2011.
Appendix A. Example of Use (INFORMATIVE) Appendix A. Example of Use (INFORMATIVE)
This section shows the complete flow of an email from submission to This section shows the complete flow of an email from submission to
final delivery, demonstrating how the various components fit final delivery, demonstrating how the various components fit
together. The key used in this example is shown in Appendix C. together. The key used in this example is shown in Appendix C.
A.1. The User Composes an Email A.1. The User Composes an Email
From: Joe SixPack <joe@football.example.com> From: Joe SixPack <joe@football.example.com>
To: Suzie Q <suzie@shopping.example.net> To: Suzie Q <suzie@shopping.example.net>
Subject: Is dinner ready? Subject: Is dinner ready?
Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT)
Message-ID: <20030712040037.46341.5F8J@football.example.com> Message-ID: <20030712040037.46341.5F8J@football.example.com>
Hi. Hi.
We lost the game. Are you hungry yet? We lost the game. Are you hungry yet?
Joe. Joe.
Figure 1: The User Composes an Email Figure 1: The User Composes an Email
A.2. The Email is Signed A.2. The Email is Signed
This email is signed by the example.com outbound email server and now This email is signed by the example.com outbound email server and now
looks like this: looks like this:
DKIM-Signature: v=1; a=rsa-sha256; s=brisbane; d=example.com; DKIM-Signature: v=1; a=rsa-sha256; s=brisbane; d=example.com;
c=simple/simple; q=dns/txt; i=joe@football.example.com; c=simple/simple; q=dns/txt; i=joe@football.example.com;
h=Received : From : To : Subject : Date : Message-ID; h=Received : From : To : Subject : Date : Message-ID;
bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=; bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=;
b=AuUoFEfDxTDkHlLXSZEpZj79LICEps6eda7W3deTVFOk4yAUoqOB b=AuUoFEfDxTDkHlLXSZEpZj79LICEps6eda7W3deTVFOk4yAUoqOB
4nujc7YopdG5dWLSdNg6xNAZpOPr+kHxt1IrE+NahM6L/LbvaHut 4nujc7YopdG5dWLSdNg6xNAZpOPr+kHxt1IrE+NahM6L/LbvaHut
KVdkLLkpVaVVQPzeRDI009SO2Il5Lu7rDNH6mZckBdrIx0orEtZV KVdkLLkpVaVVQPzeRDI009SO2Il5Lu7rDNH6mZckBdrIx0orEtZV
4bmp/YzhwvcubU4=; 4bmp/YzhwvcubU4=;
Received: from client1.football.example.com [192.0.2.1] Received: from client1.football.example.com [192.0.2.1]
by submitserver.example.com with SUBMISSION; by submitserver.example.com with SUBMISSION;
skipping to change at page 66, line 44 skipping to change at page 65, line 29
by submitserver.example.com with SUBMISSION; by submitserver.example.com with SUBMISSION;
Fri, 11 Jul 2003 21:01:54 -0700 (PDT) Fri, 11 Jul 2003 21:01:54 -0700 (PDT)
From: Joe SixPack <joe@football.example.com> From: Joe SixPack <joe@football.example.com>
To: Suzie Q <suzie@shopping.example.net> To: Suzie Q <suzie@shopping.example.net>
Subject: Is dinner ready? Subject: Is dinner ready?
Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT)
Message-ID: <20030712040037.46341.5F8J@football.example.com> Message-ID: <20030712040037.46341.5F8J@football.example.com>
Hi. Hi.
We lost the game. Are you hungry yet? We lost the game. Are you hungry yet?
Joe. Joe.
The Email is Signed Figure 2: The Email is Signed
The signing email server requires access to the private key The signing email server requires access to the private key
associated with the "brisbane" selector to generate this signature. associated with the "brisbane" selector to generate this signature.
A.3. The Email Signature is Verified A.3. The Email Signature is Verified
The signature is normally verified by an inbound SMTP server or The signature is normally verified by an inbound SMTP server or
possibly the final delivery agent. However, intervening MTAs can possibly the final delivery agent. However, intervening MTAs can
also perform this verification if they choose to do so. The also perform this verification if they choose to do so. The
verification process uses the domain "example.com" extracted from the verification process uses the domain "example.com" extracted from the
skipping to change at page 67, line 47 skipping to change at page 66, line 48
by submitserver.example.com with SUBMISSION; by submitserver.example.com with SUBMISSION;
Fri, 11 Jul 2003 21:01:54 -0700 (PDT) Fri, 11 Jul 2003 21:01:54 -0700 (PDT)
From: Joe SixPack <joe@football.example.com> From: Joe SixPack <joe@football.example.com>
To: Suzie Q <suzie@shopping.example.net> To: Suzie Q <suzie@shopping.example.net>
Subject: Is dinner ready? Subject: Is dinner ready?
Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT)
Message-ID: <20030712040037.46341.5F8J@football.example.com> Message-ID: <20030712040037.46341.5F8J@football.example.com>
Hi. Hi.
We lost the game. Are you hungry yet? We lost the game. Are you hungry yet?
Joe. Joe.
Successful verification Figure 3: Successful Verification
Appendix B. Usage Examples (INFORMATIVE) Appendix B. Usage Examples (INFORMATIVE)
DKIM signing and validating can be used in different ways, for DKIM signing and validating can be used in different ways, for
different operational scenarios. This Appendix discusses some common different operational scenarios. This Appendix discusses some common
examples. examples.
NOTE: Descriptions in this Appendix are for informational purposes NOTE: Descriptions in this Appendix are for informational purposes
only. They describe various ways that DKIM can be used, given only. They describe various ways that DKIM can be used, given
particular constraints and needs. In no case are these examples particular constraints and needs. In no case are these examples
intended to be taken as providing explanation or guidance intended to be taken as providing explanation or guidance
concerning DKIM specification details, when creating an concerning DKIM specification details when creating an
implementation. implementation.
B.1. Alternate Submission Scenarios B.1. Alternate Submission Scenarios
In the most simple scenario, a user's MUA, MSA, and Internet In the most simple scenario, a user's MUA, MSA, and Internet
(boundary) MTA are all within the same administrative environment, (boundary) MTA are all within the same administrative environment,
using the same domain name. Therefore, all of the components using the same domain name. Therefore, all of the components
involved in submission and initial transfer are related. However, it involved in submission and initial transfer are related. However, it
is common for two or more of the components to be under independent is common for two or more of the components to be under independent
administrative control. This creates challenges for choosing and administrative control. This creates challenges for choosing and
administering the domain name to use for signing, and for its administering the domain name to use for signing and for its
relationship to common email identity header fields. relationship to common email identity header fields.
B.1.1. Delegated Business Functions B.1.1. Delegated Business Functions
Some organizations assign specific business functions to discrete Some organizations assign specific business functions to discrete
groups, inside or outside the organization. The goal, then, is to groups, inside or outside the organization. The goal, then, is to
authorize that group to sign some mail, but to constrain what authorize that group to sign some mail but to constrain what
signatures they can generate. DKIM selectors (the "s=" signature signatures they can generate. DKIM selectors (the "s=" signature
tag) facilitate this kind of restricted authorization. Examples of tag) facilitate this kind of restricted authorization. Examples of
these outsourced business functions are legitimate email marketing these outsourced business functions are legitimate email marketing
providers and corporate benefits providers. providers and corporate benefits providers.
Here, the delegated group needs to be able to send messages that are Here, the delegated group needs to be able to send messages that are
signed, using the email domain of the client company. At the same signed, using the email domain of the client company. At the same
time, the client often is reluctant to register a key for the time, the client often is reluctant to register a key for the
provider that grants the ability to send messages for arbitrary provider that grants the ability to send messages for arbitrary
addresses in the domain. addresses in the domain.
There are multiple ways to administer these usage scenarios. In one There are multiple ways to administer these usage scenarios. In one
case, the client organization provides all of the public query case, the client organization provides all of the public query
service (for example, DNS) administration, and in another it uses DNS service (for example, DNS) administration, and in another, it uses
delegation to enable all ongoing administration of the DKIM key DNS delegation to enable all ongoing administration of the DKIM key
record by the delegated group. record by the delegated group.
If the client organization retains responsibility for all of the DNS If the client organization retains responsibility for all of the DNS
administration, the outsourcing company can generate a key pair, administration, the outsourcing company can generate a key pair,
supplying the public key to the client company, which then registers supplying the public key to the client company, which then registers
it in the query service, using a unique selector. The client company it in the query service using a unique selector. The client company
retains control over the use of the delegated key because it retains retains control over the use of the delegated key because it retains
the ability to revoke the key at any time. the ability to revoke the key at any time.
If the client wants the delegated group to do the DNS administration, If the client wants the delegated group to do the DNS administration,
it can have the domain name that is specified with the selector point it can have the domain name that is specified with the selector point
to the provider's DNS server. The provider then creates and to the provider's DNS server. The provider then creates and
maintains all of the DKIM signature information for that selector. maintains all of the DKIM signature information for that selector.
Hence, the client cannot provide constraints on the Local-part of Hence, the client cannot provide constraints on the local-part of
addresses that get signed, but it can revoke the provider's signing addresses that get signed, but it can revoke the provider's signing
rights by removing the DNS delegation record. rights by removing the DNS delegation record.
B.1.2. PDAs and Similar Devices B.1.2. PDAs and Similar Devices
PDAs demonstrate the need for using multiple keys per domain. PDAs demonstrate the need for using multiple keys per domain.
Suppose that John Doe wanted to be able to send messages using his Suppose that John Doe wants to be able to send messages using his
corporate email address, jdoe@example.com, and his email device did corporate email address, jdoe@example.com, and his email device does
not have the ability to make a Virtual Private Network (VPN) not have the ability to make a Virtual Private Network (VPN)
connection to the corporate network, either because the device is connection to the corporate network, either because the device is
limited or because there are restrictions enforced by his Internet limited or because there are restrictions enforced by his Internet
access provider. If the device was equipped with a private key access provider. If the device is equipped with a private key
registered for jdoe@example.com by the administrator of the registered for jdoe@example.com by the administrator of the
example.com domain, and appropriate software to sign messages, John example.com domain and appropriate software to sign messages, John
could sign the message on the device itself before transmission could sign the message on the device itself before transmission
through the outgoing network of the access service provider. through the outgoing network of the access service provider.
B.1.3. Roaming Users B.1.3. Roaming Users
Roaming users often find themselves in circumstances where it is Roaming users often find themselves in circumstances where it is
convenient or necessary to use an SMTP server other than their home convenient or necessary to use an SMTP server other than their home
server; examples are conferences and many hotels. In such server; examples are conferences and many hotels. In such
circumstances, a signature that is added by the submission service circumstances, a signature that is added by the submission service
will use an identity that is different from the user's home system. will use an identity that is different from the user's home system.
skipping to change at page 70, line 7 skipping to change at page 69, line 13
own domain key. own domain key.
B.1.4. Independent (Kiosk) Message Submission B.1.4. Independent (Kiosk) Message Submission
Stand-alone services, such as walk-up kiosks and web-based Stand-alone services, such as walk-up kiosks and web-based
information services, have no enduring email service relationship information services, have no enduring email service relationship
with the user, but users occasionally request that mail be sent on with the user, but users occasionally request that mail be sent on
their behalf. For example, a website providing news often allows the their behalf. For example, a website providing news often allows the
reader to forward a copy of the article to a friend. This is reader to forward a copy of the article to a friend. This is
typically done using the reader's own email address, to indicate who typically done using the reader's own email address, to indicate who
the author is. This is sometimes referred to as the "Evite problem", the author is. This is sometimes referred to as the "Evite" problem,
named after the website of the same name that allows a user to send named after the website of the same name that allows a user to send
invitations to friends. invitations to friends.
A common way this is handled is to continue to put the reader's email A common way this is handled is to continue to put the reader's email
address in the From header field of the message, but put an address address in the From header field of the message but put an address
owned by the email posting site into the Sender header field. The owned by the email posting site into the Sender header field. The
posting site can then sign the message, using the domain that is in posting site can then sign the message, using the domain that is in
the Sender field. This provides useful information to the receiving the Sender field. This provides useful information to the receiving
email site, which is able to correlate the signing domain with the email site, which is able to correlate the signing domain with the
initial submission email role. initial submission email role.
Receiving sites often wish to provide their end users with Receiving sites often wish to provide their end users with
information about mail that is mediated in this fashion. Although information about mail that is mediated in this fashion. Although
the real efficacy of different approaches is a subject for human the real efficacy of different approaches is a subject for human
factors usability research, one technique that is used is for the factors usability research, one technique that is used is for the
verifying system to rewrite the From header field, to indicate the verifying system to rewrite the From header field to indicate the
address that was verified. For example: From: John Doe via address that was verified, for example: From: John Doe via
news@news-site.example <jdoe@example.com>. (Note that such rewriting news@news-site.example <jdoe@example.com>. (Note that such rewriting
will break a signature, unless it is done after the verification pass will break a signature, unless it is done after the verification pass
is complete.) is complete.)
B.2. Alternate Delivery Scenarios B.2. Alternate Delivery Scenarios
Email is often received at a mailbox that has an address different Email is often received at a mailbox that has an address different
from the one used during initial submission. In these cases, an from the one used during initial submission. In these cases, an
intermediary mechanism operates at the address originally used and it intermediary mechanism operates at the address originally used, and
then passes the message on to the final destination. This mediation it then passes the message on to the final destination. This
process presents some challenges for DKIM signatures. mediation process presents some challenges for DKIM signatures.
B.2.1. Affinity Addresses B.2.1. Affinity Addresses
"Affinity addresses" allow a user to have an email address that "Affinity addresses" allow a user to have an email address that
remains stable, even as the user moves among different email remains stable, even as the user moves among different email
providers. They are typically associated with college alumni providers. They are typically associated with college alumni
associations, professional organizations, and recreational associations, professional organizations, and recreational
organizations with which they expect to have a long-term organizations with which they expect to have a long-term
relationship. These domains usually provide forwarding of incoming relationship. These domains usually provide forwarding of incoming
email, and they often have an associated Web application that email, and they often have an associated Web application that
authenticates the user and allows the forwarding address to be authenticates the user and allows the forwarding address to be
changed. However, these services usually depend on users sending changed. However, these services usually depend on users sending
outgoing messages through their own service providers' MTAs. Hence, outgoing messages through their own service provider's MTAs. Hence,
mail that is signed with the domain of the affinity address is not mail that is signed with the domain of the affinity address is not
signed by an entity that is administered by the organization owning signed by an entity that is administered by the organization owning
that domain. that domain.
With DKIM, affinity domains could use the Web application to allow With DKIM, affinity domains could use the Web application to allow
users to register per-user keys to be used to sign messages on behalf users to register per-user keys to be used to sign messages on behalf
of their affinity address. The user would take away the secret half of their affinity address. The user would take away the secret half
of the key pair for signing, and the affinity domain would publish of the key pair for signing, and the affinity domain would publish
the public half in DNS for access by verifiers. the public half in DNS for access by Verifiers.
This is another application that takes advantage of user-level This is another application that takes advantage of user-level
keying, and domains used for affinity addresses would typically have keying, and domains used for affinity addresses would typically have
a very large number of user-level keys. Alternatively, the affinity a very large number of user-level keys. Alternatively, the affinity
domain could handle outgoing mail, operating a mail submission agent domain could handle outgoing mail, operating a mail submission agent
that authenticates users before accepting and signing messages for that authenticates users before accepting and signing messages for
them. This is of course dependent on the user's service provider not them. This is, of course, dependent on the user's service provider
blocking the relevant TCP ports used for mail submission. not blocking the relevant TCP ports used for mail submission.
B.2.2. Simple Address Aliasing (.forward) B.2.2. Simple Address Aliasing (.forward)
In some cases a recipient is allowed to configure an email address to In some cases, a recipient is allowed to configure an email address
cause automatic redirection of email messages from the original to cause automatic redirection of email messages from the original
address to another, such as through the use of a Unix .forward file. address to another, such as through the use of a Unix .forward file.
In this case, messages are typically redirected by the mail handling In this case, messages are typically redirected by the mail handling
service of the recipient's domain, without modification, except for service of the recipient's domain, without modification, except for
the addition of a Received header field to the message and a change the addition of a Received header field to the message and a change
in the envelope recipient address. In this case, the recipient at in the envelope recipient address. In this case, the recipient at
the final address' mailbox is likely to be able to verify the the final address' mailbox is likely to be able to verify the
original signature since the signed content has not changed, and DKIM original signature since the signed content has not changed, and DKIM
is able to validate the message signature. is able to validate the message signature.
B.2.3. Mailing Lists and Re-Posters B.2.3. Mailing Lists and Re-Posters
skipping to change at page 71, line 50 skipping to change at page 71, line 10
to the body (typically at the end), or reformat the body in some to the body (typically at the end), or reformat the body in some
manner. The simple ones produce messages that are quite similar to manner. The simple ones produce messages that are quite similar to
the automated alias services. More elaborate systems essentially the automated alias services. More elaborate systems essentially
create a new message. create a new message.
A Forwarder that does not modify the body or signed header fields of A Forwarder that does not modify the body or signed header fields of
a message is likely to maintain the validity of the existing a message is likely to maintain the validity of the existing
signature. It also could choose to add its own signature to the signature. It also could choose to add its own signature to the
message. message.
Forwarders which modify a message in a way that could make an Forwarders that modify a message in a way that could make an existing
existing signature invalid are particularly good candidates for signature invalid are particularly good candidates for adding their
adding their own signatures (e.g., mailing-list-name@example.net). own signatures (e.g., mailing-list-name@example.net). Since
(re-)signing is taking responsibility for the content of the message,
Since (re-)signing is taking responsibility for the content of the these signing forwarders are likely to be selective and forward or
message, these signing forwarders are likely to be selective, and re-sign a message only if it is received with a valid signature or if
forward or re-sign a message only if it is received with a valid they have some other basis for knowing that the message is not
signature or if they have some other basis for knowing that the spoofed.
message is not spoofed.
A common practice among systems that are primarily redistributors of A common practice among systems that are primarily redistributors of
mail is to add a Sender header field to the message, to identify the mail is to add a Sender header field to the message to identify the
address being used to sign the message. This practice will remove address being used to sign the message. This practice will remove
any preexisting Sender header field as required by [RFC5322]. The any preexisting Sender header field as required by [RFC5322]. The
forwarder applies a new DKIM-Signature header field with the forwarder applies a new DKIM-Signature header field with the
signature, public key, and related information of the forwarder. signature, public key, and related information of the forwarder.
See [I-D.DKIM-MAILINGLISTS] for additional related topics and See [RFC6377] for additional related topics and discussion.
discussion.
Appendix C. Creating a Public Key (INFORMATIVE) Appendix C. Creating a Public Key (INFORMATIVE)
The default signature is an RSA signed SHA-256 digest of the complete The default signature is an RSA-signed SHA-256 digest of the complete
email. For ease of explanation, the openssl command is used to email. For ease of explanation, the openssl command is used to
describe the mechanism by which keys and signatures are managed. One describe the mechanism by which keys and signatures are managed. One
way to generate a 1024-bit, unencrypted private key suitable for DKIM way to generate a 1024-bit, unencrypted private key suitable for DKIM
is to use openssl like this: is to use openssl like this:
$ openssl genrsa -out rsa.private 1024 $ openssl genrsa -out rsa.private 1024
For increased security, the "-passin" parameter can also be added to For increased security, the "-passin" parameter can also be added to
encrypt the private key. Use of this parameter will require entering encrypt the private key. Use of this parameter will require entering
a password for several of the following steps. Servers may prefer to a password for several of the following steps. Servers may prefer to
use hardware cryptographic support. use hardware cryptographic support.
The "genrsa" step results in the file rsa.private containing the key The "genrsa" step results in the file rsa.private containing the key
information similar to this: information similar to this:
-----BEGIN RSA PRIVATE KEY----- -----BEGIN RSA PRIVATE KEY-----
MIICXwIBAAKBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkMoGeLnQg1fWn7/zYtIxN2SnFC MIICXwIBAAKBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkMoGeLnQg1fWn7/zYtIxN2SnFC
jxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v/RtdC2UzJ1lWT947qR+Rcac2gb jxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v/RtdC2UzJ1lWT947qR+Rcac2gb
to/NMqJ0fzfVjH4OuKhitdY9tf6mcwGjaNBcWToIMmPSPDdQPNUYckcQ2QIDAQAB to/NMqJ0fzfVjH4OuKhitdY9tf6mcwGjaNBcWToIMmPSPDdQPNUYckcQ2QIDAQAB
AoGBALmn+XwWk7akvkUlqb+dOxyLB9i5VBVfje89Teolwc9YJT36BGN/l4e0l6QX AoGBALmn+XwWk7akvkUlqb+dOxyLB9i5VBVfje89Teolwc9YJT36BGN/l4e0l6QX
/1//6DWUTB3KI6wFcm7TWJcxbS0tcKZX7FsJvUz1SbQnkS54DJck1EZO/BLa5ckJ /1//6DWUTB3KI6wFcm7TWJcxbS0tcKZX7FsJvUz1SbQnkS54DJck1EZO/BLa5ckJ
gAYIaqlA9C0ZwM6i58lLlPadX/rtHb7pWzeNcZHjKrjM461ZAkEA+itss2nRlmyO gAYIaqlA9C0ZwM6i58lLlPadX/rtHb7pWzeNcZHjKrjM461ZAkEA+itss2nRlmyO
n1/5yDyCluST4dQfO8kAB3toSEVc7DeFeDhnC1mZdjASZNvdHS4gbLIA1hUGEF9m n1/5yDyCluST4dQfO8kAB3toSEVc7DeFeDhnC1mZdjASZNvdHS4gbLIA1hUGEF9m
3hKsGUMMPwJBAPW5v/U+AWTADFCS22t72NUurgzeAbzb1HWMqO4y4+9Hpjk5wvL/ 3hKsGUMMPwJBAPW5v/U+AWTADFCS22t72NUurgzeAbzb1HWMqO4y4+9Hpjk5wvL/
eVYizyuce3/fGke7aRYw/ADKygMJdW8H/OcCQQDz5OQb4j2QDpPZc0Nc4QlbvMsj eVYizyuce3/fGke7aRYw/ADKygMJdW8H/OcCQQDz5OQb4j2QDpPZc0Nc4QlbvMsj
skipping to change at page 73, line 4 skipping to change at page 72, line 20
/1//6DWUTB3KI6wFcm7TWJcxbS0tcKZX7FsJvUz1SbQnkS54DJck1EZO/BLa5ckJ /1//6DWUTB3KI6wFcm7TWJcxbS0tcKZX7FsJvUz1SbQnkS54DJck1EZO/BLa5ckJ
gAYIaqlA9C0ZwM6i58lLlPadX/rtHb7pWzeNcZHjKrjM461ZAkEA+itss2nRlmyO gAYIaqlA9C0ZwM6i58lLlPadX/rtHb7pWzeNcZHjKrjM461ZAkEA+itss2nRlmyO
n1/5yDyCluST4dQfO8kAB3toSEVc7DeFeDhnC1mZdjASZNvdHS4gbLIA1hUGEF9m n1/5yDyCluST4dQfO8kAB3toSEVc7DeFeDhnC1mZdjASZNvdHS4gbLIA1hUGEF9m
3hKsGUMMPwJBAPW5v/U+AWTADFCS22t72NUurgzeAbzb1HWMqO4y4+9Hpjk5wvL/ 3hKsGUMMPwJBAPW5v/U+AWTADFCS22t72NUurgzeAbzb1HWMqO4y4+9Hpjk5wvL/
eVYizyuce3/fGke7aRYw/ADKygMJdW8H/OcCQQDz5OQb4j2QDpPZc0Nc4QlbvMsj eVYizyuce3/fGke7aRYw/ADKygMJdW8H/OcCQQDz5OQb4j2QDpPZc0Nc4QlbvMsj
7p7otWRO5xRa6SzXqqV3+F0VpqvDmshEBkoCydaYwc2o6WQ5EBmExeV8124XAkEA 7p7otWRO5xRa6SzXqqV3+F0VpqvDmshEBkoCydaYwc2o6WQ5EBmExeV8124XAkEA
qZzGsIxVP+sEVRWZmW6KNFSdVUpk3qzK0Tz/WjQMe5z0UunY9Ax9/4PVhp/j61bf qZzGsIxVP+sEVRWZmW6KNFSdVUpk3qzK0Tz/WjQMe5z0UunY9Ax9/4PVhp/j61bf
eAYXunajbBSOLlx4D+TunwJBANkPI5S9iylsbLs6NkaMHV6k5ioHBBmgCak95JGX eAYXunajbBSOLlx4D+TunwJBANkPI5S9iylsbLs6NkaMHV6k5ioHBBmgCak95JGX
GMot/L2x0IYyMLAz6oLWh2hm7zwtb0CgOrPo1ke44hFYnfc= GMot/L2x0IYyMLAz6oLWh2hm7zwtb0CgOrPo1ke44hFYnfc=
-----END RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----
To extract the public-key component from the private key, use openssl To extract the public-key component from the private key, use openssl
like this: like this:
$ openssl rsa -in rsa.private -out rsa.public -pubout -outform PEM $ openssl rsa -in rsa.private -out rsa.public -pubout -outform PEM
This results in the file rsa.public containing the key information This results in the file rsa.public containing the key information
similar to this: similar to this:
-----BEGIN PUBLIC KEY----- -----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkM MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkM
oGeLnQg1fWn7/zYtIxN2SnFCjxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v/R oGeLnQg1fWn7/zYtIxN2SnFCjxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v/R
tdC2UzJ1lWT947qR+Rcac2gbto/NMqJ0fzfVjH4OuKhitdY9tf6mcwGjaNBcWToI tdC2UzJ1lWT947qR+Rcac2gbto/NMqJ0fzfVjH4OuKhitdY9tf6mcwGjaNBcWToI
MmPSPDdQPNUYckcQ2QIDAQAB MmPSPDdQPNUYckcQ2QIDAQAB
-----END PUBLIC KEY----- -----END PUBLIC KEY-----
This public-key data (without the BEGIN and END tags) is placed in This public-key data (without the BEGIN and END tags) is placed in
the DNS: the DNS:
$ORIGIN _domainkey.example.org. $ORIGIN _domainkey.example.org.
brisbane IN TXT ("v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ" brisbane IN TXT ("v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ"
"KBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkMoGeLnQg1fWn7/zYt" "KBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkMoGeLnQg1fWn7/zYt"
"IxN2SnFCjxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v" "IxN2SnFCjxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v"
"/RtdC2UzJ1lWT947qR+Rcac2gbto/NMqJ0fzfVjH4OuKhi" "/RtdC2UzJ1lWT947qR+Rcac2gbto/NMqJ0fzfVjH4OuKhi"
"tdY9tf6mcwGjaNBcWToIMmPSPDdQPNUYckcQ2QIDAQAB") "tdY9tf6mcwGjaNBcWToIMmPSPDdQPNUYckcQ2QIDAQAB")
C.1. Compatibility with DomainKeys Key Records C.1. Compatibility with DomainKeys Key Records
DKIM key records were designed to be backwards-compatible in many DKIM key records were designed to be backward compatible in many
cases with key records used by DomainKeys [RFC4870] (sometimes cases with key records used by DomainKeys [RFC4870] (sometimes
referred to as "selector records" in the DomainKeys context). One referred to as "selector records" in the DomainKeys context). One
area of incompatibility warrants particular attention. The "g=" tag/ area of incompatibility warrants particular attention. The "g=" tag
value may be used in DomainKeys and [RFC4871] key records to provide value may be used in DomainKeys and [RFC4871] key records to provide
finer granularity of the validity of the key record to a specific finer granularity of the validity of the key record to a specific
local-part. A null "g=" value in DomainKeys is valid for all local-part. A null "g=" value in DomainKeys is valid for all
addresses in the domain. This differs from the usage in the original addresses in the domain. This differs from the usage in the original
DKIM specification ([RFC4871]), where a null "g=" value is not valid DKIM specification ([RFC4871]), where a null "g=" value is not valid
for any address. In particular, see the example public key record in for any address. In particular, see the example public-key record in
Section 3.2.3 of [RFC4870]. Section 3.2.3 of [RFC4870].
C.2. RFC4871 Compatibility C.2. RFC 4871 Compatibility
Although the "g=" tag has been deprecated in this version of the DKIM Although the "g=" tag has been deprecated in this version of the DKIM
specification (and thus MUST now be ignored), signers are advised not specification (and thus MUST now be ignored), Signers are advised not
to include the "g=" tag in key records because some [RFC4871]- to include the "g=" tag in key records because some [RFC4871]-
compliant verifiers will be in use for a considerable period to come. compliant Verifiers will be in use for a considerable period to come.
Appendix D. MUA Considerations (INFORMATIVE) Appendix D. MUA Considerations (INFORMATIVE)
When a DKIM signature is verified, the processing system sometimes When a DKIM signature is verified, the processing system sometimes
makes the result available to the recipient user's MUA. How to makes the result available to the recipient user's MUA. How to
present this information to the user in a way that helps them is a present this information to users in a way that helps them is a
matter of continuing human factors usability research. The tendency matter of continuing human factors usability research. The tendency
is to have the MUA highlight the SDID, in an attempt to show the user is to have the MUA highlight the SDID, in an attempt to show the user
the identity that is claiming responsibility for the message. An MUA the identity that is claiming responsibility for the message. An MUA
might do this with visual cues such as graphics, or it might include might do this with visual cues such as graphics, might include the
the address in an alternate view, or it might even rewrite the address in an alternate view, or might even rewrite the original From
original From address using the verified information. Some MUAs address using the verified information. Some MUAs might indicate
might indicate which header fields were protected by the validated which header fields were protected by the validated DKIM signature.
DKIM signature. This could be done with a positive indication on the This could be done with a positive indication on the signed header
signed header fields, with a negative indication on the unsigned fields, with a negative indication on the unsigned header fields, by
header fields, by visually hiding the unsigned header fields, or some visually hiding the unsigned header fields, or some combination of
combination of these. If an MUA uses visual indications for signed these. If an MUA uses visual indications for signed header fields,
header fields, the MUA probably needs to be careful not to display the MUA probably needs to be careful not to display unsigned header
unsigned header fields in a way that might be construed by the end fields in a way that might be construed by the end user as having
user as having been signed. If the message has an l= tag whose value been signed. If the message has an "l=" tag whose value does not
does not extend to the end of the message, the MUA might also hide or extend to the end of the message, the MUA might also hide or mark the
mark the portion of the message body that was not signed. portion of the message body that was not signed.
The aforementioned information is not intended to be exhaustive. The The aforementioned information is not intended to be exhaustive. The
MUA can choose to highlight, accentuate, hide, or otherwise display MUA can choose to highlight, accentuate, hide, or otherwise display
any other information that may, in the opinion of the MUA author, be any other information that may, in the opinion of the MUA author, be
deemed important to the end user. deemed important to the end user.
Appendix E. Changes since RFC4871 Appendix E. Changes since RFC 4871
o Abstract and introduction refined based on accumulated experience. o Abstract and introduction refined based on accumulated experience.
o Various references updated. o Various references updated.
o Several errata resolved (see o Several errata resolved (see http://www.rfc-editor.org/):
http://www.rfc-editor.org/errata_search.php?rfc=4871):
* 1376 applied * 1376 applied
* 1377 applied * 1377 applied
* 1378 applied * 1378 applied
* 1379 applied * 1379 applied
* 1380 applied * 1380 applied
skipping to change at page 75, line 24 skipping to change at page 74, line 41
* 1532 applied * 1532 applied
* 1596 applied * 1596 applied
o Introductory section enumerating relevant architectural documents o Introductory section enumerating relevant architectural documents
added. added.
o Introductory section briefly discussing the matter of data o Introductory section briefly discussing the matter of data
integrity added. integrity added.
o Allow tolerance of some clock drift. o Allowed tolerance of some clock drift.
o Drop "g=" tag from key records. The implementation report o Dropped "g=" tag from key records. The implementation report
indicates that it is not in use. indicates that it is not in use.
o Remove errant note about wildcards in the DNS. o Removed errant note about wildcards in the DNS.
o Remove SMTP-specific advice in most places. o Removed SMTP-specific advice in most places.
o Reduce (non-normative) recommended signature content list, and o Reduced (non-normative) recommended signature content list, and
rework the text in that section. reworked the text in that section.
o Clarify signature generation algorithm by rewriting its pseudo- o Clarified signature generation algorithm by rewriting its pseudo-
code. code.
o Numerous terminology subsections added, imported from [RFC5672]. o Numerous terminology subsections added, imported from [RFC5672].
Also began using these terms throughout the document (e.g., SDID, Also, began using these terms throughout the document (e.g., SDID,
AUID). AUID).
o Sections added that specify input and output requirements. Input o Sections added that specify input and output requirements. Input
requirements address a security concern raised by the working requirements address a security concern raised by the working
group (see also new sections in Security Considerations). Output group (see also new sections in Security Considerations). Output
requirements are imported from [RFC5672]. requirements are imported from [RFC5672].
o Appendix subsection added discussing compatibility with DomainKeys o Appendix subsection added discussing compatibility with DomainKeys
([RFC4870]) records. ([RFC4870]) records.
o Refer to [RFC5451] as an example method of communicating the o Referred to [RFC5451] as an example method of communicating the
results of DKIM verification. results of DKIM verification.
o Remove advice about possible uses of the "l=" signature tag. o Removed advice about possible uses of the "l=" signature tag.
o IANA registry update. o IANA registry updated.
o Add two new Security Considerations sections talking about o Added two new Security Considerations sections talking about
malformed message attacks. malformed message attacks.
o Various copy editing. o Various copy editing.
Appendix F. Acknowledgements Appendix F. Acknowledgments
The previous IETF version of DKIM [RFC4871] was edited by: Eric The previous IETF version of DKIM [RFC4871] was edited by Eric
Allman, Jon Callas, Mark Delany, Miles Libbey, Jim Fenton and Michael Allman, Jon Callas, Mark Delany, Miles Libbey, Jim Fenton, and
Thomas. Michael Thomas.
That specification was the result of an extended, collaborative That specification was the result of an extended collaborative
effort, including participation by: Russ Allbery, Edwin Aoki, Claus effort, including participation by Russ Allbery, Edwin Aoki, Claus
Assmann, Steve Atkins, Rob Austein, Fred Baker, Mark Baugher, Steve Assmann, Steve Atkins, Rob Austein, Fred Baker, Mark Baugher, Steve
Bellovin, Nathaniel Borenstein, Dave Crocker, Michael Cudahy, Dennis Bellovin, Nathaniel Borenstein, Dave Crocker, Michael Cudahy, Dennis
Dayman, Jutta Degener, Frank Ellermann, Patrik Faeltstroem, Mark Dayman, Jutta Degener, Frank Ellermann, Patrik Faeltstroem, Mark
Fanto, Stephen Farrell, Duncan Findlay, Elliot Gillum, Olafur Fanto, Stephen Farrell, Duncan Findlay, Elliot Gillum, Olafur
Gu[eth]mundsson, Phillip Hallam-Baker, Tony Hansen, Sam Hartman, Gudmundsson, Phillip Hallam-Baker, Tony Hansen, Sam Hartman, Arvel
Arvel Hathcock, Amir Herzberg, Paul Hoffman, Russ Housley, Craig Hathcock, Amir Herzberg, Paul Hoffman, Russ Housley, Craig Hughes,
Hughes, Cullen Jennings, Don Johnsen, Harry Katz, Murray S. Cullen Jennings, Don Johnsen, Harry Katz, Murray S. Kucherawy, Barry
Kucherawy, Barry Leiba, John Levine, Charles Lindsey, Simon Leiba, John Levine, Charles Lindsey, Simon Longsdale, David Margrave,
Longsdale, David Margrave, Justin Mason, David Mayne, Thierry Moreau, Justin Mason, David Mayne, Thierry Moreau, Steve Murphy, Russell
Steve Murphy, Russell Nelson, Dave Oran, Doug Otis, Shamim Pirzada, Nelson, Dave Oran, Doug Otis, Shamim Pirzada, Juan Altmayer Pizzorno,
Juan Altmayer Pizzorno, Sanjay Pol, Blake Ramsdell, Christian Renaud, Sanjay Pol, Blake Ramsdell, Christian Renaud, Scott Renfro, Neil
Scott Renfro, Neil Rerup, Eric Rescorla, Dave Rossetti, Hector Rerup, Eric Rescorla, Dave Rossetti, Hector Santos, Jim Schaad, the
Santos, Jim Schaad, the Spamhaus.org team, Malte S. Stretz, Robert Spamhaus.org team, Malte S. Stretz, Robert Sanders, Rand Wacker, Sam
Sanders, Rand Wacker, Sam Weiler, and Dan Wing. Weiler, and Dan Wing.
The earlier DomainKeys was a primary source from which DKIM was The earlier DomainKeys was a primary source from which DKIM was
derived. Further information about DomainKeys is at [RFC4870]. derived. Further information about DomainKeys is at [RFC4870].
This revision received contributions from: Steve Atkins, Mark Delany, This revision received contributions from Steve Atkins, Mark Delany,
J.D. Falk, Jim Fenton, Michael Hammer, Barry Leiba, John Levine, J.D. Falk, Jim Fenton, Michael Hammer, Barry Leiba, John Levine,
Charles Lindsey, Jeff Macdonald, Franck Martin, Brett McDowell, Doug Charles Lindsey, Jeff Macdonald, Franck Martin, Brett McDowell, Doug
Otis, Bill Oxley, Hector Santos, Rolf Sonneveld, Michael Thomas, and Otis, Bill Oxley, Hector Santos, Rolf Sonneveld, Michael Thomas, and
Alessandro Vesely. Alessandro Vesely.
Authors' Addresses Authors' Addresses
D. Crocker (editor) Dave Crocker (editor)
Brandenburg InternetWorking Brandenburg InternetWorking
675 Spruce Dr. 675 Spruce Dr.
Sunnyvale Sunnyvale, CA 94086
USA USA
Phone: +1.408.246.8253 Phone: +1.408.246.8253
Email: dcrocker@bbiw.net EMail: dcrocker@bbiw.net
URI: http://bbiw.net URI: http://bbiw.net
Tony Hansen (editor) Tony Hansen (editor)
AT&T Laboratories AT&T Laboratories
200 Laurel Ave. South 200 Laurel Ave. South
Middletown, NJ 07748 Middletown, NJ 07748
USA USA
Email: tony+dkimov@maillennium.att.com EMail: tony+dkimsig@maillennium.att.com
M. Kucherawy (editor) Murray S. Kucherawy (editor)
Cloudmark Cloudmark
128 King St., 2nd Floor 128 King St., 2nd Floor
San Francisco, CA 94107 San Francisco, CA 94107
USA USA
Email: msk@cloudmark.com EMail: msk@cloudmark.com
 End of changes. 423 change blocks. 
769 lines changed or deleted 774 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/