idnits 2.17.1 draft-ietf-dkim-rfc4871bis-15.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The draft header indicates that this document obsoletes RFC5672, but the abstract doesn't seem to directly say this. It does mention RFC5672 though, so this could be OK. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 1293 has weird spacing: '... email elec...' == The document seems to contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (July 11, 2011) is 4644 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'ITU-X660-1997' is defined on line 2834, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS-180-3-2008' -- Possible downref: Non-RFC (?) normative reference: ref. 'ITU-X660-1997' ** Obsolete normative reference: RFC 3447 (Obsoleted by RFC 8017) ** Downref: Normative reference to an Informational RFC: RFC 5598 -- Obsolete informational reference (is this intentional?): RFC 4409 (Obsoleted by RFC 6409) -- Obsolete informational reference (is this intentional?): RFC 4870 (Obsoleted by RFC 4871) -- Obsolete informational reference (is this intentional?): RFC 4871 (Obsoleted by RFC 6376) -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) -- Obsolete informational reference (is this intentional?): RFC 5451 (Obsoleted by RFC 7001) -- Obsolete informational reference (is this intentional?): RFC 5672 (Obsoleted by RFC 6376) -- Obsolete informational reference (is this intentional?): RFC 5751 (Obsoleted by RFC 8551) Summary: 2 errors (**), 0 flaws (~~), 4 warnings (==), 11 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group D. Crocker, Ed. 3 Internet-Draft Brandenburg InternetWorking 4 Obsoletes: 4871, 5672 T. Hansen, Ed. 5 (if approved) AT&T Laboratories 6 Intended status: Standards Track M. Kucherawy, Ed. 7 Expires: January 12, 2012 Cloudmark 8 July 11, 2011 10 DomainKeys Identified Mail (DKIM) Signatures 11 draft-ietf-dkim-rfc4871bis-15 13 Abstract 15 DomainKeys Identified Mail (DKIM) permits a person, role, or 16 organization that owns the signing domain to claim some 17 responsibility for a message by associating the domain with the 18 message. This can be an author's organization, an operational relay 19 or one of their agents. DKIM separates the question of the identity 20 of the signer of the message from the purported author of the 21 message. Assertion of responsibility is validated through a 22 cryptographic signature and querying the signer's domain directly to 23 retrieve the appropriate public key. Message transit from author to 24 recipient is through relays that typically make no substantive change 25 to the message content and thus preserve the DKIM signature. 27 This memo obsoletes RFC4871 and RFC5672. 29 Status of this Memo 31 This Internet-Draft is submitted in full conformance with the 32 provisions of BCP 78 and BCP 79. 34 Internet-Drafts are working documents of the Internet Engineering 35 Task Force (IETF). Note that other groups may also distribute 36 working documents as Internet-Drafts. The list of current Internet- 37 Drafts is at http://datatracker.ietf.org/drafts/current/. 39 Internet-Drafts are draft documents valid for a maximum of six months 40 and may be updated, replaced, or obsoleted by other documents at any 41 time. It is inappropriate to use Internet-Drafts as reference 42 material or to cite them other than as "work in progress." 44 This Internet-Draft will expire on January 12, 2012. 46 Copyright Notice 48 Copyright (c) 2011 IETF Trust and the persons identified as the 49 document authors. All rights reserved. 51 This document is subject to BCP 78 and the IETF Trust's Legal 52 Provisions Relating to IETF Documents 53 (http://trustee.ietf.org/license-info) in effect on the date of 54 publication of this document. Please review these documents 55 carefully, as they describe your rights and restrictions with respect 56 to this document. Code Components extracted from this document must 57 include Simplified BSD License text as described in Section 4.e of 58 the Trust Legal Provisions and are provided without warranty as 59 described in the Simplified BSD License. 61 This document may contain material from IETF Documents or IETF 62 Contributions published or made publicly available before November 63 10, 2008. The person(s) controlling the copyright in some of this 64 material may not have granted the IETF Trust the right to allow 65 modifications of such material outside the IETF Standards Process. 66 Without obtaining an adequate license from the person(s) controlling 67 the copyright in such materials, this document may not be modified 68 outside the IETF Standards Process, and derivative works of it may 69 not be created outside the IETF Standards Process, except to format 70 it for publication as an RFC or to translate it into languages other 71 than English. 73 Table of Contents 75 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 76 1.1. DKIM Architecture Documents . . . . . . . . . . . . . . . 6 77 1.2. Signing Identity . . . . . . . . . . . . . . . . . . . . . 6 78 1.3. Scalability . . . . . . . . . . . . . . . . . . . . . . . 6 79 1.4. Simple Key Management . . . . . . . . . . . . . . . . . . 6 80 1.5. Data Integrity . . . . . . . . . . . . . . . . . . . . . . 7 81 2. Terminology and Definitions . . . . . . . . . . . . . . . . . 7 82 2.1. Signers . . . . . . . . . . . . . . . . . . . . . . . . . 7 83 2.2. Verifiers . . . . . . . . . . . . . . . . . . . . . . . . 7 84 2.3. Identity . . . . . . . . . . . . . . . . . . . . . . . . . 7 85 2.4. Identifier . . . . . . . . . . . . . . . . . . . . . . . . 8 86 2.5. Signing Domain Identifier (SDID) . . . . . . . . . . . . . 8 87 2.6. Agent or User Identifier (AUID) . . . . . . . . . . . . . 8 88 2.7. Identity Assessor . . . . . . . . . . . . . . . . . . . . 8 89 2.8. Whitespace . . . . . . . . . . . . . . . . . . . . . . . . 8 90 2.9. Imported ABNF Tokens . . . . . . . . . . . . . . . . . . . 9 91 2.10. Common ABNF Tokens . . . . . . . . . . . . . . . . . . . . 9 92 2.11. DKIM-Quoted-Printable . . . . . . . . . . . . . . . . . . 10 93 3. Protocol Elements . . . . . . . . . . . . . . . . . . . . . . 11 94 3.1. Selectors . . . . . . . . . . . . . . . . . . . . . . . . 11 95 3.2. Tag=Value Lists . . . . . . . . . . . . . . . . . . . . . 13 96 3.3. Signing and Verification Algorithms . . . . . . . . . . . 14 97 3.4. Canonicalization . . . . . . . . . . . . . . . . . . . . . 15 98 3.5. The DKIM-Signature Header Field . . . . . . . . . . . . . 19 99 3.6. Key Management and Representation . . . . . . . . . . . . 28 100 3.7. Computing the Message Hashes . . . . . . . . . . . . . . . 32 101 3.8. Input Requirements . . . . . . . . . . . . . . . . . . . . 34 102 3.9. Output Requirements . . . . . . . . . . . . . . . . . . . 35 103 3.10. Signing by Parent Domains . . . . . . . . . . . . . . . . 35 104 3.11. Relationship between SDID and AUID . . . . . . . . . . . . 36 105 4. Semantics of Multiple Signatures . . . . . . . . . . . . . . . 37 106 4.1. Example Scenarios . . . . . . . . . . . . . . . . . . . . 37 107 4.2. Interpretation . . . . . . . . . . . . . . . . . . . . . . 38 108 5. Signer Actions . . . . . . . . . . . . . . . . . . . . . . . . 39 109 5.1. Determine Whether the Email Should Be Signed and by 110 Whom . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 111 5.2. Select a Private Key and Corresponding Selector 112 Information . . . . . . . . . . . . . . . . . . . . . . . 39 113 5.3. Normalize the Message to Prevent Transport Conversions . . 40 114 5.4. Determine the Header Fields to Sign . . . . . . . . . . . 41 115 5.5. Compute the Message Hash and Signature . . . . . . . . . . 45 116 5.6. Insert the DKIM-Signature Header Field . . . . . . . . . . 45 117 6. Verifier Actions . . . . . . . . . . . . . . . . . . . . . . . 46 118 6.1. Extract Signatures from the Message . . . . . . . . . . . 46 119 6.2. Communicate Verification Results . . . . . . . . . . . . . 51 120 6.3. Interpret Results/Apply Local Policy . . . . . . . . . . . 52 122 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 53 123 7.1. Email Authentication Methods Registry . . . . . . . . . . 53 124 7.2. DKIM-Signature Tag Specifications . . . . . . . . . . . . 53 125 7.3. DKIM-Signature Query Method Registry . . . . . . . . . . . 54 126 7.4. DKIM-Signature Canonicalization Registry . . . . . . . . . 54 127 7.5. _domainkey DNS TXT Resource Record Tag Specifications . . 55 128 7.6. DKIM Key Type Registry . . . . . . . . . . . . . . . . . . 56 129 7.7. DKIM Hash Algorithms Registry . . . . . . . . . . . . . . 56 130 7.8. DKIM Service Types Registry . . . . . . . . . . . . . . . 56 131 7.9. DKIM Selector Flags Registry . . . . . . . . . . . . . . . 57 132 7.10. DKIM-Signature Header Field . . . . . . . . . . . . . . . 57 133 8. Security Considerations . . . . . . . . . . . . . . . . . . . 57 134 8.1. ASCII Art Attacks . . . . . . . . . . . . . . . . . . . . 57 135 8.2. Misuse of Body Length Limits ("l=" Tag) . . . . . . . . . 58 136 8.3. Misappropriated Private Key . . . . . . . . . . . . . . . 58 137 8.4. Key Server Denial-of-Service Attacks . . . . . . . . . . . 59 138 8.5. Attacks Against the DNS . . . . . . . . . . . . . . . . . 59 139 8.6. Replay/Spam Attacks . . . . . . . . . . . . . . . . . . . 60 140 8.7. Limits on Revoking Keys . . . . . . . . . . . . . . . . . 60 141 8.8. Intentionally Malformed Key Records . . . . . . . . . . . 60 142 8.9. Intentionally Malformed DKIM-Signature Header Fields . . . 61 143 8.10. Information Leakage . . . . . . . . . . . . . . . . . . . 61 144 8.11. Remote Timing Attacks . . . . . . . . . . . . . . . . . . 61 145 8.12. Reordered Header Fields . . . . . . . . . . . . . . . . . 61 146 8.13. RSA Attacks . . . . . . . . . . . . . . . . . . . . . . . 61 147 8.14. Inappropriate Signing by Parent Domains . . . . . . . . . 61 148 8.15. Attacks Involving Extra Header Fields . . . . . . . . . . 62 149 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 63 150 9.1. Normative References . . . . . . . . . . . . . . . . . . . 63 151 9.2. Informative References . . . . . . . . . . . . . . . . . . 64 152 Appendix A. Example of Use (INFORMATIVE) . . . . . . . . . . . . 65 153 A.1. The User Composes an Email . . . . . . . . . . . . . . . . 66 154 A.2. The Email is Signed . . . . . . . . . . . . . . . . . . . 66 155 A.3. The Email Signature is Verified . . . . . . . . . . . . . 67 156 Appendix B. Usage Examples (INFORMATIVE) . . . . . . . . . . . . 68 157 B.1. Alternate Submission Scenarios . . . . . . . . . . . . . . 68 158 B.2. Alternate Delivery Scenarios . . . . . . . . . . . . . . . 70 159 Appendix C. Creating a Public Key (INFORMATIVE) . . . . . . . . . 72 160 C.1. Compatibility with DomainKeys Key Records . . . . . . . . 73 161 C.2. RFC4871 Compatibility . . . . . . . . . . . . . . . . . . 73 162 Appendix D. MUA Considerations (INFORMATIVE) . . . . . . . . . . 73 163 Appendix E. Changes since RFC4871 . . . . . . . . . . . . . . . . 74 164 Appendix F. Acknowledgements . . . . . . . . . . . . . . . . . . 76 165 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 76 167 1. Introduction 169 DomainKeys Identified Mail (DKIM) permits a person, role, or 170 organization to claim some responsibility for a message by 171 associating a domain name [RFC1034] with the message [RFC5322], which 172 they are authorized to use. This can be an author's organization, an 173 operational relay or one of their agents. Assertion of 174 responsibility is validated through a cryptographic signature and 175 querying the signer's domain directly to retrieve the appropriate 176 public key. Message transit from author to recipient is through 177 relays that typically make no substantive change to the message 178 content and thus preserve the DKIM signature. A message can contain 179 multiple signatures, from the same or different organizations 180 involved with the message. 182 The approach taken by DKIM differs from previous approaches to 183 message signing (e.g., Secure/Multipurpose Internet Mail Extensions 184 (S/MIME) [RFC5751], OpenPGP [RFC4880]) in that: 186 o the message signature is written as a message header field so that 187 neither human recipients nor existing MUA (Mail User Agent) 188 software is confused by signature-related content appearing in the 189 message body; 191 o there is no dependency on public and private key pairs being 192 issued by well-known, trusted certificate authorities; 194 o there is no dependency on the deployment of any new Internet 195 protocols or services for public key distribution or revocation; 197 o signature verification failure does not force rejection of the 198 message; 200 o no attempt is made to include encryption as part of the mechanism; 202 o message archiving is not a design goal. 204 DKIM: 206 o is compatible with the existing email infrastructure and 207 transparent to the fullest extent possible; 209 o requires minimal new infrastructure; 211 o can be implemented independently of clients in order to reduce 212 deployment time; 214 o can be deployed incrementally; 216 o allows delegation of signing to third parties. 218 1.1. DKIM Architecture Documents 220 Readers are advised to be familiar with the material in [RFC4686], 221 [RFC5585] and [RFC5863], which respectively provide the background 222 for the development of DKIM, an overview of the service, and 223 deployment and operations guidance and advice. 225 1.2. Signing Identity 227 DKIM separates the question of the identity of the signer of the 228 message from the purported author of the message. In particular, a 229 signature includes the identity of the signer. Verifiers can use the 230 signing information to decide how they want to process the message. 231 The signing identity is included as part of the signature header 232 field. 234 INFORMATIVE RATIONALE: The signing identity specified by a DKIM 235 signature is not required to match an address in any particular 236 header field because of the broad methods of interpretation by 237 recipient mail systems, including MUAs. 239 1.3. Scalability 241 DKIM is designed to support the extreme scalability requirements that 242 characterize the email identification problem. There are many 243 millions of domains and a much larger number of individual addresses. 244 DKIM seeks to preserve the positive aspects of the current email 245 infrastructure, such as the ability for anyone to communicate with 246 anyone else without introduction. 248 1.4. Simple Key Management 250 DKIM differs from traditional hierarchical public-key systems in that 251 no Certificate Authority infrastructure is required; the verifier 252 requests the public key from a repository in the domain of the 253 claimed signer directly rather than from a third party. 255 The DNS is proposed as the initial mechanism for the public keys. 256 Thus, DKIM currently depends on DNS administration and the security 257 of the DNS system. DKIM is designed to be extensible to other key 258 fetching services as they become available. 260 1.5. Data Integrity 262 A DKIM signature associates the d= name with the computed hash of 263 some or all of the message (see Section 3.7) in order to prevent the 264 re-use of the signature with different messages. Verifying the 265 signature asserts that the hashed content has not changed since it 266 was signed, and asserts nothing else about "protecting" the end-to- 267 end integrity of the message. 269 2. Terminology and Definitions 271 This section defines terms used in the rest of the document. 273 DKIM is designed to operate within the Internet Mail service, as 274 defined in [RFC5598]. Basic email terminology is taken from that 275 specification. 277 Syntax descriptions use Augmented BNF (ABNF) [RFC5234]. 279 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 280 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 281 "OPTIONAL" in this document are to be interpreted as described in 282 [RFC2119]. These words take their normative meanings only when they 283 are presented in ALL UPPER CASE. 285 2.1. Signers 287 Elements in the mail system that sign messages on behalf of a domain 288 are referred to as signers. These may be MUAs (Mail User Agents), 289 MSAs (Mail Submission Agents), MTAs (Mail Transfer Agents), or other 290 agents such as mailing list exploders. In general, any signer will 291 be involved in the injection of a message into the message system in 292 some way. The key issue is that a message must be signed before it 293 leaves the administrative domain of the signer. 295 2.2. Verifiers 297 Elements in the mail system that verify signatures are referred to as 298 verifiers. These may be MTAs, Mail Delivery Agents (MDAs), or MUAs. 299 In most cases it is expected that verifiers will be close to an end 300 user (reader) of the message or some consuming agent such as a 301 mailing list exploder. 303 2.3. Identity 305 A person, role, or organization. In the context of DKIM, examples 306 include the author, the author's organization, an ISP along the 307 handling path, an independent trust assessment service, and a mailing 308 list operator. 310 2.4. Identifier 312 A label that refers to an identity. 314 2.5. Signing Domain Identifier (SDID) 316 A single domain name that is the mandatory payload output of DKIM and 317 that refers to the identity claiming some responsibility for the 318 message by signing it. It is specified in Section 3.5. 320 2.6. Agent or User Identifier (AUID) 322 A single identifier that refers to the agent or user on behalf of 323 whom the Signing Domain Identifier (SDID) has taken responsibility. 324 The AUID comprises a domain name and an optional . The 325 domain name is the same as that used for the SDID or is a sub-domain 326 of it. For DKIM processing, the domain name portion of the AUID has 327 only basic domain name semantics; any possible owner-specific 328 semantics are outside the scope of DKIM. It is specified in 329 Section 3.5. 331 Note that acceptable values for the AUID may be constrained via a 332 flag in the public key record. (See Section 3.6.1.) 334 2.7. Identity Assessor 336 An element in the mail system that consumes DKIM's payload, which is 337 the responsible Signing Domain Identifier (SDID). The Identity 338 Assessor is dedicated to the assessment of the delivered identifier. 339 Other DKIM (and non-DKIM) values can also be used by the Identity 340 Assessor (if they are available) to provide a more general message 341 evaluation filtering engine. However, this additional activity is 342 outside the scope of the DKIM signature specification. 344 2.8. Whitespace 346 There are three forms of whitespace: 348 o WSP represents simple whitespace, i.e., a space or a tab character 349 (formal definition in [RFC5234]). 351 o LWSP is linear whitespace, defined as WSP plus CRLF (formal 352 definition in [RFC5234]). 354 o FWS is folding whitespace. It allows multiple lines separated by 355 CRLF followed by at least one whitespace, to be joined. 357 The formal ABNF for these are (WSP and LWSP are given for information 358 only): 359 WSP = SP / HTAB 360 LWSP = *(WSP / CRLF WSP) 361 FWS = [*WSP CRLF] 1*WSP 363 The definition of FWS is identical to that in [RFC5322] except for 364 the exclusion of obs-FWS. 366 2.9. Imported ABNF Tokens 368 The following tokens are imported from other RFCs as noted. Those 369 RFCs should be considered definitive. 371 The following tokens are imported from [RFC5321]: 373 o "Local-part" (implementation warning: this permits quoted strings) 375 o "sub-domain" 377 The following tokens are imported from [RFC5322]: 379 o "field-name" (name of a header field) 381 o "dot-atom-text" (in the Local-part of an email address) 383 The following tokens are imported from [RFC2045]: 385 o "qp-section" (a single line of quoted-printable-encoded text) 387 o "hex-octet" (a quoted-printable encoded octet) 389 INFORMATIVE NOTE: Be aware that the ABNF in [RFC2045] does not 390 obey the rules of [RFC5234] and must be interpreted accordingly, 391 particularly as regards case folding. 393 Other tokens not defined herein are imported from [RFC5234]. These 394 are intuitive primitives such as SP, HTAB, WSP, ALPHA, DIGIT, CRLF, 395 etc. 397 2.10. Common ABNF Tokens 398 The following ABNF tokens are used elsewhere in this document: 399 hyphenated-word = ALPHA [ *(ALPHA / DIGIT / "-") (ALPHA / DIGIT) ] 400 ALPHADIGITPS = (ALPHA / DIGIT / "+" / "/") 401 base64string = ALPHADIGITPS *([FWS] ALPHADIGITPS) 402 [ [FWS] "=" [ [FWS] "=" ] ] 403 hdr-name = field-name 404 qp-hdr-value = dkim-quoted-printable ; with "|" encoded 406 2.11. DKIM-Quoted-Printable 408 The DKIM-Quoted-Printable encoding syntax resembles that described in 409 Quoted-Printable [RFC2045], Section 6.7: any character MAY be encoded 410 as an "=" followed by two hexadecimal digits from the alphabet 411 "0123456789ABCDEF" (no lowercase characters permitted) representing 412 the hexadecimal-encoded integer value of that character. All control 413 characters (those with values < %x20), 8-bit characters (values > 414 %x7F), and the characters DEL (%x7F), SPACE (%x20), and semicolon 415 (";", %x3B) MUST be encoded. Note that all whitespace, including 416 SPACE, CR, and LF characters, MUST be encoded. After encoding, FWS 417 MAY be added at arbitrary locations in order to avoid excessively 418 long lines; such whitespace is NOT part of the value, and MUST be 419 removed before decoding. Use of characters not listed as "mail-safe" 420 in [RFC2049] is NOT RECOMMENDED. 422 ABNF: 424 dkim-quoted-printable = *(FWS / hex-octet / dkim-safe-char) 425 ; hex-octet is from RFC2045 426 dkim-safe-char = %x21-3A / %x3C / %x3E-7E 427 ; '!' - ':', '<', '>' - '~' 429 INFORMATIVE NOTE: DKIM-Quoted-Printable differs from Quoted- 430 Printable as defined in [RFC2045] in several important ways: 432 1. Whitespace in the input text, including CR and LF, must be 433 encoded. [RFC2045] does not require such encoding, and does 434 not permit encoding of CR or LF characters that are part of a 435 CRLF line break. 437 2. Whitespace in the encoded text is ignored. This is to allow 438 tags encoded using DKIM-Quoted-Printable to be wrapped as 439 needed. In particular, [RFC2045] requires that line breaks in 440 the input be represented as physical line breaks; that is not 441 the case here. 443 3. The "soft line break" syntax ("=" as the last non-whitespace 444 character on the line) does not apply. 446 4. DKIM-Quoted-Printable does not require that encoded lines be 447 no more than 76 characters long (although there may be other 448 requirements depending on the context in which the encoded 449 text is being used). 451 3. Protocol Elements 453 Protocol Elements are conceptual parts of the protocol that are not 454 specific to either signers or verifiers. The protocol descriptions 455 for signers and verifiers are described in later sections (Signer 456 Actions (Section 5) and Verifier Actions (Section 6)). NOTE: This 457 section must be read in the context of those sections. 459 3.1. Selectors 461 To support multiple concurrent public keys per signing domain, the 462 key namespace is subdivided using "selectors". For example, 463 selectors might indicate the names of office locations (e.g., 464 "sanfrancisco", "coolumbeach", and "reykjavik"), the signing date 465 (e.g., "january2005", "february2005", etc.), or even an individual 466 user. 468 Selectors are needed to support some important use cases. For 469 example: 471 o Domains that want to delegate signing capability for a specific 472 address for a given duration to a partner, such as an advertising 473 provider or other outsourced function. 475 o Domains that want to allow frequent travelers to send messages 476 locally without the need to connect with a particular MSA. 478 o "Affinity" domains (e.g., college alumni associations) that 479 provide forwarding of incoming mail, but that do not operate a 480 mail submission agent for outgoing mail. 482 Periods are allowed in selectors and are component separators. When 483 keys are retrieved from the DNS, periods in selectors define DNS 484 label boundaries in a manner similar to the conventional use in 485 domain names. Selector components might be used to combine dates 486 with locations, for example, "march2005.reykjavik". In a DNS 487 implementation, this can be used to allow delegation of a portion of 488 the selector namespace. 490 ABNF: 492 selector = sub-domain *( "." sub-domain ) 494 The number of public keys and corresponding selectors for each domain 495 is determined by the domain owner. Many domain owners will be 496 satisfied with just one selector, whereas administratively 497 distributed organizations can choose to manage disparate selectors 498 and key pairs in different regions or on different email servers. 500 Beyond administrative convenience, selectors make it possible to 501 seamlessly replace public keys on a routine basis. If a domain 502 wishes to change from using a public key associated with selector 503 "january2005" to a public key associated with selector 504 "february2005", it merely makes sure that both public keys are 505 advertised in the public-key repository concurrently for the 506 transition period during which email may be in transit prior to 507 verification. At the start of the transition period, the outbound 508 email servers are configured to sign with the "february2005" private 509 key. At the end of the transition period, the "january2005" public 510 key is removed from the public-key repository. 512 INFORMATIVE NOTE: A key may also be revoked as described below. 513 The distinction between revoking and removing a key selector 514 record is subtle. When phasing out keys as described above, a 515 signing domain would probably simply remove the key record after 516 the transition period. However, a signing domain could elect to 517 revoke the key (but maintain the key record) for a further period. 518 There is no defined semantic difference between a revoked key and 519 a removed key. 521 While some domains may wish to make selector values well known, 522 others will want to take care not to allocate selector names in a way 523 that allows harvesting of data by outside parties. For example, if 524 per-user keys are issued, the domain owner will need to make the 525 decision as to whether to associate this selector directly with the 526 name of a registered end-user, or make it some unassociated random 527 value, such as a fingerprint of the public key. 529 INFORMATIVE OPERATIONS NOTE: Reusing a selector with a new key 530 (for example, changing the key associated with a user's name) 531 makes it impossible to tell the difference between a message that 532 didn't verify because the key is no longer valid versus a message 533 that is actually forged. For this reason, signers are ill-advised 534 to reuse selectors for new keys. A better strategy is to assign 535 new keys to new selectors. 537 3.2. Tag=Value Lists 539 DKIM uses a simple "tag=value" syntax in several contexts, including 540 in messages and domain signature records. 542 Values are a series of strings containing either plain text, "base64" 543 text (as defined in [RFC2045], Section 6.8), "qp-section" (ibid, 544 Section 6.7), or "dkim-quoted-printable" (as defined in 545 Section 2.11). The name of the tag will determine the encoding of 546 each value. Unencoded semicolon (";") characters MUST NOT occur in 547 the tag value, since that separates tag-specs. 549 INFORMATIVE IMPLEMENTATION NOTE: Although the "plain text" defined 550 below (as "tag-value") only includes 7-bit characters, an 551 implementation that wished to anticipate future standards would be 552 advised not to preclude the use of UTF8-encoded ([RFC3629]) text 553 in tag=value lists. 555 Formally, the ABNF syntax rules are as follows: 556 tag-list = tag-spec *( ";" tag-spec ) [ ";" ] 557 tag-spec = [FWS] tag-name [FWS] "=" [FWS] tag-value [FWS] 558 tag-name = ALPHA *ALNUMPUNC 559 tag-value = [ tval *( 1*(WSP / FWS) tval ) ] 560 ; Prohibits WSP and FWS at beginning and end 561 tval = 1*VALCHAR 562 VALCHAR = %x21-3A / %x3C-7E 563 ; EXCLAMATION to TILDE except SEMICOLON 564 ALNUMPUNC = ALPHA / DIGIT / "_" 566 Note that WSP is allowed anywhere around tags. In particular, any 567 WSP after the "=" and any WSP before the terminating ";" is not part 568 of the value; however, WSP inside the value is significant. 570 Tags MUST be interpreted in a case-sensitive manner. Values MUST be 571 processed as case sensitive unless the specific tag description of 572 semantics specifies case insensitivity. 574 Tags with duplicate names MUST NOT occur within a single tag-list; if 575 a tag name does occur more than once, the entire tag-list is invalid. 577 Whitespace within a value MUST be retained unless explicitly excluded 578 by the specific tag description. 580 Tag=value pairs that represent the default value MAY be included to 581 aid legibility. 583 Unrecognized tags MUST be ignored. 585 Tags that have an empty value are not the same as omitted tags. An 586 omitted tag is treated as having the default value; a tag with an 587 empty value explicitly designates the empty string as the value. 589 3.3. Signing and Verification Algorithms 591 DKIM supports multiple digital signature algorithms. Two algorithms 592 are defined by this specification at this time: rsa-sha1 and rsa- 593 sha256. Signers MUST implement and SHOULD sign using rsa-sha256. 594 Verifiers MUST implement both rsa-sha1 and rsa-sha256. 596 INFORMATIVE NOTE: Although rsa-sha256 is strongly encouraged, some 597 senders might prefer to use rsa-sha1 when balancing security 598 strength against performance, complexity, or other needs. In 599 general, however, rsa-sha256 should always be used whenever 600 possible. 602 3.3.1. The rsa-sha1 Signing Algorithm 604 The rsa-sha1 Signing Algorithm computes a message hash as described 605 in Section 3.7 below using SHA-1 [FIPS-180-3-2008] as the hash-alg. 606 That hash is then signed by the signer using the RSA algorithm 607 (defined in PKCS#1 version 1.5 [RFC3447]) as the crypt-alg and the 608 signer's private key. The hash MUST NOT be truncated or converted 609 into any form other than the native binary form before being signed. 610 The signing algorithm SHOULD use a public exponent of 65537. 612 3.3.2. The rsa-sha256 Signing Algorithm 614 The rsa-sha256 Signing Algorithm computes a message hash as described 615 in Section 3.7 below using SHA-256 [FIPS-180-3-2008] as the hash-alg. 616 That hash is then signed by the signer using the RSA algorithm 617 (defined in PKCS#1 version 1.5 [RFC3447]) as the crypt-alg and the 618 signer's private key. The hash MUST NOT be truncated or converted 619 into any form other than the native binary form before being signed. 620 The signing algorithm SHOULD use a public exponent of 65537. 622 3.3.3. Key Sizes 624 Selecting appropriate key sizes is a trade-off between cost, 625 performance, and risk. Since short RSA keys more easily succumb to 626 off-line attacks, signers MUST use RSA keys of at least 1024 bits for 627 long-lived keys. Verifiers MUST be able to validate signatures with 628 keys ranging from 512 bits to 2048 bits, and they MAY be able to 629 validate signatures with larger keys. Verifier policies may use the 630 length of the signing key as one metric for determining whether a 631 signature is acceptable. 633 Factors that should influence the key size choice include the 634 following: 636 o The practical constraint that large (e.g., 4096 bit) keys might 637 not fit within a 512-byte DNS UDP response packet 639 o The security constraint that keys smaller than 1024 bits are 640 subject to off-line attacks 642 o Larger keys impose higher CPU costs to verify and sign email 644 o Keys can be replaced on a regular basis, thus their lifetime can 645 be relatively short 647 o The security goals of this specification are modest compared to 648 typical goals of other systems that employ digital signatures 650 See [RFC3766] for further discussion on selecting key sizes. 652 3.3.4. Other Algorithms 654 Other algorithms MAY be defined in the future. Verifiers MUST ignore 655 any signatures using algorithms that they do not implement. 657 3.4. Canonicalization 659 Some mail systems modify email in transit, potentially invalidating a 660 signature. For most signers, mild modification of email is 661 immaterial to validation of the DKIM domain name's use. For such 662 signers, a canonicalization algorithm that survives modest in-transit 663 modification is preferred. 665 Other signers demand that any modification of the email, however 666 minor, result in a signature verification failure. These signers 667 prefer a canonicalization algorithm that does not tolerate in-transit 668 modification of the signed email. 670 Some signers may be willing to accept modifications to header fields 671 that are within the bounds of email standards such as [RFC5322], but 672 are unwilling to accept any modification to the body of messages. 674 To satisfy all requirements, two canonicalization algorithms are 675 defined for each of the header and the body: a "simple" algorithm 676 that tolerates almost no modification and a "relaxed" algorithm that 677 tolerates common modifications such as whitespace replacement and 678 header field line rewrapping. A signer MAY specify either algorithm 679 for header or body when signing an email. If no canonicalization 680 algorithm is specified by the signer, the "simple" algorithm defaults 681 for both header and body. Verifiers MUST implement both 682 canonicalization algorithms. Note that the header and body may use 683 different canonicalization algorithms. Further canonicalization 684 algorithms MAY be defined in the future; verifiers MUST ignore any 685 signatures that use unrecognized canonicalization algorithms. 687 Canonicalization simply prepares the email for presentation to the 688 signing or verification algorithm. It MUST NOT change the 689 transmitted data in any way. Canonicalization of header fields and 690 body are described below. 692 NOTE: This section assumes that the message is already in "network 693 normal" format (text is ASCII encoded, lines are separated with CRLF 694 characters, etc.). See also Section 5.3 for information about 695 normalizing the message. 697 3.4.1. The "simple" Header Canonicalization Algorithm 699 The "simple" header canonicalization algorithm does not change header 700 fields in any way. Header fields MUST be presented to the signing or 701 verification algorithm exactly as they are in the message being 702 signed or verified. In particular, header field names MUST NOT be 703 case folded and whitespace MUST NOT be changed. 705 3.4.2. The "relaxed" Header Canonicalization Algorithm 707 The "relaxed" header canonicalization algorithm MUST apply the 708 following steps in order: 710 o Convert all header field names (not the header field values) to 711 lowercase. For example, convert "SUBJect: AbC" to "subject: AbC". 713 o Unfold all header field continuation lines as described in 714 [RFC5322]; in particular, lines with terminators embedded in 715 continued header field values (that is, CRLF sequences followed by 716 WSP) MUST be interpreted without the CRLF. Implementations MUST 717 NOT remove the CRLF at the end of the header field value. 719 o Convert all sequences of one or more WSP characters to a single SP 720 character. WSP characters here include those before and after a 721 line folding boundary. 723 o Delete all WSP characters at the end of each unfolded header field 724 value. 726 o Delete any WSP characters remaining before and after the colon 727 separating the header field name from the header field value. The 728 colon separator MUST be retained. 730 3.4.3. The "simple" Body Canonicalization Algorithm 732 The "simple" body canonicalization algorithm ignores all empty lines 733 at the end of the message body. An empty line is a line of zero 734 length after removal of the line terminator. If there is no body or 735 no trailing CRLF on the message body, a CRLF is added. It makes no 736 other changes to the message body. In more formal terms, the 737 "simple" body canonicalization algorithm converts "*CRLF" at the end 738 of the body to a single "CRLF". 740 Note that a completely empty or missing body is canonicalized as a 741 single "CRLF"; that is, the canonicalized length will be 2 octets. 743 The SHA-1 value (in base64) for an empty body (canonicalized to a 744 "CRLF") is: 745 uoq1oCgLlTqpdDX/iUbLy7J1Wic= 746 The SHA-256 value is: 747 frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN/XKdLCPjaYaY= 749 3.4.4. The "relaxed" Body Canonicalization Algorithm 751 The "relaxed" body canonicalization algorithm MUST apply the 752 following steps (a) and (b) in order: 754 a. Reduce whitespace: 756 * Ignore all whitespace at the end of lines. Implementations 757 MUST NOT remove the CRLF at the end of the line. 759 * Reduce all sequences of WSP within a line to a single SP 760 character. 762 b. Ignore all empty lines at the end of the message body. "Empty 763 line" is defined in Section 3.4.3. If the body is non-empty, but 764 does not end with a CRLF, a CRLF is added. (For email, this is 765 only possible when using extensions to SMTP or non-SMTP transport 766 mechanisms.) 768 The SHA-1 value (in base64) for an empty body (canonicalized to a 769 null input) is: 770 2jmj7l5rSw0yVb/vlWAYkK/YBwk= 771 The SHA-256 value is: 772 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= 774 3.4.5. Canonicalization Examples (INFORMATIVE) 776 In the following examples, actual whitespace is used only for 777 clarity. The actual input and output text is designated using 778 bracketed descriptors: "" for a space character, "" for a 779 tab character, and "" for a carriage-return/line-feed sequence. 780 For example, "X Y" and "XY" represent the same three 781 characters. 783 Example 1: A message reading: 784 A: X 785 B : Y 786 Z 787 788 C 789 D E 790 791 793 when canonicalized using relaxed canonicalization for both header and 794 body results in a header reading: 795 a:X 796 b:Y Z 798 and a body reading: 799 C 800 D E 802 Example 2: The same message canonicalized using simple 803 canonicalization for both header and body results in a header 804 reading: 805 A: X 806 B : Y 807 Z 809 and a body reading: 810 C 811 D E 813 Example 3: When processed using relaxed header canonicalization and 814 simple body canonicalization, the canonicalized version has a header 815 of: 816 a:X 817 b:Y Z 818 and a body reading: 819 C 820 D E 822 3.5. The DKIM-Signature Header Field 824 The signature of the email is stored in the DKIM-Signature header 825 field. This header field contains all of the signature and key- 826 fetching data. The DKIM-Signature value is a tag-list as described 827 in Section 3.2. 829 The DKIM-Signature header field SHOULD be treated as though it were a 830 trace header field as defined in Section 3.6 of [RFC5322], and hence 831 SHOULD NOT be reordered and SHOULD be prepended to the message. 833 The DKIM-Signature header field being created or verified is always 834 included in the signature calculation, after the rest of the header 835 fields being signed; however, when calculating or verifying the 836 signature, the value of the "b=" tag (signature value) of that DKIM- 837 Signature header field MUST be treated as though it were an empty 838 string. Unknown tags in the DKIM-Signature header field MUST be 839 included in the signature calculation but MUST be otherwise ignored 840 by verifiers. Other DKIM-Signature header fields that are included 841 in the signature should be treated as normal header fields; in 842 particular, the "b=" tag is not treated specially. 844 The encodings for each field type are listed below. Tags described 845 as qp-section are encoded as described in Section 6.7 of MIME Part 846 One [RFC2045], with the additional conversion of semicolon characters 847 to "=3B"; intuitively, this is one line of quoted-printable encoded 848 text. The dkim-quoted-printable syntax is defined in Section 2.11. 850 Tags on the DKIM-Signature header field along with their type and 851 requirement status are shown below. Unrecognized tags MUST be 852 ignored. 854 v= Version (plain-text; REQUIRED). This tag defines the version of 855 this specification that applies to the signature record. It MUST 856 have the value "1" for implementations compliant with this version 857 of DKIM. 859 ABNF: 861 sig-v-tag = %x76 [FWS] "=" [FWS] 1*DIGIT 862 INFORMATIVE NOTE: DKIM-Signature version numbers may increase 863 arithmetically as new versions of this specification are 864 released. 866 a= The algorithm used to generate the signature (plain-text; 867 REQUIRED). Verifiers MUST support "rsa-sha1" and "rsa-sha256"; 868 signers SHOULD sign using "rsa-sha256". See Section 3.3 for a 869 description of the algorithms. 871 ABNF: 873 sig-a-tag = %x61 [FWS] "=" [FWS] sig-a-tag-alg 874 sig-a-tag-alg = sig-a-tag-k "-" sig-a-tag-h 875 sig-a-tag-k = "rsa" / x-sig-a-tag-k 876 sig-a-tag-h = "sha1" / "sha256" / x-sig-a-tag-h 877 x-sig-a-tag-k = ALPHA *(ALPHA / DIGIT) 878 ; for later extension 879 x-sig-a-tag-h = ALPHA *(ALPHA / DIGIT) 880 ; for later extension 882 b= The signature data (base64; REQUIRED). Whitespace is ignored in 883 this value and MUST be ignored when reassembling the original 884 signature. In particular, the signing process can safely insert 885 FWS in this value in arbitrary places to conform to line-length 886 limits. See Signer Actions (Section 5) for how the signature is 887 computed. 889 ABNF: 891 sig-b-tag = %x62 [FWS] "=" [FWS] sig-b-tag-data 892 sig-b-tag-data = base64string 894 bh= The hash of the canonicalized body part of the message as 895 limited by the "l=" tag (base64; REQUIRED). Whitespace is ignored 896 in this value and MUST be ignored when reassembling the original 897 signature. In particular, the signing process can safely insert 898 FWS in this value in arbitrary places to conform to line-length 899 limits. See Section 3.7 for how the body hash is computed. 901 ABNF: 903 sig-bh-tag = %x62 %x68 [FWS] "=" [FWS] sig-bh-tag-data 904 sig-bh-tag-data = base64string 906 c= Message canonicalization (plain-text; OPTIONAL, default is 907 "simple/simple"). This tag informs the verifier of the type of 908 canonicalization used to prepare the message for signing. It 909 consists of two names separated by a "slash" (%d47) character, 910 corresponding to the header and body canonicalization algorithms 911 respectively. These algorithms are described in Section 3.4. If 912 only one algorithm is named, that algorithm is used for the header 913 and "simple" is used for the body. For example, "c=relaxed" is 914 treated the same as "c=relaxed/simple". 916 ABNF: 918 sig-c-tag = %x63 [FWS] "=" [FWS] sig-c-tag-alg 919 ["/" sig-c-tag-alg] 920 sig-c-tag-alg = "simple" / "relaxed" / x-sig-c-tag-alg 921 x-sig-c-tag-alg = hyphenated-word ; for later extension 923 d= The SDID claiming responsibility for an introduction of a message 924 into the mail stream (plain-text; REQUIRED). Hence, the SDID 925 value is used to form the query for the public key. The SDID MUST 926 correspond to a valid DNS name under which the DKIM key record is 927 published. The conventions and semantics used by a signer to 928 create and use a specific SDID are outside the scope of the DKIM 929 Signing specification, as is any use of those conventions and 930 semantics. When presented with a signature that does not meet 931 these requirements, verifiers MUST consider the signature invalid. 933 Internationalized domain names MUST be encoded as A-Labels, as 934 described in Section 2.3 of [RFC5890]. 936 ABNF: 938 sig-d-tag = %x64 [FWS] "=" [FWS] domain-name 939 domain-name = sub-domain 1*("." sub-domain) 940 ; from RFC5321 Domain, excluding address-literal 942 h= Signed header fields (plain-text, but see description; REQUIRED). 943 A colon-separated list of header field names that identify the 944 header fields presented to the signing algorithm. The field MUST 945 contain the complete list of header fields in the order presented 946 to the signing algorithm. The field MAY contain names of header 947 fields that do not exist when signed; nonexistent header fields do 948 not contribute to the signature computation (that is, they are 949 treated as the null input, including the header field name, the 950 separating colon, the header field value, and any CRLF 951 terminator). The field MAY contain multiple instances of a header 952 field name, meaning multiple occurrences of the corresponding 953 header field are included in the header hash. The field MUST NOT 954 include the DKIM-Signature header field that is being created or 955 verified, but may include others. Folding whitespace (FWS) MAY be 956 included on either side of the colon separator. Header field 957 names MUST be compared against actual header field names in a 958 case-insensitive manner. This list MUST NOT be empty. See 959 Section 5.4 for a discussion of choosing header fields to sign, 960 and Section 5.4.2 for requirements when signing multiple instances 961 of a single field. 963 ABNF: 965 sig-h-tag = %x68 [FWS] "=" [FWS] hdr-name 966 *( [FWS] ":" [FWS] hdr-name ) 968 INFORMATIVE EXPLANATION: By "signing" header fields that do not 969 actually exist, a signer can allow a verifier to detect 970 insertion of those header fields after signing. However, since 971 a signer cannot possibly know what header fields might be 972 defined in the future, this mechanism can't be used to prevent 973 the addition of any possible unknown header fields. 975 INFORMATIVE NOTE: "Signing" fields that are not present at the 976 time of signing not only prevents fields and values from being 977 added, but also prevents adding fields with no values. 979 i= The Agent or User Identifier (AUID) on behalf of which the SDID is 980 taking responsibility (dkim-quoted-printable; OPTIONAL, default is 981 an empty Local-part followed by an "@" followed by the domain from 982 the "d=" tag). 984 The syntax is a standard email address where the Local-part MAY be 985 omitted. The domain part of the address MUST be the same as, or a 986 subdomain of, the value of the "d=" tag. 988 Internationalized domain names MUST be encoded as A-Labels, as 989 described in Section 2.3 of [RFC5890]. 991 ABNF: 993 sig-i-tag = %x69 [FWS] "=" [FWS] [ Local-part ] 994 "@" domain-name 996 The AUID is specified as having the same syntax as an email 997 address, but need not have the same semantics. Notably, the 998 domain name need not be registered in the DNS -- so it might not 999 resolve in a query -- and the Local-part MAY be drawn from a 1000 namespace unrelated to any mailbox. The details of the structure 1001 and semantics for the namespace are determined by the Signer. Any 1002 knowledge or use of those details by verifiers or assessors is 1003 outside the scope of the DKIM Signing specification. The Signer 1004 MAY choose to use the same namespace for its AUIDs as its users' 1005 email addresses or MAY choose other means of representing its 1006 users. However, the signer SHOULD use the same AUID for each 1007 message intended to be evaluated as being within the same sphere 1008 of responsibility, if it wishes to offer receivers the option of 1009 using the AUID as a stable identifier that is finer grained than 1010 the SDID. 1012 INFORMATIVE NOTE: The Local-part of the "i=" tag is optional 1013 because in some cases a signer may not be able to establish a 1014 verified individual identity. In such cases, the signer might 1015 wish to assert that although it is willing to go as far as 1016 signing for the domain, it is unable or unwilling to commit to 1017 an individual user name within their domain. It can do so by 1018 including the domain part but not the Local-part of the 1019 identity. 1021 INFORMATIVE DISCUSSION: This specification does not require the 1022 value of the "i=" tag to match the identity in any message 1023 header fields. This is considered to be a verifier policy 1024 issue. Constraints between the value of the "i=" tag and other 1025 identities in other header fields seek to apply basic 1026 authentication into the semantics of trust associated with a 1027 role such as content author. Trust is a broad and complex 1028 topic and trust mechanisms are subject to highly creative 1029 attacks. The real-world efficacy of any but the most basic 1030 bindings between the "i=" value and other identities is not 1031 well established, nor is its vulnerability to subversion by an 1032 attacker. Hence reliance on the use of these options should be 1033 strictly limited. In particular, it is not at all clear to 1034 what extent a typical end-user recipient can rely on any 1035 assurances that might be made by successful use of the "i=" 1036 options. 1038 l= Body length count (plain-text unsigned decimal integer; OPTIONAL, 1039 default is entire body). This tag informs the verifier of the 1040 number of octets in the body of the email after canonicalization 1041 included in the cryptographic hash, starting from 0 immediately 1042 following the CRLF preceding the body. This value MUST NOT be 1043 larger than the actual number of octets in the canonicalized 1044 message body. See further discussion in Section 8.2. 1046 INFORMATIVE NOTE: The value of the "l=" tag is constrained to 1047 76 decimal digits. This constraint is not intended to predict 1048 the size of future messages or to require implementations to 1049 use an integer representation large enough to represent the 1050 maximum possible value, but is intended to remind the 1051 implementer to check the length of this and all other tags 1052 during verification and to test for integer overflow when 1053 decoding the value. Implementers may need to limit the actual 1054 value expressed to a value smaller than 10^76, e.g., to allow a 1055 message to fit within the available storage space. 1057 ABNF: 1059 sig-l-tag = %x6c [FWS] "=" [FWS] 1060 1*76DIGIT 1062 q= A colon-separated list of query methods used to retrieve the 1063 public key (plain-text; OPTIONAL, default is "dns/txt"). Each 1064 query method is of the form "type[/options]", where the syntax and 1065 semantics of the options depend on the type and specified options. 1066 If there are multiple query mechanisms listed, the choice of query 1067 mechanism MUST NOT change the interpretation of the signature. 1068 Implementations MUST use the recognized query mechanisms in the 1069 order presented. Unrecognized query mechanisms MUST be ignored. 1071 Currently, the only valid value is "dns/txt", which defines the 1072 DNS TXT resource record (RR) lookup algorithm described elsewhere 1073 in this document. The only option defined for the "dns" query 1074 type is "txt", which MUST be included. Verifiers and signers MUST 1075 support "dns/txt". 1077 ABNF: 1079 sig-q-tag = %x71 [FWS] "=" [FWS] sig-q-tag-method 1080 *([FWS] ":" [FWS] sig-q-tag-method) 1081 sig-q-tag-method = "dns/txt" / x-sig-q-tag-type 1082 ["/" x-sig-q-tag-args] 1083 x-sig-q-tag-type = hyphenated-word ; for future extension 1084 x-sig-q-tag-args = qp-hdr-value 1086 s= The selector subdividing the namespace for the "d=" (domain) tag 1087 (plain-text; REQUIRED). 1089 Internationalized selector names MUST be encoded as A-Labels, as 1090 described in Section 2.3 of [RFC5890]. 1092 ABNF: 1094 sig-s-tag = %x73 [FWS] "=" [FWS] selector 1096 t= Signature Timestamp (plain-text unsigned decimal integer; 1097 RECOMMENDED, default is an unknown creation time). The time that 1098 this signature was created. The format is the number of seconds 1099 since 00:00:00 on January 1, 1970 in the UTC time zone. The value 1100 is expressed as an unsigned integer in decimal ASCII. This value 1101 is not constrained to fit into a 31- or 32-bit integer. 1103 Implementations SHOULD be prepared to handle values up to at least 1104 10^12 (until approximately AD 200,000; this fits into 40 bits). 1105 To avoid denial-of-service attacks, implementations MAY consider 1106 any value longer than 12 digits to be infinite. Leap seconds are 1107 not counted. Implementations MAY ignore signatures that have a 1108 timestamp in the future. 1110 ABNF: 1112 sig-t-tag = %x74 [FWS] "=" [FWS] 1*12DIGIT 1114 x= Signature Expiration (plain-text unsigned decimal integer; 1115 RECOMMENDED, default is no expiration). The format is the same as 1116 in the "t=" tag, represented as an absolute date, not as a time 1117 delta from the signing timestamp. The value is expressed as an 1118 unsigned integer in decimal ASCII, with the same constraints on 1119 the value in the "t=" tag. Signatures MAY be considered invalid 1120 if the verification time at the verifier is past the expiration 1121 date. The verification time should be the time that the message 1122 was first received at the administrative domain of the verifier if 1123 that time is reliably available; otherwise the current time should 1124 be used. The value of the "x=" tag MUST be greater than the value 1125 of the "t=" tag if both are present. 1127 INFORMATIVE NOTE: The "x=" tag is not intended as an anti- 1128 replay defense. 1130 INFORMATIVE NOTE: Due to clock drift, the receiver's notion of 1131 when to consider the signature expired may not match exactly 1132 when the sender is expecting. Receivers MAY add a 'fudge 1133 factor' to allow for such possible drift. 1135 ABNF: 1137 sig-x-tag = %x78 [FWS] "=" [FWS] 1138 1*12DIGIT 1140 z= Copied header fields (dkim-quoted-printable, but see description; 1141 OPTIONAL, default is null). A vertical-bar-separated list of 1142 selected header fields present when the message was signed, 1143 including both the field name and value. It is not required to 1144 include all header fields present at the time of signing. This 1145 field need not contain the same header fields listed in the "h=" 1146 tag. The header field text itself must encode the vertical bar 1147 ("|", %x7C) character (i.e., vertical bars in the "z=" text are 1148 meta-characters, and any actual vertical bar characters in a 1149 copied header field must be encoded). Note that all whitespace 1150 must be encoded, including whitespace between the colon and the 1151 header field value. After encoding, FWS MAY be added at arbitrary 1152 locations in order to avoid excessively long lines; such 1153 whitespace is NOT part of the value of the header field, and MUST 1154 be removed before decoding. 1156 The header fields referenced by the "h=" tag refer to the fields 1157 in the [RFC5322] header of the message, not to any copied fields 1158 in the "z=" tag. Copied header field values are for diagnostic 1159 use. 1161 ABNF: 1163 sig-z-tag = %x7A [FWS] "=" [FWS] sig-z-tag-copy 1164 *( "|" [FWS] sig-z-tag-copy ) 1165 sig-z-tag-copy = hdr-name [FWS] ":" qp-hdr-value 1167 INFORMATIVE EXAMPLE of a signature header field spread across 1168 multiple continuation lines: 1169 DKIM-Signature: v=1; a=rsa-sha256; d=example.net; s=brisbane; 1170 c=simple; q=dns/txt; i=@eng.example.net; 1171 t=1117574938; x=1118006938; 1172 h=from:to:subject:date; 1173 z=From:foo@eng.example.net|To:joe@example.com| 1174 Subject:demo=20run|Date:July=205,=202005=203:44:08=20PM=20-0700; 1175 bh=MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=; 1176 b=dzdVyOfAKCdLXdJOc9G2q8LoXSlEniSbav+yuU4zGeeruD00lszZVoG4ZHRNiYzR 1178 3.6. Key Management and Representation 1180 Signature applications require some level of assurance that the 1181 verification public key is associated with the claimed signer. Many 1182 applications achieve this by using public key certificates issued by 1183 a trusted third party. However, DKIM can achieve a sufficient level 1184 of security, with significantly enhanced scalability, by simply 1185 having the verifier query the purported signer's DNS entry (or some 1186 security-equivalent) in order to retrieve the public key. 1188 DKIM keys can potentially be stored in multiple types of key servers 1189 and in multiple formats. The storage and format of keys are 1190 irrelevant to the remainder of the DKIM algorithm. 1192 Parameters to the key lookup algorithm are the type of the lookup 1193 (the "q=" tag), the domain of the signer (the "d=" tag of the DKIM- 1194 Signature header field), and the selector (the "s=" tag). 1196 public_key = dkim_find_key(q_val, d_val, s_val) 1198 This document defines a single binding, using DNS TXT RRs to 1199 distribute the keys. Other bindings may be defined in the future. 1201 3.6.1. Textual Representation 1203 It is expected that many key servers will choose to present the keys 1204 in an otherwise unstructured text format (for example, an XML form 1205 would not be considered to be unstructured text for this purpose). 1206 The following definition MUST be used for any DKIM key represented in 1207 an otherwise unstructured textual form. 1209 The overall syntax is a tag-list as described in Section 3.2. The 1210 current valid tags are described below. Other tags MAY be present 1211 and MUST be ignored by any implementation that does not understand 1212 them. 1214 v= Version of the DKIM key record (plain-text; RECOMMENDED, default 1215 is "DKIM1"). If specified, this tag MUST be set to "DKIM1" 1216 (without the quotes). This tag MUST be the first tag in the 1217 record. Records beginning with a "v=" tag with any other value 1218 MUST be discarded. Note that verifiers must do a string 1219 comparison on this value; for example, "DKIM1" is not the same as 1220 "DKIM1.0". 1222 ABNF: 1223 key-v-tag = %x76 [FWS] "=" [FWS] %x44.4B.49.4D.31 1224 h= Acceptable hash algorithms (plain-text; OPTIONAL, defaults to 1225 allowing all algorithms). A colon-separated list of hash 1226 algorithms that might be used. Unrecognized algorithms MUST be 1227 ignored. Refer to Section 3.3 for a discussion of the hash 1228 algorithms implemented by Signers and Verifiers. The set of 1229 algorithms listed in this tag in each record is an operational 1230 choice made by the Signer. 1232 ABNF: 1234 key-h-tag = %x68 [FWS] "=" [FWS] key-h-tag-alg 1235 *( [FWS] ":" [FWS] key-h-tag-alg ) 1236 key-h-tag-alg = "sha1" / "sha256" / x-key-h-tag-alg 1237 x-key-h-tag-alg = hyphenated-word ; for future extension 1239 k= Key type (plain-text; OPTIONAL, default is "rsa"). Signers and 1240 verifiers MUST support the "rsa" key type. The "rsa" key type 1241 indicates that an ASN.1 DER-encoded [ITU-X660-1997] RSAPublicKey 1242 [RFC3447] (see Sections Section 3.1 and A.1.1) is being used in 1243 the "p=" tag. (Note: the "p=" tag further encodes the value using 1244 the base64 algorithm.) Unrecognized key types MUST be ignored. 1246 ABNF: 1248 key-k-tag = %x76 [FWS] "=" [FWS] key-k-tag-type 1249 key-k-tag-type = "rsa" / x-key-k-tag-type 1250 x-key-k-tag-type = hyphenated-word ; for future extension 1252 n= Notes that might be of interest to a human (qp-section; OPTIONAL, 1253 default is empty). No interpretation is made by any program. 1254 This tag should be used sparingly in any key server mechanism that 1255 has space limitations (notably DNS). This is intended for use by 1256 administrators, not end users. 1258 ABNF: 1260 key-n-tag = %x6e [FWS] "=" [FWS] qp-section 1262 p= Public-key data (base64; REQUIRED). An empty value means that 1263 this public key has been revoked. The syntax and semantics of 1264 this tag value before being encoded in base64 are defined by the 1265 "k=" tag. 1267 INFORMATIVE RATIONALE: If a private key has been compromised or 1268 otherwise disabled (e.g., an outsourcing contract has been 1269 terminated), a signer might want to explicitly state that it 1270 knows about the selector, but all messages using that selector 1271 should fail verification. Verifiers SHOULD return an error 1272 code for any DKIM-Signature header field with a selector 1273 referencing a revoked key. (See Section 6.1.2 for details.) 1275 ABNF: 1277 key-p-tag = %x70 [FWS] "=" [ [FWS] base64string] 1279 INFORMATIVE NOTE: A base64string is permitted to include white 1280 space (FWS) at arbitrary places; however, any CRLFs must be 1281 followed by at least one WSP character. Implementors and 1282 administrators are cautioned to ensure that selector TXT RRs 1283 conform to this specification. 1285 s= Service Type (plain-text; OPTIONAL; default is "*"). A colon- 1286 separated list of service types to which this record applies. 1287 Verifiers for a given service type MUST ignore this record if the 1288 appropriate type is not listed. Unrecognized service types MUST 1289 be ignored. Currently defined service types are as follows: 1291 * matches all service types 1293 email electronic mail (not necessarily limited to SMTP) 1295 This tag is intended to constrain the use of keys for other 1296 purposes, should use of DKIM be defined by other services in the 1297 future. 1299 ABNF: 1301 key-s-tag = %x73 [FWS] "=" [FWS] key-s-tag-type 1302 *( [FWS] ":" [FWS] key-s-tag-type ) 1303 key-s-tag-type = "email" / "*" / x-key-s-tag-type 1304 x-key-s-tag-type = hyphenated-word ; for future extension 1306 t= Flags, represented as a colon-separated list of names (plain- 1307 text; OPTIONAL, default is no flags set). Unrecognized flags MUST 1308 be ignored. The defined flags are as follows: 1310 y This domain is testing DKIM. Verifiers MUST NOT treat messages 1311 from signers in testing mode differently from unsigned email, even 1312 should the signature fail to verify. Verifiers MAY wish to track 1313 testing mode results to assist the signer. 1315 s Any DKIM-Signature header fields using the "i=" tag MUST have the 1316 same domain value on the right-hand side of the "@" in the "i=" 1317 tag and the value of the "d=" tag. That is, the "i=" domain MUST 1318 NOT be a subdomain of "d=". Use of this flag is RECOMMENDED 1319 unless subdomaining is required. 1321 ABNF: 1323 key-t-tag = %x74 [FWS] "=" [FWS] key-t-tag-flag 1324 *( [FWS] ":" [FWS] key-t-tag-flag ) 1325 key-t-tag-flag = "y" / "s" / x-key-t-tag-flag 1326 x-key-t-tag-flag = hyphenated-word ; for future extension 1328 3.6.2. DNS Binding 1330 A binding using DNS TXT RRs as a key service is hereby defined. All 1331 implementations MUST support this binding. 1333 3.6.2.1. Namespace 1335 All DKIM keys are stored in a subdomain named "_domainkey". Given a 1336 DKIM-Signature field with a "d=" tag of "example.com" and an "s=" tag 1337 of "foo.bar", the DNS query will be for 1338 "foo.bar._domainkey.example.com". 1340 3.6.2.2. Resource Record Types for Key Storage 1342 The DNS Resource Record type used is specified by an option to the 1343 query-type ("q=") tag. The only option defined in this base 1344 specification is "txt", indicating the use of a TXT RR. A later 1345 extension of this standard may define another RR type. 1347 Strings in a TXT RR MUST be concatenated together before use with no 1348 intervening whitespace. TXT RRs MUST be unique for a particular 1349 selector name; that is, if there are multiple records in an RRset, 1350 the results are undefined. 1352 TXT RRs are encoded as described in Section 3.6.1. 1354 3.7. Computing the Message Hashes 1356 Both signing and verifying message signatures start with a step of 1357 computing two cryptographic hashes over the message. Signers will 1358 choose the parameters of the signature as described in Signer Actions 1359 (Section 5); verifiers will use the parameters specified in the DKIM- 1360 Signature header field being verified. In the following discussion, 1361 the names of the tags in the DKIM-Signature header field that either 1362 exists (when verifying) or will be created (when signing) are used. 1363 Note that canonicalization (Section 3.4) is only used to prepare the 1364 email for signing or verifying; it does not affect the transmitted 1365 email in any way. 1367 The signer/verifier MUST compute two hashes, one over the body of the 1368 message and one over the selected header fields of the message. 1370 Signers MUST compute them in the order shown. Verifiers MAY compute 1371 them in any order convenient to the verifier, provided that the 1372 result is semantically identical to the semantics that would be the 1373 case had they been computed in this order. 1375 In hash step 1, the signer/verifier MUST hash the message body, 1376 canonicalized using the body canonicalization algorithm specified in 1377 the "c=" tag and then truncated to the length specified in the "l=" 1378 tag. That hash value is then converted to base64 form and inserted 1379 into (signers) or compared to (verifiers) the "bh=" tag of the DKIM- 1380 Signature header field. 1382 In hash step 2, the signer/verifier MUST pass the following to the 1383 hash algorithm in the indicated order. 1385 1. The header fields specified by the "h=" tag, in the order 1386 specified in that tag, and canonicalized using the header 1387 canonicalization algorithm specified in the "c=" tag. Each 1388 header field MUST be terminated with a single CRLF. 1390 2. The DKIM-Signature header field that exists (verifying) or will 1391 be inserted (signing) in the message, with the value of the "b=" 1392 tag (including all surrounding whitespace) deleted (i.e., treated 1393 as the empty string), canonicalized using the header 1394 canonicalization algorithm specified in the "c=" tag, and without 1395 a trailing CRLF. 1397 All tags and their values in the DKIM-Signature header field are 1398 included in the cryptographic hash with the sole exception of the 1399 value portion of the "b=" (signature) tag, which MUST be treated as 1400 the null string. All tags MUST be included even if they might not be 1401 understood by the verifier. The header field MUST be presented to 1402 the hash algorithm after the body of the message rather than with the 1403 rest of the header fields and MUST be canonicalized as specified in 1404 the "c=" (canonicalization) tag. The DKIM-Signature header field 1405 MUST NOT be included in its own h= tag, although other DKIM-Signature 1406 header fields MAY be signed (see Section 4). 1408 When calculating the hash on messages that will be transmitted using 1409 base64 or quoted-printable encoding, signers MUST compute the hash 1410 after the encoding. Likewise, the verifier MUST incorporate the 1411 values into the hash before decoding the base64 or quoted-printable 1412 text. However, the hash MUST be computed before transport level 1413 encodings such as SMTP "dot-stuffing" (the modification of lines 1414 beginning with a "." to avoid confusion with the SMTP end-of-message 1415 marker, as specified in [RFC5321]). 1417 With the exception of the canonicalization procedure described in 1418 Section 3.4, the DKIM signing process treats the body of messages as 1419 simply a string of octets. DKIM messages MAY be either in plain-text 1420 or in MIME format; no special treatment is afforded to MIME content. 1421 Message attachments in MIME format MUST be included in the content 1422 that is signed. 1424 More formally, pseudo-code for the signature algorithm is: 1425 body-hash = hash-alg (canon-body, l-param) 1426 data-hash = hash-alg (h-headers, D-SIG, body-hash) 1427 signature = sig-alg (d-domain, selector, data-hash) 1429 where: 1431 body-hash: is the output from hashing the body, using hash-alg. 1433 hash-alg: is the hashing algorithm specified in the "a" 1434 parameter. 1436 canon-body: is a canonicalized representation of the body, 1437 produced by using the body algorithm specified in the "c" 1438 parameter, as defined in Section 3.4 and excluding the 1439 DKIM-Signature field. 1441 l-param: is the length-of-body value of the "l" parameter. 1443 data-hash: is the output from using the hash-alg algorithm, to 1444 hash the header including the DKIM-Signature header, and the 1445 body hash. 1447 h-headers: is the list of headers to be signed, as specified in 1448 the "h" parameter. 1450 D-SIG: is the canonicalized DKIM-Signature field without the 1451 signature value portion of the parameter, itself; that is, an 1452 empty parameter value. 1454 signature: is the signature value produced by the signing 1455 algorithm. 1457 sig-alg: is the signature algorithm specified by the "a" 1458 parameter. 1460 d-domain: is the domain name specified in the "d" parameter. 1462 selector: is the selector value specified in the "s" parameter. 1464 NOTE: Many digital signature APIs provide both hashing and 1465 application of the RSA private key using a single "sign()" 1466 primitive. When using such an API, the last two steps in the 1467 algorithm would probably be combined into a single call that would 1468 perform both the "a-hash-alg" and the "sig-alg". 1470 3.8. Input Requirements 1472 A message that is not compliant with RFC5322, RFC2045 and RFC2047 can 1473 be subject to attempts by intermediaries to correct or interpret such 1474 content. See Section 8 of [RFC4409] for examples of changes that are 1475 commonly made. Such "corrections" may invalidate DKIM signatures or 1476 have other undesirable effects, including some that involve changes 1477 to the way a message is presented to an end user. 1479 Accordingly, DKIM's design is predicated on valid input. Therefore, 1480 signers and verifiers SHOULD take reasonable steps to ensure that the 1481 messages they are processing are valid according to [RFC5322], 1482 [RFC2045], and any other relevant message format standards. 1484 See Section 8.15 for additional discussion. 1486 3.9. Output Requirements 1488 The evaluation of each signature ends in one of three states, which 1489 this document refers to as follows: 1491 SUCCESS: a successful verification 1493 PERMFAIL: a permanent, non-recoverable error such as a signature 1494 verification failure 1496 TEMPFAIL: a temporary, recoverable error such as a DNS query timeout 1498 For each signature that verifies successfully or produces a TEMPFAIL 1499 result, output of the DKIM algorithm MUST include the set of: 1501 o The domain name, taken from the "d=" signature tag; and 1503 o The result of the verification attempt for that signature. 1505 The output MAY include other signature properties or result meta- 1506 data, including PERMFAILed or otherwise ignored signatures, for use 1507 by modules that consume those results. 1509 See Section 6.1 for discussion of signature validation result codes. 1511 3.10. Signing by Parent Domains 1513 In some circumstances, it is desirable for a domain to apply a 1514 signature on behalf of any of its subdomains without the need to 1515 maintain separate selectors (key records) in each subdomain. By 1516 default, private keys corresponding to key records can be used to 1517 sign messages for any subdomain of the domain in which they reside; 1518 for example, a key record for the domain example.com can be used to 1519 verify messages where the AUID ("i=" tag of the signature) is 1520 sub.example.com, or even sub1.sub2.example.com. In order to limit 1521 the capability of such keys when this is not intended, the "s" flag 1522 MAY be set in the "t=" tag of the key record, to constrain the 1523 validity of the domain of the AUID. If the referenced key record 1524 contains the "s" flag as part of the "t=" tag, the domain of the AUID 1525 ("i=" flag) MUST be the same as that of the SDID (d=) domain. If 1526 this flag is absent, the domain of the AUID MUST be the same as, or a 1527 subdomain of, the SDID. 1529 3.11. Relationship between SDID and AUID 1531 DKIM's primary task is to communicate from the Signer to a recipient- 1532 side Identity Assessor a single Signing Domain Identifier (SDID) that 1533 refers to a responsible identity. DKIM MAY optionally provide a 1534 single responsible Agent or User Identifier (AUID). 1536 Hence, DKIM's mandatory output to a receive-side Identity Assessor is 1537 a single domain name. Within the scope of its use as DKIM output, 1538 the name has only basic domain name semantics; any possible owner- 1539 specific semantics are outside the scope of DKIM. That is, within 1540 its role as a DKIM identifier, additional semantics cannot be assumed 1541 by an Identity Assessor. 1543 Upon successfully verifying the signature, a receive-side DKIM 1544 verifier MUST communicate the Signing Domain Identifier (d=) to a 1545 consuming Identity Assessor module and MAY communicate the Agent or 1546 User Identifier (i=) if present. 1548 To the extent that a receiver attempts to intuit any structured 1549 semantics for either of the identifiers, this is a heuristic function 1550 that is outside the scope of DKIM's specification and semantics. 1551 Hence, it is relegated to a higher-level service, such as a delivery 1552 handling filter that integrates a variety of inputs and performs 1553 heuristic analysis of them. 1555 INFORMATIVE DISCUSSION: This document does not require the value 1556 of the SDID or AUID to match an identifier in any other message 1557 header field. This requirement is, instead, an assessor policy 1558 issue. The purpose of such a linkage would be to authenticate the 1559 value in that other header field. This, in turn, is the basis for 1560 applying a trust assessment based on the identifier value. Trust 1561 is a broad and complex topic and trust mechanisms are subject to 1562 highly creative attacks. The real-world efficacy of any but the 1563 most basic bindings between the SDID or AUID and other identities 1564 is not well established, nor is its vulnerability to subversion by 1565 an attacker. Hence, reliance on the use of such bindings should 1566 be strictly limited. In particular, it is not at all clear to 1567 what extent a typical end-user recipient can rely on any 1568 assurances that might be made by successful use of the SDID or 1569 AUID. 1571 4. Semantics of Multiple Signatures 1573 4.1. Example Scenarios 1575 There are many reasons why a message might have multiple signatures. 1576 For example, suppose SHA-256 is in the future found to be 1577 insufficiently strong, and DKIM usage transitions to SHA-1024. A 1578 signer might immediately sign using the newer algorithm, but also 1579 continue to sign using the older algorithm for interoperability with 1580 verifiers that had not yet upgraded. The signer would do this by 1581 adding two DKIM-Signature header fields, one using each algorithm. 1582 Older verifiers that did not recognize SHA-1024 as an acceptable 1583 algorithm would skip that signature and use the older algorithm; 1584 newer verifiers could use either signature at their option, and all 1585 other things being equal might not even attempt to verify the other 1586 signature. 1588 Similarly, a signer might sign a message including all header fields 1589 and no "l=" tag (to satisfy strict verifiers) and a second time with 1590 a limited set of header fields and an "l=" tag (in anticipation of 1591 possible message modifications en route to other verifiers). 1592 Verifiers could then choose which signature they preferred. 1594 Of course, a message might also have multiple signatures because it 1595 passed through multiple signers. A common case is expected to be 1596 that of a signed message that passes through a mailing list that also 1597 signs all messages. Assuming both of those signatures verify, a 1598 recipient might choose to accept the message if either of those 1599 signatures were known to come from trusted sources. 1601 In particular, recipients might choose to whitelist mailing lists to 1602 which they have subscribed and that have acceptable anti-abuse 1603 policies so as to accept messages sent to that list even from unknown 1604 authors. They might also subscribe to less trusted mailing lists 1605 (e.g., those without anti-abuse protection) and be willing to accept 1606 all messages from specific authors, but insist on doing additional 1607 abuse scanning for other messages. 1609 Another related example of multiple signers might be forwarding 1610 services, such as those commonly associated with academic alumni 1611 sites. For example, a recipient might have an address at 1612 members.example.org, a site that has anti-abuse protection that is 1613 somewhat less effective than the recipient would prefer. Such a 1614 recipient might have specific authors whose messages would be trusted 1615 absolutely, but messages from unknown authors that had passed the 1616 forwarder's scrutiny would have only medium trust. 1618 4.2. Interpretation 1620 A signer that is adding a signature to a message merely creates a new 1621 DKIM-Signature header, using the usual semantics of the h= option. A 1622 signer MAY sign previously existing DKIM-Signature header fields 1623 using the method described in Section 5.4 to sign trace header 1624 fields. 1626 Note that signers should be cognizant that signing DKIM-Signature 1627 header fields may result in signature failures with intermediaries 1628 that do not recognize that DKIM-Signature header fields are trace 1629 header fields and unwittingly reorder them, thus breaking such 1630 signatures. For this reason, signing existing DKIM-Signature header 1631 fields is unadvised, albeit legal. 1633 INFORMATIVE NOTE: If a header field with multiple instances is 1634 signed, those header fields are always signed from the bottom up. 1635 Thus, it is not possible to sign only specific DKIM-Signature 1636 header fields. For example, if the message being signed already 1637 contains three DKIM-Signature header fields A, B, and C, it is 1638 possible to sign all of them, B and C only, or C only, but not A 1639 only, B only, A and B only, or A and C only. 1641 A signer MAY add more than one DKIM-Signature header field using 1642 different parameters. For example, during a transition period a 1643 signer might want to produce signatures using two different hash 1644 algorithms. 1646 Signers SHOULD NOT remove any DKIM-Signature header fields from 1647 messages they are signing, even if they know that the signatures 1648 cannot be verified. 1650 When evaluating a message with multiple signatures, a verifier SHOULD 1651 evaluate signatures independently and on their own merits. For 1652 example, a verifier that by policy chooses not to accept signatures 1653 with deprecated cryptographic algorithms would consider such 1654 signatures invalid. Verifiers MAY process signatures in any order of 1655 their choice; for example, some verifiers might choose to process 1656 signatures corresponding to the From field in the message header 1657 before other signatures. See Section 6.1 for more information about 1658 signature choices. 1660 INFORMATIVE IMPLEMENTATION NOTE: Verifier attempts to correlate 1661 valid signatures with invalid signatures in an attempt to guess 1662 why a signature failed are ill-advised. In particular, there is 1663 no general way that a verifier can determine that an invalid 1664 signature was ever valid. 1666 Verifiers SHOULD continue to check signatures until a signature 1667 successfully verifies to the satisfaction of the verifier. To limit 1668 potential denial-of-service attacks, verifiers MAY limit the total 1669 number of signatures they will attempt to verify. 1671 If a verifier module reports signatures whose evaluations produced 1672 PERMFAIL results, identity assessors SHOULD ignore those signatures 1673 (see Section 6.1), acting as though they were not present in the 1674 message. 1676 5. Signer Actions 1678 The following steps are performed in order by signers. 1680 5.1. Determine Whether the Email Should Be Signed and by Whom 1682 A signer can obviously only sign email for domains for which it has a 1683 private key and the necessary knowledge of the corresponding public 1684 key and selector information. However, there are a number of other 1685 reasons beyond the lack of a private key why a signer could choose 1686 not to sign an email. 1688 INFORMATIVE NOTE: A signer can be implemented as part of any 1689 portion of the mail system as deemed appropriate, including an 1690 MUA, a SUBMISSION server, or an MTA. Wherever implemented, 1691 signers should beware of signing (and thereby asserting 1692 responsibility for) messages that may be problematic. In 1693 particular, within a trusted enclave the signing domain might be 1694 derived from the header according to local policy; SUBMISSION 1695 servers might only sign messages from users that are properly 1696 authenticated and authorized. 1698 INFORMATIVE IMPLEMENTER ADVICE: SUBMISSION servers should not sign 1699 Received header fields if the outgoing gateway MTA obfuscates 1700 Received header fields, for example, to hide the details of 1701 internal topology. 1703 If an email cannot be signed for some reason, it is a local policy 1704 decision as to what to do with that email. 1706 5.2. Select a Private Key and Corresponding Selector Information 1708 This specification does not define the basis by which a signer should 1709 choose which private key and selector information to use. Currently, 1710 all selectors are equal as far as this specification is concerned, so 1711 the decision should largely be a matter of administrative 1712 convenience. Distribution and management of private keys is also 1713 outside the scope of this document. 1715 INFORMATIVE OPERATIONS ADVICE: A signer should not sign with a 1716 private key when the selector containing the corresponding public 1717 key is expected to be revoked or removed before the verifier has 1718 an opportunity to validate the signature. The signer should 1719 anticipate that verifiers can choose to defer validation, perhaps 1720 until the message is actually read by the final recipient. In 1721 particular, when rotating to a new key pair, signing should 1722 immediately commence with the new private key and the old public 1723 key should be retained for a reasonable validation interval before 1724 being removed from the key server. 1726 5.3. Normalize the Message to Prevent Transport Conversions 1728 Some messages, particularly those using 8-bit characters, are subject 1729 to modification during transit, notably conversion to 7-bit form. 1730 Such conversions will break DKIM signatures. In order to minimize 1731 the chances of such breakage, signers SHOULD convert the message to a 1732 suitable MIME content transfer encoding such as quoted-printable or 1733 base64 as described in [RFC2045] before signing. Such conversion is 1734 outside the scope of DKIM; the actual message SHOULD be converted to 1735 7-bit MIME by an MUA or MSA prior to presentation to the DKIM 1736 algorithm. 1738 If the message is submitted to the signer with any local encoding 1739 that will be modified before transmission, that modification to 1740 canonical [RFC5322] form MUST be done before signing. In particular, 1741 bare CR or LF characters (used by some systems as a local line 1742 separator convention) MUST be converted to the SMTP-standard CRLF 1743 sequence before the message is signed. Any conversion of this sort 1744 SHOULD be applied to the message actually sent to the recipient(s), 1745 not just to the version presented to the signing algorithm. 1747 More generally, the signer MUST sign the message as it is expected to 1748 be received by the verifier rather than in some local or internal 1749 form. 1751 5.3.1. Body Length Limits 1753 A body length count MAY be specified to limit the signature 1754 calculation to an initial prefix of the body text, measured in 1755 octets. If the body length count is not specified, the entire 1756 message body is signed. 1758 INFORMATIVE RATIONALE: This capability is provided because it is 1759 very common for mailing lists to add trailers to messages (e.g., 1760 instructions how to get off the list). Until those messages are 1761 also signed, the body length count is a useful tool for the 1762 verifier since it may as a matter of policy accept messages having 1763 valid signatures with extraneous data. 1765 The length actually hashed should be inserted in the "l=" tag of the 1766 DKIM-Signature header field. (See Section 3.5.) 1768 The body length count allows the signer of a message to permit data 1769 to be appended to the end of the body of a signed message. The body 1770 length count MUST be calculated following the canonicalization 1771 algorithm; for example, any whitespace ignored by a canonicalization 1772 algorithm is not included as part of the body length count. 1774 A body length count of zero means that the body is completely 1775 unsigned. 1777 Signers wishing to ensure that no modification of any sort can occur 1778 should specify the "simple" canonicalization algorithm for both 1779 header and body and omit the body length count. 1781 See Section 8.2 for further discussion. 1783 5.4. Determine the Header Fields to Sign 1785 The From header field MUST be signed (that is, included in the "h=" 1786 tag of the resulting DKIM-Signature header field). Signers SHOULD 1787 NOT sign an existing header field likely to be legitimately modified 1788 or removed in transit. In particular, [RFC5321] explicitly permits 1789 modification or removal of the Return-Path header field in transit. 1790 Signers MAY include any other header fields present at the time of 1791 signing at the discretion of the signer. 1793 INFORMATIVE OPERATIONS NOTE: The choice of which header fields to 1794 sign is non-obvious. One strategy is to sign all existing, non- 1795 repeatable header fields. An alternative strategy is to sign only 1796 header fields that are likely to be displayed to or otherwise be 1797 likely to affect the processing of the message at the receiver. A 1798 third strategy is to sign only "well known" headers. Note that 1799 verifiers may treat unsigned header fields with extreme 1800 skepticism, including refusing to display them to the end user or 1801 even ignoring the signature if it does not cover certain header 1802 fields. For this reason, signing fields present in the message 1803 such as Date, Subject, Reply-To, Sender, and all MIME header 1804 fields are highly advised. 1806 The DKIM-Signature header field is always implicitly signed and MUST 1807 NOT be included in the "h=" tag except to indicate that other 1808 preexisting signatures are also signed. 1810 Signers MAY claim to have signed header fields that do not exist 1811 (that is, signers MAY include the header field name in the "h=" tag 1812 even if that header field does not exist in the message). When 1813 computing the signature, the non-existing header field MUST be 1814 treated as the null string (including the header field name, header 1815 field value, all punctuation, and the trailing CRLF). 1817 INFORMATIVE RATIONALE: This allows signers to explicitly assert 1818 the absence of a header field; if that header field is added later 1819 the signature will fail. 1821 INFORMATIVE NOTE: A header field name need only be listed once 1822 more than the actual number of that header field in a message at 1823 the time of signing in order to prevent any further additions. 1824 For example, if there is a single Comments header field at the 1825 time of signing, listing Comments twice in the "h=" tag is 1826 sufficient to prevent any number of Comments header fields from 1827 being appended; it is not necessary (but is legal) to list 1828 Comments three or more times in the "h=" tag. 1830 Refer to Section 5.4.2 for a discussion of the procedure to be 1831 followed when canonicalizing a header with more than one instance of 1832 a particular header field name. 1834 Signers need to be careful of signing header fields that might have 1835 additional instances added later in the delivery process, since such 1836 header fields might be inserted after the signed instance or 1837 otherwise reordered. Trace header fields (such as Received) and 1838 Resent-* blocks are the only fields prohibited by [RFC5322] from 1839 being reordered. In particular, since DKIM-Signature header fields 1840 may be reordered by some intermediate MTAs, signing existing DKIM- 1841 Signature header fields is error-prone. 1843 INFORMATIVE ADMONITION: Despite the fact that [RFC5322] does not 1844 prohibit the reordering of header fields, reordering of signed 1845 header fields with multiple instances by intermediate MTAs will 1846 cause DKIM signatures to be broken; such anti-social behavior 1847 should be avoided. 1849 INFORMATIVE IMPLEMENTER'S NOTE: Although not required by this 1850 specification, all end-user visible header fields should be signed 1851 to avoid possible "indirect spamming". For example, if the 1852 Subject header field is not signed, a spammer can resend a 1853 previously signed mail, replacing the legitimate subject with a 1854 one-line spam. 1856 5.4.1. Recommended Signature Content 1858 The purpose of the DKIM cryptographic algorithm is to affix an 1859 identifier to the message in a way that is both robust against normal 1860 transit-related changes and resistant to kinds of replay attacks. An 1861 essential aspect of satisfying these requirements is choosing what 1862 header fields to include in the hash and what fields to exclude. 1864 The basic rule for choosing fields to include is to select those 1865 fields that constitute the "core" of the message content. Hence, any 1866 replay attack will have to include these in order to have the 1867 signature succeed; but with these included, the core of the message 1868 is valid, even if sent on to new recipients. 1870 Common examples of fields with addresses and fields with textual 1871 content related to the body are: 1873 o From (REQUIRED; see Section 5.4) 1875 o Reply-To 1877 o Subject 1879 o Date 1881 o To, Cc 1883 o Resent-Date, Resent-From, Resent-To, Resent-Cc 1885 o In-Reply-To, References 1887 o List-Id, List-Help, List-Unsubscribe, List-Subscribe, List-Post, 1888 List-Owner, List-Archive 1890 If the "l=" signature tag is in use (see Section 3.5), the Content- 1891 Type field is also a candidate for being included as it could be 1892 replaced in a way that causes completely different content to be 1893 rendered to the receiving user. 1895 There are tradeoffs in the decision of what constitutes the "core" of 1896 the message, which for some fields is a subjective concept. 1897 Including fields such as "Message-ID" for example is useful if one 1898 considers a mechanism for being able to distinguish separate 1899 instances of the same message to be core content. Similarly, "In- 1900 Reply-To" and "References" might be desirable to include if one 1901 considers message threading to be a core part of the message. 1903 Another class of fields that may be of interest are those that convey 1904 security-related information about the message, such as 1905 Authentication-Results [RFC5451]. 1907 The basic rule for choosing fields to exclude is to select those 1908 fields for which there are multiple fields with the same name, and 1909 fields that are modified in transit. Examples of these are: 1911 o Return-Path 1913 o Received 1915 o Comments, Keywords 1917 Note that the DKIM-Signature field is also excluded from the header 1918 hash, because its handling is specified separately. 1920 Typically, it is better to exclude other, optional fields because of 1921 the potential that additional fields of the same name will be 1922 legitimately added or re-ordered prior to verification. There are 1923 likely to be legitimate exceptions to this rule, because of the wide 1924 variety of application-specific header fields that might be applied 1925 to a message, some of which are unlikely to be duplicated, modified, 1926 or reordered. 1928 Signers SHOULD choose canonicalization algorithms based on the types 1929 of messages they process and their aversion to risk. For example, 1930 e-commerce sites sending primarily purchase receipts, which are not 1931 expected to be processed by mailing lists or other software likely to 1932 modify messages, will generally prefer "simple" canonicalization. 1933 Sites sending primarily person-to-person email will likely prefer to 1934 be more resilient to modification during transport by using "relaxed" 1935 canonicalization. 1937 Unless mail is processed through intermediaries, such as mailing 1938 lists that might add "unsubscribe" instructions to the bottom of the 1939 message body, the "l=" tag is likely to convey no additional benefit 1940 while providing an avenue for unauthorized addition of text to a 1941 message. The use of "l=0" takes this to the extreme, allowing 1942 complete alteration of the text of the message without invalidating 1943 the signature. Moreover, a verifier would be within its rights to 1944 consider a partly-signed message body as unacceptable. Judicious use 1945 is advised. 1947 5.4.2. Signatures Involving Multiple Instances of a Field 1949 Signers choosing to sign an existing header field that occurs more 1950 than once in the message (such as Received) MUST sign the physically 1951 last instance of that header field in the header block. Signers 1952 wishing to sign multiple instances of such a header field MUST 1953 include the header field name multiple times in the h= tag of the 1954 DKIM-Signature header field, and MUST sign such header fields in 1955 order from the bottom of the header field block to the top. The 1956 signer MAY include more instances of a header field name in "h=" than 1957 there are actual corresponding header fields so that the signature 1958 will not verify if additional header fields of that name are added. 1960 INFORMATIVE EXAMPLE: 1962 If the signer wishes to sign two existing Received header fields, 1963 and the existing header contains: 1964 Received: 1965 Received: 1966 Received: 1968 then the resulting DKIM-Signature header field should read: 1970 DKIM-Signature: ... h=Received : Received :... 1971 and Received header fields and will be signed in that 1972 order. 1974 5.5. Compute the Message Hash and Signature 1976 The signer MUST compute the message hash as described in Section 3.7 1977 and then sign it using the selected public-key algorithm. This will 1978 result in a DKIM-Signature header field that will include the body 1979 hash and a signature of the header hash, where that header includes 1980 the DKIM-Signature header field itself. 1982 Entities such as mailing list managers that implement DKIM and that 1983 modify the message or a header field (for example, inserting 1984 unsubscribe information) before retransmitting the message SHOULD 1985 check any existing signature on input and MUST make such 1986 modifications before re-signing the message. 1988 5.6. Insert the DKIM-Signature Header Field 1990 Finally, the signer MUST insert the DKIM-Signature header field 1991 created in the previous step prior to transmitting the email. The 1992 DKIM-Signature header field MUST be the same as used to compute the 1993 hash as described above, except that the value of the "b=" tag MUST 1994 be the appropriately signed hash computed in the previous step, 1995 signed using the algorithm specified in the "a=" tag of the DKIM- 1996 Signature header field and using the private key corresponding to the 1997 selector given in the "s=" tag of the DKIM-Signature header field, as 1998 chosen above in Section 5.2 1999 The DKIM-Signature header field MUST be inserted before any other 2000 DKIM-Signature fields in the header block. 2002 INFORMATIVE IMPLEMENTATION NOTE: The easiest way to achieve this 2003 is to insert the DKIM-Signature header field at the beginning of 2004 the header block. In particular, it may be placed before any 2005 existing Received header fields. This is consistent with treating 2006 DKIM-Signature as a trace header field. 2008 6. Verifier Actions 2010 Since a signer MAY remove or revoke a public key at any time, it is 2011 advised that verification occur in a timely manner. In many 2012 configurations, the most timely place is during acceptance by the 2013 border MTA or shortly thereafter. In particular, deferring 2014 verification until the message is accessed by the end user is 2015 discouraged. 2017 A border or intermediate MTA MAY verify the message signature(s). An 2018 MTA who has performed verification MAY communicate the result of that 2019 verification by adding a verification header field to incoming 2020 messages. This considerably simplifies things for the user, who can 2021 now use an existing mail user agent. Most MUAs have the ability to 2022 filter messages based on message header fields or content; these 2023 filters would be used to implement whatever policy the user wishes 2024 with respect to unsigned mail. 2026 A verifying MTA MAY implement a policy with respect to unverifiable 2027 mail, regardless of whether or not it applies the verification header 2028 field to signed messages. 2030 Verifiers MUST produce a result that is semantically equivalent to 2031 applying the following steps in the order listed. In practice, 2032 several of these steps can be performed in parallel in order to 2033 improve performance. 2035 6.1. Extract Signatures from the Message 2037 The order in which verifiers try DKIM-Signature header fields is not 2038 defined; verifiers MAY try signatures in any order they like. For 2039 example, one implementation might try the signatures in textual 2040 order, whereas another might try signatures by identities that match 2041 the contents of the From header field before trying other signatures. 2042 Verifiers MUST NOT attribute ultimate meaning to the order of 2043 multiple DKIM-Signature header fields. In particular, there is 2044 reason to believe that some relays will reorder the header fields in 2045 potentially arbitrary ways. 2047 INFORMATIVE IMPLEMENTATION NOTE: Verifiers might use the order as 2048 a clue to signing order in the absence of any other information. 2049 However, other clues as to the semantics of multiple signatures 2050 (such as correlating the signing host with Received header fields) 2051 might also be considered. 2053 Survivability of signatures after transit is not guaranteed, and 2054 signatures can fail to verify through no fault of the signer. 2055 Therefore, a verifier SHOULD NOT treat a message that has one or more 2056 bad signatures and no good signatures differently from a message with 2057 no signature at all. 2059 When a signature successfully verifies, a verifier will either stop 2060 processing or attempt to verify any other signatures, at the 2061 discretion of the implementation. A verifier MAY limit the number of 2062 signatures it tries, in order to avoid denial-of-service attacks (see 2063 Section 8.4 for further discussion). 2065 In the following description, text reading "return status 2066 (explanation)" (where "status" is one of "PERMFAIL" or "TEMPFAIL") 2067 means that the verifier MUST immediately cease processing that 2068 signature. The verifier SHOULD proceed to the next signature, if any 2069 is present, and completely ignore the bad signature. If the status 2070 is "PERMFAIL", the signature failed and should not be reconsidered. 2071 If the status is "TEMPFAIL", the signature could not be verified at 2072 this time but may be tried again later. A verifier MAY either 2073 arrange to defer the message for later processing, or try another 2074 signature; if no good signature is found and any of the signatures 2075 resulted in a TEMPFAIL status, the verifier MAY arrange to defer the 2076 message for later processing. The "(explanation)" is not normative 2077 text; it is provided solely for clarification. 2079 Verifiers that are prepared to validate multiple signature header 2080 fields SHOULD proceed to the next signature header field, if one 2081 exists. However, verifiers MAY make note of the fact that an invalid 2082 signature was present for consideration at a later step. 2084 INFORMATIVE NOTE: The rationale of this requirement is to permit 2085 messages that have invalid signatures but also a valid signature 2086 to work. For example, a mailing list exploder might opt to leave 2087 the original submitter signature in place even though the exploder 2088 knows that it is modifying the message in some way that will break 2089 that signature, and the exploder inserts its own signature. In 2090 this case, the message should succeed even in the presence of the 2091 known-broken signature. 2093 For each signature to be validated, the following steps should be 2094 performed in such a manner as to produce a result that is 2095 semantically equivalent to performing them in the indicated order. 2097 6.1.1. Validate the Signature Header Field 2099 Implementers MUST meticulously validate the format and values in the 2100 DKIM-Signature header field; any inconsistency or unexpected values 2101 MUST cause the header field to be completely ignored and the verifier 2102 to return PERMFAIL (signature syntax error). Being "liberal in what 2103 you accept" is definitely a bad strategy in this security context. 2104 Note however that this does not include the existence of unknown tags 2105 in a DKIM-Signature header field, which are explicitly permitted. 2106 Verifiers MUST return PERMFAIL (incompatible version) when presented 2107 a DKIM-Signature header field with a "v=" tag that is inconsistent 2108 with this specification. 2110 INFORMATIVE IMPLEMENTATION NOTE: An implementation may, of course, 2111 choose to also verify signatures generated by older versions of 2112 this specification. 2114 If any tag listed as "required" in Section 3.5 is omitted from the 2115 DKIM-Signature header field, the verifier MUST ignore the DKIM- 2116 Signature header field and return PERMFAIL (signature missing 2117 required tag). 2119 INFORMATIONAL NOTE: The tags listed as required in Section 3.5 are 2120 "v=", "a=", "b=", "bh=", "d=", "h=", and "s=". Should there be a 2121 conflict between this note and Section 3.5, Section 3.5 is 2122 normative. 2124 If the DKIM-Signature header field does not contain the "i=" tag, the 2125 verifier MUST behave as though the value of that tag were "@d", where 2126 "d" is the value from the "d=" tag. 2128 Verifiers MUST confirm that the domain specified in the "d=" tag is 2129 the same as or a parent domain of the domain part of the "i=" tag. 2130 If not, the DKIM-Signature header field MUST be ignored and the 2131 verifier should return PERMFAIL (domain mismatch). 2133 If the "h=" tag does not include the From header field, the verifier 2134 MUST ignore the DKIM-Signature header field and return PERMFAIL (From 2135 field not signed). 2137 Verifiers MAY ignore the DKIM-Signature header field and return 2138 PERMFAIL (signature expired) if it contains an "x=" tag and the 2139 signature has expired. 2141 Verifiers MAY ignore the DKIM-Signature header field if the domain 2142 used by the signer in the "d=" tag is not associated with a valid 2143 signing entity. For example, signatures with "d=" values such as 2144 "com" and "co.uk" could be ignored. The list of unacceptable domains 2145 SHOULD be configurable. 2147 Verifiers MAY ignore the DKIM-Signature header field and return 2148 PERMFAIL (unacceptable signature header) for any other reason, for 2149 example, if the signature does not sign header fields that the 2150 verifier views to be essential. As a case in point, if MIME header 2151 fields are not signed, certain attacks may be possible that the 2152 verifier would prefer to avoid. 2154 6.1.2. Get the Public Key 2156 The public key for a signature is needed to complete the verification 2157 process. The process of retrieving the public key depends on the 2158 query type as defined by the "q=" tag in the DKIM-Signature header 2159 field. Obviously, a public key need only be retrieved if the process 2160 of extracting the signature information is completely successful. 2161 Details of key management and representation are described in 2162 Section 3.6. The verifier MUST validate the key record and MUST 2163 ignore any public key records that are malformed. 2165 NOTE: The use of a wildcard TXT RR that covers a queried DKIM domain 2166 name will produce a response to a DKIM query that is unlikely to 2167 be valid DKIM key record. This problem is not specific to DKIM 2168 and applies to many other types of queries. Client software that 2169 processes DNS responses needs to take this problem into account. 2171 When validating a message, a verifier MUST perform the following 2172 steps in a manner that is semantically the same as performing them in 2173 the order indicated -- in some cases the implementation may 2174 parallelize or reorder these steps, as long as the semantics remain 2175 unchanged: 2177 1. Retrieve the public key as described in Section 3.6 using the 2178 algorithm in the "q=" tag, the domain from the "d=" tag, and the 2179 selector from the "s=" tag. 2181 2. If the query for the public key fails to respond, the verifier 2182 MAY seek a later verification attempt by returning TEMPFAIL (key 2183 unavailable). 2185 3. If the query for the public key fails because the corresponding 2186 key record does not exist, the verifier MUST immediately return 2187 PERMFAIL (no key for signature). 2189 4. If the query for the public key returns multiple key records, the 2190 verifier can choose one of the key records or may cycle through 2191 the key records performing the remainder of these steps on each 2192 record at the discretion of the implementer. The order of the 2193 key records is unspecified. If the verifier chooses to cycle 2194 through the key records, then the "return ..." wording in the 2195 remainder of this section means "try the next key record, if any; 2196 if none, return to try another signature in the usual way". 2198 5. If the result returned from the query does not adhere to the 2199 format defined in this specification, the verifier MUST ignore 2200 the key record and return PERMFAIL (key syntax error). Verifiers 2201 are urged to validate the syntax of key records carefully to 2202 avoid attempted attacks. In particular, the verifier MUST ignore 2203 keys with a version code ("v=" tag) that they do not implement. 2205 6. If the "h=" tag exists in the public key record and the hash 2206 algorithm implied by the "a=" tag in the DKIM-Signature header 2207 field is not included in the contents of the "h=" tag, the 2208 verifier MUST ignore the key record and return PERMFAIL 2209 (inappropriate hash algorithm). 2211 7. If the public key data (the "p=" tag) is empty, then this key has 2212 been revoked and the verifier MUST treat this as a failed 2213 signature check and return PERMFAIL (key revoked). There is no 2214 defined semantic difference between a key that has been revoked 2215 and a key record that has been removed. 2217 8. If the public key data is not suitable for use with the algorithm 2218 and key types defined by the "a=" and "k=" tags in the DKIM- 2219 Signature header field, the verifier MUST immediately return 2220 PERMFAIL (inappropriate key algorithm). 2222 6.1.3. Compute the Verification 2224 Given a signer and a public key, verifying a signature consists of 2225 actions semantically equivalent to the following steps. 2227 1. Based on the algorithm defined in the "c=" tag, the body length 2228 specified in the "l=" tag, and the header field names in the "h=" 2229 tag, prepare a canonicalized version of the message as is 2230 described in Section 3.7 (note that this canonicalized version 2231 does not actually replace the original content). When matching 2232 header field names in the "h=" tag against the actual message 2233 header field, comparisons MUST be case-insensitive. 2235 2. Based on the algorithm indicated in the "a=" tag, compute the 2236 message hashes from the canonical copy as described in 2237 Section 3.7. 2239 3. Verify that the hash of the canonicalized message body computed 2240 in the previous step matches the hash value conveyed in the "bh=" 2241 tag. If the hash does not match, the verifier SHOULD ignore the 2242 signature and return PERMFAIL (body hash did not verify). 2244 4. Using the signature conveyed in the "b=" tag, verify the 2245 signature against the header hash using the mechanism appropriate 2246 for the public key algorithm described in the "a=" tag. If the 2247 signature does not validate, the verifier SHOULD ignore the 2248 signature and return PERMFAIL (signature did not verify). 2250 5. Otherwise, the signature has correctly verified. 2252 INFORMATIVE IMPLEMENTER'S NOTE: Implementations might wish to 2253 initiate the public-key query in parallel with calculating the 2254 hash as the public key is not needed until the final decryption is 2255 calculated. Implementations may also verify the signature on the 2256 message header before validating that the message hash listed in 2257 the "bh=" tag in the DKIM-Signature header field matches that of 2258 the actual message body; however, if the body hash does not match, 2259 the entire signature must be considered to have failed. 2261 A body length specified in the "l=" tag of the signature limits the 2262 number of bytes of the body passed to the verification algorithm. 2263 All data beyond that limit is not validated by DKIM. Hence, 2264 verifiers might treat a message that contains bytes beyond the 2265 indicated body length with suspicion, and can choose to treat the 2266 signature as if it were invalid (e.g., by returning PERMFAIL 2267 (unsigned content)). 2269 Should the algorithm reach this point, the verification has 2270 succeeded, and DKIM reports SUCCESS for this signature. 2272 6.2. Communicate Verification Results 2274 Verifiers wishing to communicate the results of verification to other 2275 parts of the mail system may do so in whatever manner they see fit. 2276 For example, implementations might choose to add an email header 2277 field to the message before passing it on. Any such header field 2278 SHOULD be inserted before any existing DKIM-Signature or preexisting 2279 authentication status header fields in the header field block. The 2280 Authentication-Results: header field ([RFC5451]) MAY be used for this 2281 purpose. 2283 INFORMATIVE ADVICE to MUA filter writers: Patterns intended to 2284 search for results header fields to visibly mark authenticated 2285 mail for end users should verify that such header field was added 2286 by the appropriate verifying domain and that the verified identity 2287 matches the author identity that will be displayed by the MUA. In 2288 particular, MUA filters should not be influenced by bogus results 2289 header fields added by attackers. To circumvent this attack, 2290 verifiers MAY wish to request deletion of existing results header 2291 fields after verification and before arranging to add a new header 2292 field. 2294 6.3. Interpret Results/Apply Local Policy 2296 It is beyond the scope of this specification to describe what actions 2297 an Identity Assessor can make, but mail carrying a validated SDID 2298 presents an opportunity to an Identity Assessor that unauthenticated 2299 email does not. Specifically, an authenticated email creates a 2300 predictable identifier by which other decisions can reliably be 2301 managed, such as trust and reputation. Conversely, unauthenticated 2302 email lacks a reliable identifier that can be used to assign trust 2303 and reputation. It is reasonable to treat unauthenticated email as 2304 lacking any trust and having no positive reputation. 2306 In general, modules that consume DKIM verification output SHOULD NOT 2307 determine message acceptability based solely on a lack of any 2308 signature or on an unverifiable signature; such rejection would cause 2309 severe interoperability problems. If an MTA does wish to reject such 2310 messages during an SMTP session (for example, when communicating with 2311 a peer who, by prior agreement, agrees to only send signed messages), 2312 and a signature is missing or does not verify, the handling MTA 2313 SHOULD use a 550/5.7.x reply code. 2315 Where the verifier is integrated within the MTA and it is not 2316 possible to fetch the public key, perhaps because the key server is 2317 not available, a temporary failure message MAY be generated using a 2318 451/4.7.5 reply code, such as: 2319 451 4.7.5 Unable to verify signature - key server unavailable 2321 Temporary failures such as inability to access the key server or 2322 other external service are the only conditions that SHOULD use a 4xx 2323 SMTP reply code. In particular, cryptographic signature verification 2324 failures MUST NOT provoke 4xx SMTP replies. 2326 Once the signature has been verified, that information MUST be 2327 conveyed to the Identity Assessor (such as an explicit allow/ 2328 whitelist and reputation system) and/or to the end user. If the SDID 2329 is not the same as the address in the From: header field, the mail 2330 system SHOULD take pains to ensure that the actual SDID is clear to 2331 the reader. 2333 While the symptoms of a failed verification are obvious -- the 2334 signature doesn't verify -- establishing the exact cause can be more 2335 difficult. If a selector cannot be found, is that because the 2336 selector has been removed, or was the value changed somehow in 2337 transit? If the signature line is missing, is that because it was 2338 never there, or was it removed by an overzealous filter? For 2339 diagnostic purposes, the exact reason why the verification fails 2340 SHOULD be made available and possibly recorded in the system logs. 2341 If the email cannot be verified, then it SHOULD be treated the same 2342 as all unverified email regardless of whether or not it looks like it 2343 was signed. 2345 See Section 8.15 for additional discussion. 2347 7. IANA Considerations 2349 DKIM has registered namespaces with IANA. In all cases, new values 2350 are assigned only for values that have been documented in a published 2351 RFC that has IETF Consensus [RFC5226]. 2353 This memo updates these registries as described below. Of note is 2354 the addition of a new "status" column. All registrations into these 2355 namespaces MUST include the name being registered, the document in 2356 which it was registered or updated, and an indication of its current 2357 status which MUST be one of "active" (in current use) or "historic" 2358 (no longer in current use). 2360 No new tags are defined in this specification compared to [RFC4871], 2361 but one has been designated as "historic". 2363 Also, the Email Authentication Methods Registry is revised to refer 2364 to this update. 2366 7.1. Email Authentication Methods Registry 2368 The Email Authentication Methods registry is updated to indicate that 2369 "dkim" is defined in this memo. 2371 7.2. DKIM-Signature Tag Specifications 2373 A DKIM-Signature provides for a list of tag specifications. IANA has 2374 established the DKIM-Signature Tag Specification Registry for tag 2375 specifications that can be used in DKIM-Signature fields. 2377 The updated entries in the registry comprise: 2379 +------+-----------------+--------+ 2380 | TYPE | REFERENCE | STATUS | 2381 +------+-----------------+--------+ 2382 | v | (this document) | active | 2383 | a | (this document) | active | 2384 | b | (this document) | active | 2385 | bh | (this document) | active | 2386 | c | (this document) | active | 2387 | d | (this document) | active | 2388 | h | (this document) | active | 2389 | i | (this document) | active | 2390 | l | (this document) | active | 2391 | q | (this document) | active | 2392 | s | (this document) | active | 2393 | t | (this document) | active | 2394 | x | (this document) | active | 2395 | z | (this document) | active | 2396 +------+-----------------+--------+ 2398 Table 1: DKIM-Signature Tag Specification Registry Updated Values 2400 7.3. DKIM-Signature Query Method Registry 2402 The "q=" tag-spec (specified in Section 3.5) provides for a list of 2403 query methods. 2405 IANA has established the DKIM-Signature Query Method Registry for 2406 mechanisms that can be used to retrieve the key that will permit 2407 validation processing of a message signed using DKIM. 2409 The updated entry in the registry comprises: 2411 +------+--------+-----------------+--------+ 2412 | TYPE | OPTION | REFERENCE | STATUS | 2413 +------+--------+-----------------+--------+ 2414 | dns | txt | (this document) | active | 2415 +------+--------+-----------------+--------+ 2417 DKIM-Signature Query Method Registry Updated Values 2419 7.4. DKIM-Signature Canonicalization Registry 2421 The "c=" tag-spec (specified in Section 3.5) provides for a specifier 2422 for canonicalization algorithms for the header and body of the 2423 message. 2425 IANA has established the DKIM-Signature Canonicalization Algorithm 2426 Registry for algorithms for converting a message into a canonical 2427 form before signing or verifying using DKIM. 2429 The updated entries in the header registry comprise: 2431 +---------+-----------------+--------+ 2432 | TYPE | REFERENCE | STATUS | 2433 +---------+-----------------+--------+ 2434 | simple | (this document) | active | 2435 | relaxed | (this document) | active | 2436 +---------+-----------------+--------+ 2438 DKIM-Signature Header Canonicalization Algorithm Registry 2439 Updated Values 2441 The updated entries in the body registry comprise: 2443 +---------+-----------------+--------+ 2444 | TYPE | REFERENCE | STATUS | 2445 +---------+-----------------+--------+ 2446 | simple | (this document) | active | 2447 | relaxed | (this document) | active | 2448 +---------+-----------------+--------+ 2450 DKIM-Signature Body Canonicalization Algorithm Registry 2451 Updated Values 2453 7.5. _domainkey DNS TXT Resource Record Tag Specifications 2455 A _domainkey DNS TXT RR provides for a list of tag specifications. 2456 IANA has established the DKIM _domainkey DNS TXT Tag Specification 2457 Registry for tag specifications that can be used in DNS TXT resource 2458 records. 2460 The updated entries in the registry comprise: 2462 +------+-----------------+----------+ 2463 | TYPE | REFERENCE | STATUS | 2464 +------+-----------------+----------+ 2465 | v | (this document) | active | 2466 | g | [RFC4871] | historic | 2467 | h | (this document) | active | 2468 | k | (this document) | active | 2469 | n | (this document) | active | 2470 | p | (this document) | active | 2471 | s | (this document) | active | 2472 | t | (this document) | active | 2473 +------+-----------------+----------+ 2475 DKIM _domainkey DNS TXT Tag Specification Registry 2476 Updated Values 2478 7.6. DKIM Key Type Registry 2480 The "k=" (specified in Section 3.6.1) and the "a=" (specified in Section 3.5) tags provide for a list of 2482 mechanisms that can be used to decode a DKIM signature. 2484 IANA has established the DKIM Key Type Registry for such mechanisms. 2486 The updated entry in the registry comprises: 2488 +------+-----------+--------+ 2489 | TYPE | REFERENCE | STATUS | 2490 +------+-----------+--------+ 2491 | rsa | [RFC3447] | active | 2492 +------+-----------+--------+ 2494 DKIM Key Type Updated Values 2496 7.7. DKIM Hash Algorithms Registry 2498 The "h=" (specified in Section 3.6.1) and the "a=" (specified in Section 3.5) tags provide for a list of 2500 mechanisms that can be used to produce a digest of message data. 2502 IANA has established the DKIM Hash Algorithms Registry for such 2503 mechanisms. 2505 The updated entries in the registry comprise: 2507 +--------+-------------------+--------+ 2508 | TYPE | REFERENCE | STATUS | 2509 +--------+-------------------+--------+ 2510 | sha1 | [FIPS-180-3-2008] | active | 2511 | sha256 | [FIPS-180-3-2008] | active | 2512 +--------+-------------------+--------+ 2514 DKIM Hash Algorithms Updated Values 2516 7.8. DKIM Service Types Registry 2518 The "s=" tag (specified in Section 3.6.1) provides for a 2519 list of service types to which this selector may apply. 2521 IANA has established the DKIM Service Types Registry for service 2522 types. 2524 The updated entries in the registry comprise: 2526 +-------+-----------------+--------+ 2527 | TYPE | REFERENCE | STATUS | 2528 +-------+-----------------+--------+ 2529 | email | (this document) | active | 2530 | * | (this document) | active | 2531 +-------+-----------------+--------+ 2533 DKIM Service Types Registry Updated Values 2535 7.9. DKIM Selector Flags Registry 2537 The "t=" tag (specified in Section 3.6.1) provides for a 2538 list of flags to modify interpretation of the selector. 2540 IANA has established the DKIM Selector Flags Registry for additional 2541 flags. 2543 The updated entries in the registry comprise: 2545 +------+-----------------+--------+ 2546 | TYPE | REFERENCE | STATUS | 2547 +------+-----------------+--------+ 2548 | y | (this document) | active | 2549 | s | (this document) | active | 2550 +------+-----------------+--------+ 2552 DKIM Selector Flags Registry Updated Values 2554 7.10. DKIM-Signature Header Field 2556 IANA has added DKIM-Signature to the "Permanent Message Header 2557 Fields" registry (see [RFC3864]) for the "mail" protocol, using this 2558 document as the reference. 2560 8. Security Considerations 2562 It has been observed that any mechanism that is introduced that 2563 attempts to stem the flow of spam is subject to intensive attack. 2564 DKIM needs to be carefully scrutinized to identify potential attack 2565 vectors and the vulnerability to each. See also [RFC4686]. 2567 8.1. ASCII Art Attacks 2569 The relaxed body canonicalization algorithm may enable certain types 2570 of extremely crude "ASCII Art" attacks where a message may be 2571 conveyed by adjusting the spacing between words. If this is a 2572 concern, the "simple" body canonicalization algorithm should be used 2573 instead. 2575 8.2. Misuse of Body Length Limits ("l=" Tag) 2577 Use of the "l=" tag might allow display of fraudulent content without 2578 appropriate warning to end users. The "l=" tag is intended for 2579 increasing signature robustness when sending to mailing lists that 2580 both modify their content and do not sign their modified messages. 2581 However, using the "l=" tag enables attacks in which an intermediary 2582 with malicious intent modifies a message to include content that 2583 solely benefits the attacker. It is possible for the appended 2584 content to completely replace the original content in the end 2585 recipient's eyes and to defeat duplicate message detection 2586 algorithms. 2588 An example of such an attack includes alterations to the MIME 2589 structure or exploiting lax HTML parsing in the MUA, and to defeat 2590 duplicate message detection algorithms. 2592 To avoid this attack, signers should be extremely wary of using this 2593 tag, and assessors might wish to ignore signatures that use the tag. 2595 8.3. Misappropriated Private Key 2597 As with any other security application that uses private/public key 2598 pairs, DKIM requires caution around the handling and protection of 2599 keys. A compromised private key or access to one means an intruder 2600 or malware can send mail signed by the domain that advertises the 2601 matching public key. 2603 Thus, private keys issued to users, rather than one used by an ADMD 2604 itself, create the usual problem of securing data stored on personal 2605 resources that can affect the ADMD. 2607 A more secure architecture involves sending messages through an 2608 outgoing MTA that can authenticate the submitter using existing 2609 techniques (e.g., SMTP Authentication), possibly validate the message 2610 itself (e.g., verify that the header is legitimate and that the 2611 content passes a spam content check), and sign the message using a 2612 key appropriate for the submitter address. Such an MTA can also 2613 apply controls on the volume of outgoing mail each user is permitted 2614 to originate in order to further limit the ability of malware to 2615 generate bulk email. 2617 8.4. Key Server Denial-of-Service Attacks 2619 Since the key servers are distributed (potentially separate for each 2620 domain), the number of servers that would need to be attacked to 2621 defeat this mechanism on an Internet-wide basis is very large. 2622 Nevertheless, key servers for individual domains could be attacked, 2623 impeding the verification of messages from that domain. This is not 2624 significantly different from the ability of an attacker to deny 2625 service to the mail exchangers for a given domain, although it 2626 affects outgoing, not incoming, mail. 2628 A variation on this attack involves a very large amount of mail being 2629 sent using spoofed signatures from a given domain, the key servers 2630 for that domain could be overwhelmed with requests in a denial-of- 2631 service attack (see [RFC4732]). However, given the low overhead of 2632 verification compared with handling of the email message itself, such 2633 an attack would be difficult to mount. 2635 8.5. Attacks Against the DNS 2637 Since the DNS is a required binding for key services, specific 2638 attacks against the DNS must be considered. 2640 While the DNS is currently insecure [RFC3833], these security 2641 problems are the motivation behind DNS Security (DNSSEC) [RFC4033], 2642 and all users of the DNS will reap the benefit of that work. 2644 DKIM is only intended as a "sufficient" method of proving 2645 authenticity. It is not intended to provide strong cryptographic 2646 proof about authorship or contents. Other technologies such as 2647 OpenPGP [RFC4880] and S/MIME [RFC5751] address those requirements. 2649 A second security issue related to the DNS revolves around the 2650 increased DNS traffic as a consequence of fetching selector-based 2651 data as well as fetching signing domain policy. Widespread 2652 deployment of DKIM will result in a significant increase in DNS 2653 queries to the claimed signing domain. In the case of forgeries on a 2654 large scale, DNS servers could see a substantial increase in queries. 2656 A specific DNS security issue that should be considered by DKIM 2657 verifiers is the name chaining attack described in Section 2.3 of 2658 [RFC3833]. A DKIM verifier, while verifying a DKIM-Signature header 2659 field, could be prompted to retrieve a key record of an attacker's 2660 choosing. This threat can be minimized by ensuring that name 2661 servers, including recursive name servers, used by the verifier 2662 enforce strict checking of "glue" and other additional information in 2663 DNS responses and are therefore not vulnerable to this attack. 2665 8.6. Replay/Spam Attacks 2667 In this attack, a spammer sends a piece of spam through an MTA that 2668 signs it, banking on the reputation of the signing domain (e.g., a 2669 large popular mailbox provider) rather than its own, and then re- 2670 sends that message to a large number of intended recipients. The 2671 recipients observe the valid signature from the well-known domain, 2672 elevating their trust in the message and increasing the likelihood of 2673 delivery and presentation to the user. 2675 Partial solutions to this problem involve the use of reputation 2676 services to convey the fact that the specific email address is being 2677 used for spam and that messages from that signer are likely to be 2678 spam. This requires a real-time detection mechanism in order to 2679 react quickly enough. However, such measures might be prone to 2680 abuse, if for example an attacker resent a large number of messages 2681 received from a victim in order to make them appear to be a spammer. 2683 Large verifiers might be able to detect unusually large volumes of 2684 mails with the same signature in a short time period. Smaller 2685 verifiers can get substantially the same volume of information via 2686 existing collaborative systems. 2688 8.7. Limits on Revoking Keys 2690 When a large domain detects undesirable behavior on the part of one 2691 of its users, it might wish to revoke the key used to sign that 2692 user's messages in order to disavow responsibility for messages that 2693 have not yet been verified or that are the subject of a replay 2694 attack. However, the ability of the domain to do so can be limited 2695 if the same key, for scalability reasons, is used to sign messages 2696 for many other users. Mechanisms for explicitly revoking keys on a 2697 per-address basis have been proposed but require further study as to 2698 their utility and the DNS load they represent. 2700 8.8. Intentionally Malformed Key Records 2702 It is possible for an attacker to publish key records in DNS that are 2703 intentionally malformed, with the intent of causing a denial-of- 2704 service attack on a non-robust verifier implementation. The attacker 2705 could then cause a verifier to read the malformed key record by 2706 sending a message to one of its users referencing the malformed 2707 record in a (not necessarily valid) signature. Verifiers MUST 2708 thoroughly verify all key records retrieved from the DNS and be 2709 robust against intentionally as well as unintentionally malformed key 2710 records. 2712 8.9. Intentionally Malformed DKIM-Signature Header Fields 2714 Verifiers MUST be prepared to receive messages with malformed DKIM- 2715 Signature header fields, and thoroughly verify the header field 2716 before depending on any of its contents. 2718 8.10. Information Leakage 2720 An attacker could determine when a particular signature was verified 2721 by using a per-message selector and then monitoring their DNS traffic 2722 for the key lookup. This would act as the equivalent of a "web bug" 2723 for verification time rather than when the message was read. 2725 8.11. Remote Timing Attacks 2727 In some cases it may be possible to extract private keys using a 2728 remote timing attack [BONEH03]. Implementations should consider 2729 obfuscating the timing to prevent such attacks. 2731 8.12. Reordered Header Fields 2733 Existing standards allow intermediate MTAs to reorder header fields. 2734 If a signer signs two or more header fields of the same name, this 2735 can cause spurious verification errors on otherwise legitimate 2736 messages. In particular, signers that sign any existing DKIM- 2737 Signature fields run the risk of having messages incorrectly fail to 2738 verify. 2740 8.13. RSA Attacks 2742 An attacker could create a large RSA signing key with a small 2743 exponent, thus requiring that the verification key have a large 2744 exponent. This will force verifiers to use considerable computing 2745 resources to verify the signature. Verifiers might avoid this attack 2746 by refusing to verify signatures that reference selectors with public 2747 keys having unreasonable exponents. 2749 In general, an attacker might try to overwhelm a verifier by flooding 2750 it with messages requiring verification. This is similar to other 2751 MTA denial-of-service attacks and should be dealt with in a similar 2752 fashion. 2754 8.14. Inappropriate Signing by Parent Domains 2756 The trust relationship described in Section 3.10 could conceivably be 2757 used by a parent domain to sign messages with identities in a 2758 subdomain not administratively related to the parent. For example, 2759 the ".com" registry could create messages with signatures using an 2760 "i=" value in the example.com domain. There is no general solution 2761 to this problem, since the administrative cut could occur anywhere in 2762 the domain name. For example, in the domain "example.podunk.ca.us" 2763 there are three administrative cuts (podunk.ca.us, ca.us, and us), 2764 any of which could create messages with an identity in the full 2765 domain. 2767 INFORMATIVE NOTE: This is considered an acceptable risk for the 2768 same reason that it is acceptable for domain delegation. For 2769 example, in the example above any of the domains could potentially 2770 simply delegate "example.podunk.ca.us" to a server of their choice 2771 and completely replace all DNS-served information. Note that a 2772 verifier MAY ignore signatures that come from an unlikely domain 2773 such as ".com", as discussed in Section 6.1.1. 2775 8.15. Attacks Involving Extra Header Fields 2777 Many email components, including MTAs, MSAs, MUAs and filtering 2778 modules, implement message format checks only loosely. This is done 2779 out of years of industry pressure to be liberal in what is accepted 2780 into the mail stream for the sake of reducing support costs; 2781 improperly formed messages are often silently fixed in transit, 2782 delivered unrepaired, or displayed inappropriately (e.g., by showing 2783 only the first of multiple From: fields). 2785 Agents that evaluate or apply DKIM output need to be aware that a 2786 DKIM signer can sign messages that are malformed (e.g., violate 2787 [RFC5322], such as by having multiple instances of a field that is 2788 only permitted once), or that become malformed in transit, or that 2789 contain header or body content that is not true or valid. Use of 2790 DKIM on such messages might constitute an attack against a receiver, 2791 especially where additional credence is given to a signed message 2792 without adequate evaluation of the signer. 2794 These can represent serious attacks, but they have nothing to do with 2795 DKIM; they are attacks on the recipient, or on the wrongly identified 2796 author. 2798 Moreover, an agent would be incorrect to infer that all instances of 2799 a header field are signed just because one is. 2801 A genuine signature from the domain under attack can be obtained by 2802 legitimate means, but extra header fields can then be added, either 2803 by interception or by replay. In this scenario, DKIM can aid in 2804 detecting addition of specific fields in transit. This is done by 2805 having the signer list the field name(s) in the "h=" tag an extra 2806 time (e.g., "h=from:from:..." for a message with one From field), so 2807 that addition of an instance of that field downstream will render the 2808 signature unable to be verified. (See Section 3.5 for details.) 2809 This in essence is an explicit indication that the signer repudiates 2810 responsibility for such a malformed message. 2812 DKIM signs and validates the data it is told to and works correctly. 2813 So in this case, DKIM has done its job of delivering a validated 2814 domain (the "d=" value) and, given the semantics of a DKIM signature, 2815 essentially the signer has taken some responsibility for a 2816 problematic message. It is up to the identity assessor or some other 2817 subsequent agent to act on such messages as needed, such as degrading 2818 the trust of the message (or, indeed, of the signer), or by warning 2819 the recipient, or even refusing delivery. 2821 All components of the mail system that perform loose enforcement of 2822 other mail standards will need to revisit that posture when 2823 incorporating DKIM, especially when considering matters of potential 2824 attacks such as those described. 2826 9. References 2828 9.1. Normative References 2830 [FIPS-180-3-2008] 2831 U.S. Department of Commerce, "Secure Hash Standard", FIPS 2832 PUB 180-3, October 2008. 2834 [ITU-X660-1997] 2835 "Information Technology - ASN.1 encoding rules: 2836 Specification of Basic Encoding Rules (BER), Canonical 2837 Encoding Rules (CER) and Distinguished Encoding Rules 2838 (DER)", 1997. 2840 [RFC1034] Mockapetris, P., "DOMAIN NAMES - CONCEPTS AND FACILITIES", 2841 RFC 1034, November 1987. 2843 [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2844 Extensions (MIME) Part One: Format of Internet Message 2845 Bodies", RFC 2045, November 1996. 2847 [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2848 Extensions (MIME) Part Five: Conformance Criteria and 2849 Examples", RFC 2049, November 1996. 2851 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2852 Requirement Levels", BCP 14, RFC 2119, March 1997. 2854 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 2855 Standards (PKCS) #1: RSA Cryptography Specifications 2856 Version 2.1", RFC 3447, February 2003. 2858 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 2859 Specifications: ABNF", RFC 5234, January 2008. 2861 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 2862 October 2008. 2864 [RFC5322] Resnick, P., "Internet Message Format", RFC 5322, 2865 October 2008. 2867 [RFC5598] Crocker, D., "Internet Mail Architecture", RFC 5598, 2868 July 2009. 2870 [RFC5890] Klensin, J., "Internationalizing Domain Names in 2871 Applications (IDNA): Definitions and Document Framework", 2872 RFC 5890, August 2010. 2874 9.2. Informative References 2876 [BONEH03] "Remote Timing Attacks are Practical", Proceedings 12th 2877 USENIX Security Symposium, 2003. 2879 [I-D.DKIM-MAILINGLISTS] 2880 Kucherawy, M., "DKIM And Mailing Lists", 2881 I-D draft-ietf-dkim-mailinglists, June 2011. 2883 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 2884 10646", RFC 3629, June 2011. 2886 [RFC3766] Orman, H. and P. Hoffman, "Determining Strengths For 2887 Public Keys Used For Exchanging Symmetric Keys", BCP 86, 2888 RFC 3766, April 2004. 2890 [RFC3833] Atkins, D. and R. Austein, "Threat Analysis of the Domain 2891 Name System (DNS)", RFC 3833, August 2004. 2893 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 2894 Procedures for Message Header Fields", BCP 90, RFC 3864, 2895 September 2004. 2897 [RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S. 2898 Rose, "DNS Security Introduction and Requirements", 2899 RFC 4033, March 2005. 2901 [RFC4409] Gellens, R. and J. Klensin, "Message Submission for Mail", 2902 RFC 4409, April 2006. 2904 [RFC4686] Fenton, J., "Analysis of Threats Motivating DomainKeys 2905 Identified Mail (DKIM)", RFC 4686, September 2006. 2907 [RFC4732] Handley, M., Ed., Rescorla, E., Ed., and IAB, "Internet 2908 Denial-of-Service Considerations", RFC 4732, 2909 November 2006. 2911 [RFC4870] Delany, M., "Domain-Based Email Authentication Using 2912 Public Keys Advertised in the DNS (DomainKeys)", RFC 4870, 2913 May 2007. 2915 [RFC4871] Allman, E., Callas, J., Delany, M., Libbey, M., Fenton, 2916 J., and M. Thomas, "DomainKeys Identified Mail (DKIM) 2917 Signatures", RFC 4871, May 2007. 2919 [RFC4880] Callas, J., Donnerhacke, L., Finney, H., and R. Thayer, 2920 "OpenPGP Message Format", RFC 4880, November 2007. 2922 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 2923 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 2924 May 2008. 2926 [RFC5451] Kucherawy, M., "Message Header Field for Indicating 2927 Message Authentication Status", RFC 5451, April 2009. 2929 [RFC5585] Hansen, T., Crocker, D., and P. Hallam-Baker, "DomainKeys 2930 Identified Mail (DKIM) Service Overview", RFC 5585, 2931 July 2009. 2933 [RFC5672] Crocker, D., Ed., "RFC 4871 DomainKeys Identified Mail 2934 (DKIM) Signatures -- Update", RFC 5672, August 2009. 2936 [RFC5751] Ramsdell, B., "Secure/Multipurpose Internet Mail 2937 Extensions (S/MIME) Version 3.1 Message Specification", 2938 RFC 5751, January 2010. 2940 [RFC5863] Hansen, T., Siegel, E., Hallam-Baker, P., and D. Crocker, 2941 "DomainKeys Identified Mail (DKIM) Development, 2942 Deployment, and Operations", RFC 5863, May 2010. 2944 Appendix A. Example of Use (INFORMATIVE) 2946 This section shows the complete flow of an email from submission to 2947 final delivery, demonstrating how the various components fit 2948 together. The key used in this example is shown in Appendix C. 2950 A.1. The User Composes an Email 2952 From: Joe SixPack 2953 To: Suzie Q 2954 Subject: Is dinner ready? 2955 Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) 2956 Message-ID: <20030712040037.46341.5F8J@football.example.com> 2958 Hi. 2960 We lost the game. Are you hungry yet? 2962 Joe. 2964 Figure 1: The User Composes an Email 2966 A.2. The Email is Signed 2968 This email is signed by the example.com outbound email server and now 2969 looks like this: 2970 DKIM-Signature: v=1; a=rsa-sha256; s=brisbane; d=example.com; 2971 c=simple/simple; q=dns/txt; i=joe@football.example.com; 2972 h=Received : From : To : Subject : Date : Message-ID; 2973 bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=; 2974 b=AuUoFEfDxTDkHlLXSZEpZj79LICEps6eda7W3deTVFOk4yAUoqOB 2975 4nujc7YopdG5dWLSdNg6xNAZpOPr+kHxt1IrE+NahM6L/LbvaHut 2976 KVdkLLkpVaVVQPzeRDI009SO2Il5Lu7rDNH6mZckBdrIx0orEtZV 2977 4bmp/YzhwvcubU4=; 2978 Received: from client1.football.example.com [192.0.2.1] 2979 by submitserver.example.com with SUBMISSION; 2980 Fri, 11 Jul 2003 21:01:54 -0700 (PDT) 2981 From: Joe SixPack 2982 To: Suzie Q 2983 Subject: Is dinner ready? 2984 Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) 2985 Message-ID: <20030712040037.46341.5F8J@football.example.com> 2987 Hi. 2989 We lost the game. Are you hungry yet? 2991 Joe. 2993 The Email is Signed 2995 The signing email server requires access to the private key 2996 associated with the "brisbane" selector to generate this signature. 2998 A.3. The Email Signature is Verified 3000 The signature is normally verified by an inbound SMTP server or 3001 possibly the final delivery agent. However, intervening MTAs can 3002 also perform this verification if they choose to do so. The 3003 verification process uses the domain "example.com" extracted from the 3004 "d=" tag and the selector "brisbane" from the "s=" tag in the DKIM- 3005 Signature header field to form the DNS DKIM query for: 3006 brisbane._domainkey.example.com 3008 Signature verification starts with the physically last Received 3009 header field, the From header field, and so forth, in the order 3010 listed in the "h=" tag. Verification follows with a single CRLF 3011 followed by the body (starting with "Hi."). The email is canonically 3012 prepared for verifying with the "simple" method. The result of the 3013 query and subsequent verification of the signature is stored (in this 3014 example) in the X-Authentication-Results header field line. After 3015 successful verification, the email looks like this: 3016 X-Authentication-Results: shopping.example.net 3017 header.from=joe@football.example.com; dkim=pass 3018 Received: from mout23.football.example.com (192.168.1.1) 3019 by shopping.example.net with SMTP; 3020 Fri, 11 Jul 2003 21:01:59 -0700 (PDT) 3021 DKIM-Signature: v=1; a=rsa-sha256; s=brisbane; d=example.com; 3022 c=simple/simple; q=dns/txt; i=joe@football.example.com; 3023 h=Received : From : To : Subject : Date : Message-ID; 3024 bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=; 3025 b=AuUoFEfDxTDkHlLXSZEpZj79LICEps6eda7W3deTVFOk4yAUoqOB 3026 4nujc7YopdG5dWLSdNg6xNAZpOPr+kHxt1IrE+NahM6L/LbvaHut 3027 KVdkLLkpVaVVQPzeRDI009SO2Il5Lu7rDNH6mZckBdrIx0orEtZV 3028 4bmp/YzhwvcubU4=; 3029 Received: from client1.football.example.com [192.0.2.1] 3030 by submitserver.example.com with SUBMISSION; 3031 Fri, 11 Jul 2003 21:01:54 -0700 (PDT) 3032 From: Joe SixPack 3033 To: Suzie Q 3034 Subject: Is dinner ready? 3035 Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) 3036 Message-ID: <20030712040037.46341.5F8J@football.example.com> 3038 Hi. 3040 We lost the game. Are you hungry yet? 3042 Joe. 3044 Successful verification 3046 Appendix B. Usage Examples (INFORMATIVE) 3048 DKIM signing and validating can be used in different ways, for 3049 different operational scenarios. This Appendix discusses some common 3050 examples. 3052 NOTE: Descriptions in this Appendix are for informational purposes 3053 only. They describe various ways that DKIM can be used, given 3054 particular constraints and needs. In no case are these examples 3055 intended to be taken as providing explanation or guidance 3056 concerning DKIM specification details, when creating an 3057 implementation. 3059 B.1. Alternate Submission Scenarios 3061 In the most simple scenario, a user's MUA, MSA, and Internet 3062 (boundary) MTA are all within the same administrative environment, 3063 using the same domain name. Therefore, all of the components 3064 involved in submission and initial transfer are related. However, it 3065 is common for two or more of the components to be under independent 3066 administrative control. This creates challenges for choosing and 3067 administering the domain name to use for signing, and for its 3068 relationship to common email identity header fields. 3070 B.1.1. Delegated Business Functions 3072 Some organizations assign specific business functions to discrete 3073 groups, inside or outside the organization. The goal, then, is to 3074 authorize that group to sign some mail, but to constrain what 3075 signatures they can generate. DKIM selectors (the "s=" signature 3076 tag) facilitate this kind of restricted authorization. Examples of 3077 these outsourced business functions are legitimate email marketing 3078 providers and corporate benefits providers. 3080 Here, the delegated group needs to be able to send messages that are 3081 signed, using the email domain of the client company. At the same 3082 time, the client often is reluctant to register a key for the 3083 provider that grants the ability to send messages for arbitrary 3084 addresses in the domain. 3086 There are multiple ways to administer these usage scenarios. In one 3087 case, the client organization provides all of the public query 3088 service (for example, DNS) administration, and in another it uses DNS 3089 delegation to enable all ongoing administration of the DKIM key 3090 record by the delegated group. 3092 If the client organization retains responsibility for all of the DNS 3093 administration, the outsourcing company can generate a key pair, 3094 supplying the public key to the client company, which then registers 3095 it in the query service, using a unique selector. The client company 3096 retains control over the use of the delegated key because it retains 3097 the ability to revoke the key at any time. 3099 If the client wants the delegated group to do the DNS administration, 3100 it can have the domain name that is specified with the selector point 3101 to the provider's DNS server. The provider then creates and 3102 maintains all of the DKIM signature information for that selector. 3103 Hence, the client cannot provide constraints on the Local-part of 3104 addresses that get signed, but it can revoke the provider's signing 3105 rights by removing the DNS delegation record. 3107 B.1.2. PDAs and Similar Devices 3109 PDAs demonstrate the need for using multiple keys per domain. 3110 Suppose that John Doe wanted to be able to send messages using his 3111 corporate email address, jdoe@example.com, and his email device did 3112 not have the ability to make a Virtual Private Network (VPN) 3113 connection to the corporate network, either because the device is 3114 limited or because there are restrictions enforced by his Internet 3115 access provider. If the device was equipped with a private key 3116 registered for jdoe@example.com by the administrator of the 3117 example.com domain, and appropriate software to sign messages, John 3118 could sign the message on the device itself before transmission 3119 through the outgoing network of the access service provider. 3121 B.1.3. Roaming Users 3123 Roaming users often find themselves in circumstances where it is 3124 convenient or necessary to use an SMTP server other than their home 3125 server; examples are conferences and many hotels. In such 3126 circumstances, a signature that is added by the submission service 3127 will use an identity that is different from the user's home system. 3129 Ideally, roaming users would connect back to their home server using 3130 either a VPN or a SUBMISSION server running with SMTP AUTHentication 3131 on port 587. If the signing can be performed on the roaming user's 3132 laptop, then they can sign before submission, although the risk of 3133 further modification is high. If neither of these are possible, 3134 these roaming users will not be able to send mail signed using their 3135 own domain key. 3137 B.1.4. Independent (Kiosk) Message Submission 3139 Stand-alone services, such as walk-up kiosks and web-based 3140 information services, have no enduring email service relationship 3141 with the user, but users occasionally request that mail be sent on 3142 their behalf. For example, a website providing news often allows the 3143 reader to forward a copy of the article to a friend. This is 3144 typically done using the reader's own email address, to indicate who 3145 the author is. This is sometimes referred to as the "Evite problem", 3146 named after the website of the same name that allows a user to send 3147 invitations to friends. 3149 A common way this is handled is to continue to put the reader's email 3150 address in the From header field of the message, but put an address 3151 owned by the email posting site into the Sender header field. The 3152 posting site can then sign the message, using the domain that is in 3153 the Sender field. This provides useful information to the receiving 3154 email site, which is able to correlate the signing domain with the 3155 initial submission email role. 3157 Receiving sites often wish to provide their end users with 3158 information about mail that is mediated in this fashion. Although 3159 the real efficacy of different approaches is a subject for human 3160 factors usability research, one technique that is used is for the 3161 verifying system to rewrite the From header field, to indicate the 3162 address that was verified. For example: From: John Doe via 3163 news@news-site.example . (Note that such rewriting 3164 will break a signature, unless it is done after the verification pass 3165 is complete.) 3167 B.2. Alternate Delivery Scenarios 3169 Email is often received at a mailbox that has an address different 3170 from the one used during initial submission. In these cases, an 3171 intermediary mechanism operates at the address originally used and it 3172 then passes the message on to the final destination. This mediation 3173 process presents some challenges for DKIM signatures. 3175 B.2.1. Affinity Addresses 3177 "Affinity addresses" allow a user to have an email address that 3178 remains stable, even as the user moves among different email 3179 providers. They are typically associated with college alumni 3180 associations, professional organizations, and recreational 3181 organizations with which they expect to have a long-term 3182 relationship. These domains usually provide forwarding of incoming 3183 email, and they often have an associated Web application that 3184 authenticates the user and allows the forwarding address to be 3185 changed. However, these services usually depend on users sending 3186 outgoing messages through their own service providers' MTAs. Hence, 3187 mail that is signed with the domain of the affinity address is not 3188 signed by an entity that is administered by the organization owning 3189 that domain. 3191 With DKIM, affinity domains could use the Web application to allow 3192 users to register per-user keys to be used to sign messages on behalf 3193 of their affinity address. The user would take away the secret half 3194 of the key pair for signing, and the affinity domain would publish 3195 the public half in DNS for access by verifiers. 3197 This is another application that takes advantage of user-level 3198 keying, and domains used for affinity addresses would typically have 3199 a very large number of user-level keys. Alternatively, the affinity 3200 domain could handle outgoing mail, operating a mail submission agent 3201 that authenticates users before accepting and signing messages for 3202 them. This is of course dependent on the user's service provider not 3203 blocking the relevant TCP ports used for mail submission. 3205 B.2.2. Simple Address Aliasing (.forward) 3207 In some cases a recipient is allowed to configure an email address to 3208 cause automatic redirection of email messages from the original 3209 address to another, such as through the use of a Unix .forward file. 3210 In this case, messages are typically redirected by the mail handling 3211 service of the recipient's domain, without modification, except for 3212 the addition of a Received header field to the message and a change 3213 in the envelope recipient address. In this case, the recipient at 3214 the final address' mailbox is likely to be able to verify the 3215 original signature since the signed content has not changed, and DKIM 3216 is able to validate the message signature. 3218 B.2.3. Mailing Lists and Re-Posters 3220 There is a wide range of behaviors in services that take delivery of 3221 a message and then resubmit it. A primary example is with mailing 3222 lists (collectively called "forwarders" below), ranging from those 3223 that make no modification to the message itself, other than to add a 3224 Received header field and change the envelope information, to those 3225 that add header fields, change the Subject header field, add content 3226 to the body (typically at the end), or reformat the body in some 3227 manner. The simple ones produce messages that are quite similar to 3228 the automated alias services. More elaborate systems essentially 3229 create a new message. 3231 A Forwarder that does not modify the body or signed header fields of 3232 a message is likely to maintain the validity of the existing 3233 signature. It also could choose to add its own signature to the 3234 message. 3236 Forwarders which modify a message in a way that could make an 3237 existing signature invalid are particularly good candidates for 3238 adding their own signatures (e.g., mailing-list-name@example.net). 3240 Since (re-)signing is taking responsibility for the content of the 3241 message, these signing forwarders are likely to be selective, and 3242 forward or re-sign a message only if it is received with a valid 3243 signature or if they have some other basis for knowing that the 3244 message is not spoofed. 3246 A common practice among systems that are primarily redistributors of 3247 mail is to add a Sender header field to the message, to identify the 3248 address being used to sign the message. This practice will remove 3249 any preexisting Sender header field as required by [RFC5322]. The 3250 forwarder applies a new DKIM-Signature header field with the 3251 signature, public key, and related information of the forwarder. 3253 See [I-D.DKIM-MAILINGLISTS] for additional related topics and 3254 discussion. 3256 Appendix C. Creating a Public Key (INFORMATIVE) 3258 The default signature is an RSA signed SHA-256 digest of the complete 3259 email. For ease of explanation, the openssl command is used to 3260 describe the mechanism by which keys and signatures are managed. One 3261 way to generate a 1024-bit, unencrypted private key suitable for DKIM 3262 is to use openssl like this: 3263 $ openssl genrsa -out rsa.private 1024 3264 For increased security, the "-passin" parameter can also be added to 3265 encrypt the private key. Use of this parameter will require entering 3266 a password for several of the following steps. Servers may prefer to 3267 use hardware cryptographic support. 3269 The "genrsa" step results in the file rsa.private containing the key 3270 information similar to this: 3271 -----BEGIN RSA PRIVATE KEY----- 3272 MIICXwIBAAKBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkMoGeLnQg1fWn7/zYtIxN2SnFC 3273 jxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v/RtdC2UzJ1lWT947qR+Rcac2gb 3274 to/NMqJ0fzfVjH4OuKhitdY9tf6mcwGjaNBcWToIMmPSPDdQPNUYckcQ2QIDAQAB 3275 AoGBALmn+XwWk7akvkUlqb+dOxyLB9i5VBVfje89Teolwc9YJT36BGN/l4e0l6QX 3276 /1//6DWUTB3KI6wFcm7TWJcxbS0tcKZX7FsJvUz1SbQnkS54DJck1EZO/BLa5ckJ 3277 gAYIaqlA9C0ZwM6i58lLlPadX/rtHb7pWzeNcZHjKrjM461ZAkEA+itss2nRlmyO 3278 n1/5yDyCluST4dQfO8kAB3toSEVc7DeFeDhnC1mZdjASZNvdHS4gbLIA1hUGEF9m 3279 3hKsGUMMPwJBAPW5v/U+AWTADFCS22t72NUurgzeAbzb1HWMqO4y4+9Hpjk5wvL/ 3280 eVYizyuce3/fGke7aRYw/ADKygMJdW8H/OcCQQDz5OQb4j2QDpPZc0Nc4QlbvMsj 3281 7p7otWRO5xRa6SzXqqV3+F0VpqvDmshEBkoCydaYwc2o6WQ5EBmExeV8124XAkEA 3282 qZzGsIxVP+sEVRWZmW6KNFSdVUpk3qzK0Tz/WjQMe5z0UunY9Ax9/4PVhp/j61bf 3283 eAYXunajbBSOLlx4D+TunwJBANkPI5S9iylsbLs6NkaMHV6k5ioHBBmgCak95JGX 3284 GMot/L2x0IYyMLAz6oLWh2hm7zwtb0CgOrPo1ke44hFYnfc= 3285 -----END RSA PRIVATE KEY----- 3286 To extract the public-key component from the private key, use openssl 3287 like this: 3288 $ openssl rsa -in rsa.private -out rsa.public -pubout -outform PEM 3290 This results in the file rsa.public containing the key information 3291 similar to this: 3292 -----BEGIN PUBLIC KEY----- 3293 MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkM 3294 oGeLnQg1fWn7/zYtIxN2SnFCjxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v/R 3295 tdC2UzJ1lWT947qR+Rcac2gbto/NMqJ0fzfVjH4OuKhitdY9tf6mcwGjaNBcWToI 3296 MmPSPDdQPNUYckcQ2QIDAQAB 3297 -----END PUBLIC KEY----- 3299 This public-key data (without the BEGIN and END tags) is placed in 3300 the DNS: 3301 $ORIGIN _domainkey.example.org. 3302 brisbane IN TXT ("v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ" 3303 "KBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkMoGeLnQg1fWn7/zYt" 3304 "IxN2SnFCjxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v" 3305 "/RtdC2UzJ1lWT947qR+Rcac2gbto/NMqJ0fzfVjH4OuKhi" 3306 "tdY9tf6mcwGjaNBcWToIMmPSPDdQPNUYckcQ2QIDAQAB") 3308 C.1. Compatibility with DomainKeys Key Records 3310 DKIM key records were designed to be backwards-compatible in many 3311 cases with key records used by DomainKeys [RFC4870] (sometimes 3312 referred to as "selector records" in the DomainKeys context). One 3313 area of incompatibility warrants particular attention. The "g=" tag/ 3314 value may be used in DomainKeys and [RFC4871] key records to provide 3315 finer granularity of the validity of the key record to a specific 3316 local-part. A null "g=" value in DomainKeys is valid for all 3317 addresses in the domain. This differs from the usage in the original 3318 DKIM specification ([RFC4871]), where a null "g=" value is not valid 3319 for any address. In particular, see the example public key record in 3320 Section 3.2.3 of [RFC4870]. 3322 C.2. RFC4871 Compatibility 3324 Although the "g=" tag has been deprecated in this version of the DKIM 3325 specification (and thus MUST now be ignored), signers are advised not 3326 to include the "g=" tag in key records because some [RFC4871]- 3327 compliant verifiers will be in use for a considerable period to come. 3329 Appendix D. MUA Considerations (INFORMATIVE) 3331 When a DKIM signature is verified, the processing system sometimes 3332 makes the result available to the recipient user's MUA. How to 3333 present this information to the user in a way that helps them is a 3334 matter of continuing human factors usability research. The tendency 3335 is to have the MUA highlight the SDID, in an attempt to show the user 3336 the identity that is claiming responsibility for the message. An MUA 3337 might do this with visual cues such as graphics, or it might include 3338 the address in an alternate view, or it might even rewrite the 3339 original From address using the verified information. Some MUAs 3340 might indicate which header fields were protected by the validated 3341 DKIM signature. This could be done with a positive indication on the 3342 signed header fields, with a negative indication on the unsigned 3343 header fields, by visually hiding the unsigned header fields, or some 3344 combination of these. If an MUA uses visual indications for signed 3345 header fields, the MUA probably needs to be careful not to display 3346 unsigned header fields in a way that might be construed by the end 3347 user as having been signed. If the message has an l= tag whose value 3348 does not extend to the end of the message, the MUA might also hide or 3349 mark the portion of the message body that was not signed. 3351 The aforementioned information is not intended to be exhaustive. The 3352 MUA can choose to highlight, accentuate, hide, or otherwise display 3353 any other information that may, in the opinion of the MUA author, be 3354 deemed important to the end user. 3356 Appendix E. Changes since RFC4871 3358 o Abstract and introduction refined based on accumulated experience. 3360 o Various references updated. 3362 o Several errata resolved (see 3363 http://www.rfc-editor.org/errata_search.php?rfc=4871): 3365 * 1376 applied 3367 * 1377 applied 3369 * 1378 applied 3371 * 1379 applied 3373 * 1380 applied 3375 * 1381 applied 3377 * 1382 applied 3378 * 1383 discarded (no longer applies) 3380 * 1384 applied 3382 * 1386 applied 3384 * 1461 applied 3386 * 1487 applied 3388 * 1532 applied 3390 * 1596 applied 3392 o Introductory section enumerating relevant architectural documents 3393 added. 3395 o Introductory section briefly discussing the matter of data 3396 integrity added. 3398 o Allow tolerance of some clock drift. 3400 o Drop "g=" tag from key records. The implementation report 3401 indicates that it is not in use. 3403 o Remove errant note about wildcards in the DNS. 3405 o Remove SMTP-specific advice in most places. 3407 o Reduce (non-normative) recommended signature content list, and 3408 rework the text in that section. 3410 o Clarify signature generation algorithm by rewriting its pseudo- 3411 code. 3413 o Numerous terminology subsections added, imported from [RFC5672]. 3414 Also began using these terms throughout the document (e.g., SDID, 3415 AUID). 3417 o Sections added that specify input and output requirements. Input 3418 requirements address a security concern raised by the working 3419 group (see also new sections in Security Considerations). Output 3420 requirements are imported from [RFC5672]. 3422 o Appendix subsection added discussing compatibility with DomainKeys 3423 ([RFC4870]) records. 3425 o Refer to [RFC5451] as an example method of communicating the 3426 results of DKIM verification. 3428 o Remove advice about possible uses of the "l=" signature tag. 3430 o IANA registry update. 3432 o Add two new Security Considerations sections talking about 3433 malformed message attacks. 3435 o Various copy editing. 3437 Appendix F. Acknowledgements 3439 The previous IETF version of DKIM [RFC4871] was edited by: Eric 3440 Allman, Jon Callas, Mark Delany, Miles Libbey, Jim Fenton and Michael 3441 Thomas. 3443 That specification was the result of an extended, collaborative 3444 effort, including participation by: Russ Allbery, Edwin Aoki, Claus 3445 Assmann, Steve Atkins, Rob Austein, Fred Baker, Mark Baugher, Steve 3446 Bellovin, Nathaniel Borenstein, Dave Crocker, Michael Cudahy, Dennis 3447 Dayman, Jutta Degener, Frank Ellermann, Patrik Faeltstroem, Mark 3448 Fanto, Stephen Farrell, Duncan Findlay, Elliot Gillum, Olafur 3449 Gu[eth]mundsson, Phillip Hallam-Baker, Tony Hansen, Sam Hartman, 3450 Arvel Hathcock, Amir Herzberg, Paul Hoffman, Russ Housley, Craig 3451 Hughes, Cullen Jennings, Don Johnsen, Harry Katz, Murray S. 3452 Kucherawy, Barry Leiba, John Levine, Charles Lindsey, Simon 3453 Longsdale, David Margrave, Justin Mason, David Mayne, Thierry Moreau, 3454 Steve Murphy, Russell Nelson, Dave Oran, Doug Otis, Shamim Pirzada, 3455 Juan Altmayer Pizzorno, Sanjay Pol, Blake Ramsdell, Christian Renaud, 3456 Scott Renfro, Neil Rerup, Eric Rescorla, Dave Rossetti, Hector 3457 Santos, Jim Schaad, the Spamhaus.org team, Malte S. Stretz, Robert 3458 Sanders, Rand Wacker, Sam Weiler, and Dan Wing. 3460 The earlier DomainKeys was a primary source from which DKIM was 3461 derived. Further information about DomainKeys is at [RFC4870]. 3463 This revision received contributions from: Steve Atkins, Mark Delany, 3464 J.D. Falk, Jim Fenton, Michael Hammer, Barry Leiba, John Levine, 3465 Charles Lindsey, Jeff Macdonald, Franck Martin, Brett McDowell, Doug 3466 Otis, Bill Oxley, Hector Santos, Rolf Sonneveld, Michael Thomas, and 3467 Alessandro Vesely. 3469 Authors' Addresses 3471 D. Crocker (editor) 3472 Brandenburg InternetWorking 3473 675 Spruce Dr. 3474 Sunnyvale 3475 USA 3477 Phone: +1.408.246.8253 3478 Email: dcrocker@bbiw.net 3479 URI: http://bbiw.net 3481 Tony Hansen (editor) 3482 AT&T Laboratories 3483 200 Laurel Ave. South 3484 Middletown, NJ 07748 3485 USA 3487 Email: tony+dkimov@maillennium.att.com 3489 M. Kucherawy (editor) 3490 Cloudmark 3491 128 King St., 2nd Floor 3492 San Francisco, CA 94107 3493 USA 3495 Email: msk@cloudmark.com