Internet Engineering Task Force (IETF) D. Crocker, Ed.
Request for Comments: 6376 Brandenburg InternetWorking
Obsoletes: 4871, 5672 T. Hansen, Ed.
Category: Standards Track AT&T Laboratories
ISSN: 2070-1721 M. Kucherawy, Ed.
September 2011 DomainKeys Identified Mail (DKIM) Signatures
DomainKeys Identified Mail (DKIM) permits a person, role, or
organization that owns the signing domain to claim some
responsibility for a message by associating the domain with the
message. This can be an author's organization, an operational relay,
or one of their agents. DKIM separates the question of the identity
of the Signer of the message from the purported author of the
message. Assertion of responsibility is validated through a
cryptographic signature and by querying the Signer's domain directly
to retrieve the appropriate public key. Message transit from author
to recipient is through relays that typically make no substantive
change to the message content and thus preserve the DKIM signature.
This memo obsoletes RFC 4871 and RFC 5672.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in Section 2 of RFC 5741.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
Copyright (c) 2011 IETF Trust and the persons identified as the
document authors. All rights reserved.
8.15. Attacks Involving Extra Header Fields . . . . . . . . . . 609. References . . . . . . . . . . . . . . . . . . . . . . . . . . 619.1. Normative References . . . . . . . . . . . . . . . . . . . 619.2. Informative References . . . . . . . . . . . . . . . . . . 62Appendix A. Example of Use (INFORMATIVE) . . . . . . . . . . . . 64A.1. The User Composes an Email . . . . . . . . . . . . . . . . 64A.2. The Email is Signed . . . . . . . . . . . . . . . . . . . 65A.3. The Email Signature is Verified . . . . . . . . . . . . . 66Appendix B. Usage Examples (INFORMATIVE) . . . . . . . . . . . . 67B.1. Alternate Submission Scenarios . . . . . . . . . . . . . . 67B.2. Alternate Delivery Scenarios . . . . . . . . . . . . . . . 69Appendix C. Creating a Public Key (INFORMATIVE) . . . . . . . . . 71C.1. Compatibility with DomainKeys Key Records . . . . . . . . 72C.2. RFC 4871 Compatibility . . . . . . . . . . . . . . . . . . 73Appendix D. MUA Considerations (INFORMATIVE) . . . . . . . . . . 73Appendix E. Changes since RFC 4871 . . . . . . . . . . . . . . . 73Appendix F. Acknowledgments . . . . . . . . . . . . . . . . . . . 751. Introduction
DomainKeys Identified Mail (DKIM) permits a person, role, or
organization to claim some responsibility for a message by
associating a domain name [RFC1034] with the message [RFC5322], which
they are authorized to use. This can be an author's organization, an
operational relay, or one of their agents. Assertion of
responsibility is validated through a cryptographic signature and by
querying the Signer's domain directly to retrieve the appropriate
public key. Message transit from author to recipient is through
relays that typically make no substantive change to the message
content and thus preserve the DKIM signature. A message can contain
multiple signatures, from the same or different organizations
involved with the message.
The approach taken by DKIM differs from previous approaches to
message signing (e.g., Secure/Multipurpose Internet Mail Extensions
(S/MIME) [RFC5751], OpenPGP [RFC4880]) in that:
o the message signature is written as a message header field so that
neither human recipients nor existing MUA (Mail User Agent)
software is confused by signature-related content appearing in the
o there is no dependency on public- and private-key pairs being
issued by well-known, trusted certificate authorities;
o there is no dependency on the deployment of any new Internet
protocols or services for public-key distribution or revocation;
o signature verification failure does not force rejection of the
o no attempt is made to include encryption as part of the mechanism;
o message archiving is not a design goal.
o is compatible with the existing email infrastructure and
transparent to the fullest extent possible;
o requires minimal new infrastructure;
o can be implemented independently of clients in order to reduce
o can be deployed incrementally; and
o allows delegation of signing to third parties.
1.1. DKIM Architecture Documents
Readers are advised to be familiar with the material in [RFC4686],
[RFC5585], and [RFC5863], which provide the background for the
development of DKIM, an overview of the service, and deployment and
operations guidance and advice, respectively.
1.2. Signing Identity
DKIM separates the question of the identity of the Signer of the
message from the purported author of the message. In particular, a
signature includes the identity of the Signer. Verifiers can use the
signing information to decide how they want to process the message.
The signing identity is included as part of the signature header
INFORMATIVE RATIONALE: The signing identity specified by a DKIM
signature is not required to match an address in any particular
header field because of the broad methods of interpretation by
recipient mail systems, including MUAs.
DKIM is designed to support the extreme scalability requirements that
characterize the email identification problem. There are many
millions of domains and a much larger number of individual addresses.
DKIM seeks to preserve the positive aspects of the current email
infrastructure, such as the ability for anyone to communicate with
anyone else without introduction.
1.4. Simple Key Management
DKIM differs from traditional hierarchical public-key systems in that
no certificate authority infrastructure is required; the Verifier
requests the public key from a repository in the domain of the
claimed Signer directly rather than from a third party.
The DNS is proposed as the initial mechanism for the public keys.
Thus, DKIM currently depends on DNS administration and the security
of the DNS system. DKIM is designed to be extensible to other key
fetching services as they become available.
1.5. Data Integrity
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
reuse of the signature with different messages. Verifying the
signature asserts that the hashed content has not changed since it
was signed and asserts nothing else about "protecting" the end-to-end
integrity of the message.
2. Terminology and Definitions
This section defines terms used in the rest of the document.
DKIM is designed to operate within the Internet Mail service, as
defined in [RFC5598]. Basic email terminology is taken from that
Syntax descriptions use Augmented BNF (ABNF) [RFC5234].
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
[RFC2119]. These words take their normative meanings only when they
are presented in ALL UPPERCASE.
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),
MSAs (Mail Submission Agents), MTAs (Mail Transfer Agents), or other
agents such as mailing list exploders. In general, any Signer will
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
leaves the administrative domain of the Signer.
Elements in the mail system that verify signatures are referred to as
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
user (reader) of the message or some consuming agent such as a
mailing list exploder.
A person, role, or organization. In the context of DKIM, examples
include the author, the author's organization, an ISP along the
handling path, an independent trust assessment service, and a mailing
A label that refers to an identity.
2.5. Signing Domain Identifier (SDID)
A single domain name that is the mandatory payload output of DKIM and
that refers to the identity claiming some responsibility for the
message by signing it. It is specified in Section 3.5.
2.6. Agent or User Identifier (AUID)
A single identifier that refers to the agent or user on behalf of
whom the Signing Domain Identifier (SDID) has taken responsibility.
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 subdomain
of it. For DKIM processing, the domain name portion of the AUID has
only basic domain name semantics; any possible owner-specific
semantics are outside the scope of DKIM. It is specified in
Note that acceptable values for the AUID may be constrained via a
flag in the public-key record. (See Section 3.6.1.)
2.7. Identity Assessor
An element in the mail system that consumes DKIM's payload, which is
the responsible Signing Domain Identifier (SDID). The Identity
Assessor is dedicated to the assessment of the delivered identifier.
Other DKIM (and non-DKIM) values can also be used by the Identity
Assessor (if they are available) to provide a more general message
evaluation filtering engine. However, this additional activity is
outside the scope of this specification.
There are three forms of whitespace:
o WSP represents simple whitespace, i.e., a space or a tab character
(formal definition in [RFC5234]).
o LWSP is linear whitespace, defined as WSP plus CRLF (formal
definition in [RFC5234]).
o FWS is folding whitespace. It allows multiple lines separated by
CRLF followed by at least one whitespace, to be joined.
The formal ABNF for these are (WSP and LWSP are given for information
WSP = SP / HTAB
LWSP = *(WSP / CRLF WSP)
FWS = [*WSP CRLF] 1*WSP
The definition of FWS is identical to that in [RFC5322] except for
the exclusion of obs-FWS.
2.9. Imported ABNF Tokens
The following tokens are imported from other RFCs as noted. Those
RFCs should be considered definitive.
The following tokens are imported from [RFC5321]:
o "local-part" (implementation warning: this permits quoted strings)
The following tokens are imported from [RFC5322]:
o "field-name" (name of a header field)
o "dot-atom-text" (in the local-part of an email address)
The following tokens are imported from [RFC2045]:
o "qp-section" (a single line of quoted-printable-encoded text)
o "hex-octet" (a quoted-printable encoded octet)
INFORMATIVE NOTE: Be aware that the ABNF in [RFC2045] does not
obey the rules of [RFC5234] and must be interpreted accordingly,
particularly as regards case folding.
Other tokens not defined herein are imported from [RFC5234]. These
are intuitive primitives such as SP, HTAB, WSP, ALPHA, DIGIT, CRLF,
2.10. Common ABNF Tokens
The following ABNF tokens are used elsewhere in this document:
hyphenated-word = ALPHA [ *(ALPHA / DIGIT / "-") (ALPHA / DIGIT) ]
ALPHADIGITPS = (ALPHA / DIGIT / "+" / "/")
base64string = ALPHADIGITPS *([FWS] ALPHADIGITPS)
[ [FWS] "=" [ [FWS] "=" ] ]
hdr-name = field-name
qp-hdr-value = dkim-quoted-printable ; with "|" encoded
The DKIM-Quoted-Printable encoding syntax resembles that described in
Quoted-Printable [RFC2045], Section 6.7: any character MAY be encoded
as an "=" followed by two hexadecimal digits from the alphabet
"0123456789ABCDEF" (no lowercase characters permitted) representing
the hexadecimal-encoded integer value of that character. All control
characters (those with values < %x20), 8-bit characters (values >
%x7F), and the characters DEL (%x7F), SPACE (%x20), and semicolon
(";", %x3B) MUST be encoded. Note that all whitespace, including
SPACE, CR, and LF characters, MUST be encoded. After encoding, FWS
MAY be added at arbitrary locations in order to avoid excessively
long lines; such whitespace is NOT part of the value, and MUST be
removed before decoding. Use of characters not listed as "mail-safe"
in [RFC2049] is NOT RECOMMENDED.
dkim-quoted-printable = *(FWS / hex-octet / dkim-safe-char)
; hex-octet is from RFC2045
dkim-safe-char = %x21-3A / %x3C / %x3E-7E
; '!' - ':', '<', '>' - '~'
INFORMATIVE NOTE: DKIM-Quoted-Printable differs from Quoted-
Printable as defined in [RFC2045] in several important ways:
1. Whitespace in the input text, including CR and LF, must be
encoded. [RFC2045] does not require such encoding, and does
not permit encoding of CR or LF characters that are part of a
CRLF line break.
2. Whitespace in the encoded text is ignored. This is to allow
tags encoded using DKIM-Quoted-Printable to be wrapped as
needed. In particular, [RFC2045] requires that line breaks in
the input be represented as physical line breaks; that is not
the case here.
3. The "soft line break" syntax ("=" as the last non-whitespace
character on the line) does not apply.
4. DKIM-Quoted-Printable does not require that encoded lines be
no more than 76 characters long (although there may be other
requirements depending on the context in which the encoded
text is being used).