idnits 2.17.1 draft-ietf-dkim-rfc4871bis-03.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 : ---------------------------------------------------------------------------- ** There are 2 instances of too long lines in the document, the longest one being 9 characters in excess of 72. -- The draft header indicates that this document obsoletes RFC4871, but the abstract doesn't seem to mention this, which it should. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == Line 1314 has weird spacing: '... email elec...' -- The document date (February 16, 2011) is 4790 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Missing Reference: 'FWS' is mentioned on line 958, but not defined == Unused Reference: 'ITU-X660-1997' is defined on line 2812, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'FIPS-180-2-2002' -- Possible downref: Non-RFC (?) normative reference: ref. 'ITU-X660-1997' ** Obsolete normative reference: RFC 3447 (Obsoleted by RFC 8017) ** Obsolete normative reference: RFC 3490 (Obsoleted by RFC 5890, RFC 5891) ** Obsolete normative reference: RFC 4234 (ref. 'RFC5234') (Obsoleted by RFC 5234) ** 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 5751 (Obsoleted by RFC 8551) Summary: 5 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 (if approved) T. Hansen, Ed. 5 Intended status: Standards Track AT&T Laboratories 6 Expires: August 20, 2011 M. Kucherawy, Ed. 7 Cloudmark 8 February 16, 2011 10 DomainKeys Identified Mail (DKIM) Signatures 11 draft-ietf-dkim-rfc4871bis-03 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 Status of this Memo 29 This Internet-Draft is submitted in full conformance with the 30 provisions of BCP 78 and BCP 79. 32 Internet-Drafts are working documents of the Internet Engineering 33 Task Force (IETF). Note that other groups may also distribute 34 working documents as Internet-Drafts. The list of current Internet- 35 Drafts is at http://datatracker.ietf.org/drafts/current/. 37 Internet-Drafts are draft documents valid for a maximum of six months 38 and may be updated, replaced, or obsoleted by other documents at any 39 time. It is inappropriate to use Internet-Drafts as reference 40 material or to cite them other than as "work in progress." 42 This Internet-Draft will expire on August 20, 2011. 44 Copyright Notice 46 Copyright (c) 2011 IETF Trust and the persons identified as the 47 document authors. All rights reserved. 49 This document is subject to BCP 78 and the IETF Trust's Legal 50 Provisions Relating to IETF Documents 51 (http://trustee.ietf.org/license-info) in effect on the date of 52 publication of this document. Please review these documents 53 carefully, as they describe your rights and restrictions with respect 54 to this document. Code Components extracted from this document must 55 include Simplified BSD License text as described in Section 4.e of 56 the Trust Legal Provisions and are provided without warranty as 57 described in the Simplified BSD License. 59 Table of Contents 61 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 62 1.1. Signing Identity . . . . . . . . . . . . . . . . . . . . . 5 63 1.2. Scalability . . . . . . . . . . . . . . . . . . . . . . . 5 64 1.3. Simple Key Management . . . . . . . . . . . . . . . . . . 5 65 1.4. Data Integrity . . . . . . . . . . . . . . . . . . . . . . 5 66 2. Terminology and Definitions . . . . . . . . . . . . . . . . . 6 67 2.1. Signers . . . . . . . . . . . . . . . . . . . . . . . . . 6 68 2.2. Verifiers . . . . . . . . . . . . . . . . . . . . . . . . 6 69 2.3. Identity . . . . . . . . . . . . . . . . . . . . . . . . . 6 70 2.4. Identifier . . . . . . . . . . . . . . . . . . . . . . . . 6 71 2.5. Signing Domain Identifier (SDID) . . . . . . . . . . . . . 6 72 2.6. Agent or User Identifier (AUID) . . . . . . . . . . . . . 7 73 2.7. Identity Assessor . . . . . . . . . . . . . . . . . . . . 7 74 2.8. Whitespace . . . . . . . . . . . . . . . . . . . . . . . . 7 75 2.9. Common ABNF Tokens . . . . . . . . . . . . . . . . . . . . 8 76 2.10. Imported ABNF Tokens . . . . . . . . . . . . . . . . . . . 8 77 2.11. DKIM-Quoted-Printable . . . . . . . . . . . . . . . . . . 8 78 3. Protocol Elements . . . . . . . . . . . . . . . . . . . . . . 9 79 3.1. Selectors . . . . . . . . . . . . . . . . . . . . . . . . 10 80 3.2. Tag=Value Lists . . . . . . . . . . . . . . . . . . . . . 11 81 3.3. Signing and Verification Algorithms . . . . . . . . . . . 12 82 3.4. Canonicalization . . . . . . . . . . . . . . . . . . . . . 14 83 3.5. The DKIM-Signature Header Field . . . . . . . . . . . . . 18 84 3.6. Key Management and Representation . . . . . . . . . . . . 27 85 3.7. Computing the Message Hashes . . . . . . . . . . . . . . . 32 86 3.8. Signing by Parent Domains . . . . . . . . . . . . . . . . 34 87 3.9. Relationship between SDID and AUID . . . . . . . . . . . . 34 88 4. Semantics of Multiple Signatures . . . . . . . . . . . . . . . 35 89 4.1. Example Scenarios . . . . . . . . . . . . . . . . . . . . 35 90 4.2. Interpretation . . . . . . . . . . . . . . . . . . . . . . 37 91 5. Signer Actions . . . . . . . . . . . . . . . . . . . . . . . . 38 92 5.1. Determine Whether the Email Should Be Signed and by 93 Whom . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 94 5.2. Select a Private Key and Corresponding Selector 95 Information . . . . . . . . . . . . . . . . . . . . . . . 38 97 5.3. Normalize the Message to Prevent Transport Conversions . . 39 98 5.4. Determine the Header Fields to Sign . . . . . . . . . . . 39 99 5.5. Recommended Signature Content . . . . . . . . . . . . . . 41 100 5.6. Compute the Message Hash and Signature . . . . . . . . . . 43 101 5.7. Insert the DKIM-Signature Header Field . . . . . . . . . . 43 102 6. Verifier Actions . . . . . . . . . . . . . . . . . . . . . . . 44 103 6.1. Extract Signatures from the Message . . . . . . . . . . . 45 104 6.2. Communicate Verification Results . . . . . . . . . . . . . 50 105 6.3. Interpret Results/Apply Local Policy . . . . . . . . . . . 51 106 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 52 107 7.1. DKIM-Signature Tag Specifications . . . . . . . . . . . . 52 108 7.2. DKIM-Signature Query Method Registry . . . . . . . . . . . 52 109 7.3. DKIM-Signature Canonicalization Registry . . . . . . . . . 53 110 7.4. _domainkey DNS TXT Record Tag Specifications . . . . . . . 53 111 7.5. DKIM Key Type Registry . . . . . . . . . . . . . . . . . . 54 112 7.6. DKIM Hash Algorithms Registry . . . . . . . . . . . . . . 55 113 7.7. DKIM Service Types Registry . . . . . . . . . . . . . . . 55 114 7.8. DKIM Selector Flags Registry . . . . . . . . . . . . . . . 55 115 7.9. DKIM-Signature Header Field . . . . . . . . . . . . . . . 56 116 8. Security Considerations . . . . . . . . . . . . . . . . . . . 56 117 8.1. Misuse of Body Length Limits ("l=" Tag) . . . . . . . . . 56 118 8.2. Misappropriated Private Key . . . . . . . . . . . . . . . 57 119 8.3. Key Server Denial-of-Service Attacks . . . . . . . . . . . 58 120 8.4. Attacks Against the DNS . . . . . . . . . . . . . . . . . 58 121 8.5. Replay Attacks . . . . . . . . . . . . . . . . . . . . . . 59 122 8.6. Limits on Revoking Keys . . . . . . . . . . . . . . . . . 59 123 8.7. Intentionally Malformed Key Records . . . . . . . . . . . 59 124 8.8. Intentionally Malformed DKIM-Signature Header Fields . . . 60 125 8.9. Information Leakage . . . . . . . . . . . . . . . . . . . 60 126 8.10. Remote Timing Attacks . . . . . . . . . . . . . . . . . . 60 127 8.11. Reordered Header Fields . . . . . . . . . . . . . . . . . 60 128 8.12. RSA Attacks . . . . . . . . . . . . . . . . . . . . . . . 60 129 8.13. Inappropriate Signing by Parent Domains . . . . . . . . . 61 130 8.14. Attacks Involving Addition of Header Fields . . . . . . . 61 131 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 62 132 9.1. Normative References . . . . . . . . . . . . . . . . . . . 62 133 9.2. Informative References . . . . . . . . . . . . . . . . . . 63 134 Appendix A. Example of Use (INFORMATIVE) . . . . . . . . . . . . 64 135 A.1. The User Composes an Email . . . . . . . . . . . . . . . . 64 136 A.2. The Email is Signed . . . . . . . . . . . . . . . . . . . 64 137 A.3. The Email Signature is Verified . . . . . . . . . . . . . 65 138 Appendix B. Usage Examples (INFORMATIVE) . . . . . . . . . . . . 66 139 B.1. Alternate Submission Scenarios . . . . . . . . . . . . . . 67 140 B.2. Alternate Delivery Scenarios . . . . . . . . . . . . . . . 69 141 Appendix C. Creating a Public Key (INFORMATIVE) . . . . . . . . . 71 142 Appendix D. MUA Considerations . . . . . . . . . . . . . . . . . 72 143 Appendix E. Acknowledgements . . . . . . . . . . . . . . . . . . 72 144 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 73 146 1. Introduction 148 DomainKeys Identified Mail (DKIM) permits a person, role, or 149 organization to claim some responsibility for a message by 150 associating a domain name [RFC1034] with the message [RFC5322]. This 151 can be an author's organization, an operational relay or one of their 152 agents. Assertion of responsibility is validated through a 153 cryptographic signature and querying the signer's domain directly to 154 retrieve the appropriate public key. Message transit from author to 155 recipient is through relays that typically make no substantive change 156 to the message content and thus preserve the DKIM signature. A 157 message can contain multiple signatures, from the same or different 158 organizations involved with the message. 160 The approach taken by DKIM differs from previous approaches to 161 message signing (e.g., Secure/Multipurpose Internet Mail Extensions 162 (S/MIME) [RFC1847], OpenPGP [RFC4880]) in that: 164 o the message signature is written as a message header field so that 165 neither human recipients nor existing MUA (Mail User Agent) 166 software is confused by signature-related content appearing in the 167 message body; 169 o there is no dependency on public and private key pairs being 170 issued by well-known, trusted certificate authorities; 172 o there is no dependency on the deployment of any new Internet 173 protocols or services for public key distribution or revocation; 175 o signature verification failure does not force rejection of the 176 message; 178 o no attempt is made to include encryption as part of the mechanism; 180 o message archiving is not a design goal. 182 DKIM: 184 o is compatible with the existing email infrastructure and 185 transparent to the fullest extent possible; 187 o requires minimal new infrastructure; 189 o can be implemented independently of clients in order to reduce 190 deployment time; 192 o can be deployed incrementally; 193 o allows delegation of signing to third parties. 195 1.1. Signing Identity 197 DKIM separates the question of the identity of the signer of the 198 message from the purported author of the message. In particular, a 199 signature includes the identity of the signer. Verifiers can use the 200 signing information to decide how they want to process the message. 201 The signing identity is included as part of the signature header 202 field. 204 INFORMATIVE RATIONALE: The signing identity specified by a DKIM 205 signature is not required to match an address in any particular 206 header field because of the broad methods of interpretation by 207 recipient mail systems, including MUAs. 209 1.2. Scalability 211 DKIM is designed to support the extreme scalability requirements that 212 characterize the email identification problem. There are currently 213 over 70 million domains and a much larger number of individual 214 addresses. DKIM seeks to preserve the positive aspects of the 215 current email infrastructure, such as the ability for anyone to 216 communicate with anyone else without introduction. 218 1.3. Simple Key Management 220 DKIM differs from traditional hierarchical public-key systems in that 221 no Certificate Authority infrastructure is required; the verifier 222 requests the public key from a repository in the domain of the 223 claimed signer directly rather than from a third party. 225 The DNS is proposed as the initial mechanism for the public keys. 226 Thus, DKIM currently depends on DNS administration and the security 227 of the DNS system. DKIM is designed to be extensible to other key 228 fetching services as they become available. 230 1.4. Data Integrity 232 A DKIM signature associates the d= name with the computed hash of 233 some or all of the message (see Section 3.7) in order to prevent the 234 re-use of the signature with different messages. Verifying the 235 signature asserts that the hashed content has not changed since it 236 was signed, and asserts nothing else about "protecting" the end-to- 237 end integrity of the message. 239 2. Terminology and Definitions 241 This section defines terms used in the rest of the document. 243 DKIM is designed to operate within the Internet Mail service, as 244 defined in [RFC5598]. Basic email terminology is taken from that 245 specification. 247 Syntax descriptions use Augmented BNF (ABNF) [RFC5234]. 249 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 250 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 251 document are to be interpreted as described in [RFC2119]. 253 2.1. Signers 255 Elements in the mail system that sign messages on behalf of a domain 256 are referred to as signers. These may be MUAs (Mail User Agents), 257 MSAs (Mail Submission Agents), MTAs (Mail Transfer Agents), or other 258 agents such as mailing list exploders. In general, any signer will 259 be involved in the injection of a message into the message system in 260 some way. The key issue is that a message must be signed before it 261 leaves the administrative domain of the signer. 263 2.2. Verifiers 265 Elements in the mail system that verify signatures are referred to as 266 verifiers. These may be MTAs, Mail Delivery Agents (MDAs), or MUAs. 267 In most cases it is expected that verifiers will be close to an end 268 user (reader) of the message or some consuming agent such as a 269 mailing list exploder. 271 2.3. Identity 273 A person, role, or organization. In the context of DKIM, examples 274 include author, author's organization, an ISP along the handling 275 path, an independent trust assessment service, and a mailing list 276 operator. 278 2.4. Identifier 280 A label that refers to an identity. 282 2.5. Signing Domain Identifier (SDID) 284 A single domain name that is the mandatory payload output of DKIM and 285 that refers to the identity claiming responsibility for introduction 286 of a message into the mail stream. For DKIM processing, the name has 287 only basic domain name semantics; any possible owner-specific 288 semantics are outside the scope of DKIM. It is specified in 289 Section 3.5. 291 2.6. Agent or User Identifier (AUID) 293 A single identifier that refers to the agent or user on behalf of 294 whom the Signing Domain Identifier (SDID) has taken responsibility. 295 The AUID comprises a domain name and an optional . The 296 domain name is the same as that used for the SDID or is a sub-domain 297 of it. For DKIM processing, the domain name portion of the AUID has 298 only basic domain name semantics; any possible owner-specific 299 semantics are outside the scope of DKIM. It is specified in 300 Section 3.5 . 302 2.7. Identity Assessor 304 A module that consumes DKIM's mandatory payload, which is the 305 responsible Signing Domain Identifier (SDID). The module is 306 dedicated to the assessment of the delivered identifier. Other DKIM 307 (and non-DKIM) values can also be delivered to this module as well as 308 to a more general message evaluation filtering engine. However, this 309 additional activity is outside the scope of the DKIM signature 310 specification. 312 2.8. Whitespace 314 There are three forms of whitespace: 316 o WSP represents simple whitespace, i.e., a space or a tab character 317 (formal definition in [RFC5234]). 319 o LWSP is linear whitespace, defined as WSP plus CRLF (formal 320 definition in [RFC5234]). 322 o FWS is folding whitespace. It allows multiple lines separated by 323 CRLF followed by at least one whitespace, to be joined. 325 The formal ABNF for these are (WSP and LWSP are given for information 326 only): 327 WSP = SP / HTAB 328 LWSP = *(WSP / CRLF WSP) 329 FWS = [*WSP CRLF] 1*WSP 331 The definition of FWS is identical to that in [RFC5322] except for 332 the exclusion of obs-FWS. 334 2.9. Common ABNF Tokens 336 The following ABNF tokens are used elsewhere in this document: 337 hyphenated-word = ALPHA [ *(ALPHA / DIGIT / "-") (ALPHA / DIGIT) ] 338 ALPHADIGITPS = (ALPHA / DIGIT / "+" / "/") 339 base64string = ALPHADIGITPS *([FWS] ALPHADIGITPS) 340 [ [FWS] "=" [ [FWS] "=" ] ] 341 hdr-name = field-name 342 qp-hdr-value = dkim-quoted-printable ; with "|" encoded 344 2.10. Imported ABNF Tokens 346 The following tokens are imported from other RFCs as noted. Those 347 RFCs should be considered definitive. 349 The following tokens are imported from [RFC5321]: 351 o "Local-part" (implementation warning: this permits quoted strings) 353 o "sub-domain" 355 The following tokens are imported from [RFC5322]: 357 o "field-name" (name of a header field) 359 o "dot-atom-text" (in the Local-part of an email address) 361 The following tokens are imported from [RFC2045]: 363 o "qp-section" (a single line of quoted-printable-encoded text) 365 o "hex-octet" (a quoted-printable encoded octet) 367 INFORMATIVE NOTE: Be aware that the ABNF in [RFC2045] does not 368 obey the rules of [RFC5234] and must be interpreted accordingly, 369 particularly as regards case folding. 371 Other tokens not defined herein are imported from [RFC5234]. These 372 are intuitive primitives such as SP, HTAB, WSP, ALPHA, DIGIT, CRLF, 373 etc. 375 2.11. DKIM-Quoted-Printable 377 The DKIM-Quoted-Printable encoding syntax resembles that described in 378 Quoted-Printable [RFC2045], Section 6.7: any character MAY be encoded 379 as an "=" followed by two hexadecimal digits from the alphabet 380 "0123456789ABCDEF" (no lowercase characters permitted) representing 381 the hexadecimal-encoded integer value of that character. All control 382 characters (those with values < %x20), 8-bit characters (values > 383 %x7F), and the characters DEL (%x7F), SPACE (%x20), and semicolon 384 (";", %x3B) MUST be encoded. Note that all whitespace, including 385 SPACE, CR, and LF characters, MUST be encoded. After encoding, FWS 386 MAY be added at arbitrary locations in order to avoid excessively 387 long lines; such whitespace is NOT part of the value, and MUST be 388 removed before decoding. 390 ABNF: 392 dkim-quoted-printable = *(FWS / hex-octet / dkim-safe-char) 393 ; hex-octet is from RFC2045 394 dkim-safe-char = %x21-3A / %x3C / %x3E-7E 395 ; '!' - ':', '<', '>' - '~' 396 ; Characters not listed as "mail-safe" in 397 ; [RFC2049] are also not recommended. 399 INFORMATIVE NOTE: DKIM-Quoted-Printable differs from Quoted- 400 Printable as defined in [RFC2045] in several important ways: 402 1. Whitespace in the input text, including CR and LF, must be 403 encoded. [RFC2045] does not require such encoding, and does 404 not permit encoding of CR or LF characters that are part of a 405 CRLF line break. 407 2. Whitespace in the encoded text is ignored. This is to allow 408 tags encoded using DKIM-Quoted-Printable to be wrapped as 409 needed. In particular, [RFC2045] requires that line breaks in 410 the input be represented as physical line breaks; that is not 411 the case here. 413 3. The "soft line break" syntax ("=" as the last non-whitespace 414 character on the line) does not apply. 416 4. DKIM-Quoted-Printable does not require that encoded lines be 417 no more than 76 characters long (although there may be other 418 requirements depending on the context in which the encoded 419 text is being used). 421 3. Protocol Elements 423 Protocol Elements are conceptual parts of the protocol that are not 424 specific to either signers or verifiers. The protocol descriptions 425 for signers and verifiers are described in later sections (Signer 426 Actions (Section 5) and Verifier Actions (Section 6)). NOTE: This 427 section must be read in the context of those sections. 429 3.1. Selectors 431 To support multiple concurrent public keys per signing domain, the 432 key namespace is subdivided using "selectors". For example, 433 selectors might indicate the names of office locations (e.g., 434 "sanfrancisco", "coolumbeach", and "reykjavik"), the signing date 435 (e.g., "january2005", "february2005", etc.), or even an individual 436 user. 438 Selectors are needed to support some important use cases. For 439 example: 441 o Domains that want to delegate signing capability for a specific 442 address for a given duration to a partner, such as an advertising 443 provider or other outsourced function. 445 o Domains that want to allow frequent travelers to send messages 446 locally without the need to connect with a particular MSA. 448 o "Affinity" domains (e.g., college alumni associations) that 449 provide forwarding of incoming mail, but that do not operate a 450 mail submission agent for outgoing mail. 452 Periods are allowed in selectors and are component separators. When 453 keys are retrieved from the DNS, periods in selectors define DNS 454 label boundaries in a manner similar to the conventional use in 455 domain names. Selector components might be used to combine dates 456 with locations, for example, "march2005.reykjavik". In a DNS 457 implementation, this can be used to allow delegation of a portion of 458 the selector namespace. 460 ABNF: 461 selector = sub-domain *( "." sub-domain ) 463 The number of public keys and corresponding selectors for each domain 464 is determined by the domain owner. Many domain owners will be 465 satisfied with just one selector, whereas administratively 466 distributed organizations may choose to manage disparate selectors 467 and key pairs in different regions or on different email servers. 469 Beyond administrative convenience, selectors make it possible to 470 seamlessly replace public keys on a routine basis. If a domain 471 wishes to change from using a public key associated with selector 472 "january2005" to a public key associated with selector 473 "february2005", it merely makes sure that both public keys are 474 advertised in the public-key repository concurrently for the 475 transition period during which email may be in transit prior to 476 verification. At the start of the transition period, the outbound 477 email servers are configured to sign with the "february2005" private 478 key. At the end of the transition period, the "january2005" public 479 key is removed from the public-key repository. 481 INFORMATIVE NOTE: A key may also be revoked as described below. 482 The distinction between revoking and removing a key selector 483 record is subtle. When phasing out keys as described above, a 484 signing domain would probably simply remove the key record after 485 the transition period. However, a signing domain could elect to 486 revoke the key (but maintain the key record) for a further period. 487 There is no defined semantic difference between a revoked key and 488 a removed key. 490 While some domains may wish to make selector values well known, 491 others will want to take care not to allocate selector names in a way 492 that allows harvesting of data by outside parties. For example, if 493 per-user keys are issued, the domain owner will need to make the 494 decision as to whether to associate this selector directly with the 495 name of a registered end-user, or make it some unassociated random 496 value, such as a fingerprint of the public key. 498 INFORMATIVE OPERATIONS NOTE: Reusing a selector with a new key 499 (for example, changing the key associated with a user's name) 500 makes it impossible to tell the difference between a message that 501 didn't verify because the key is no longer valid versus a message 502 that is actually forged. For this reason, signers are ill-advised 503 to reuse selectors for new keys. A better strategy is to assign 504 new keys to new selectors. 506 3.2. Tag=Value Lists 508 DKIM uses a simple "tag=value" syntax in several contexts, including 509 in messages and domain signature records. 511 Values are a series of strings containing either plain text, "base64" 512 text (as defined in [RFC2045], Section 6.8), "qp-section" (ibid, 513 Section 6.7), or "dkim-quoted-printable" (as defined in Section 2.6). 514 The name of the tag will determine the encoding of each value. 515 Unencoded semicolon (";") characters MUST NOT occur in the tag value, 516 since that separates tag-specs. 518 INFORMATIVE IMPLEMENTATION NOTE: Although the "plain text" defined 519 below (as "tag-value") only includes 7-bit characters, an 520 implementation that wished to anticipate future standards would be 521 advised not to preclude the use of UTF8-encoded text in tag=value 522 lists. 524 Formally, the ABNF syntax rules are as follows: 525 tag-list = tag-spec 0*( ";" tag-spec ) [ ";" ] 526 tag-spec = [FWS] tag-name [FWS] "=" [FWS] tag-value [FWS] 527 tag-name = ALPHA 0*ALNUMPUNC 528 tag-value = [ tval 0*( 1*(WSP / FWS) tval ) ] 529 ; WSP and FWS prohibited at beginning and end 530 tval = 1*VALCHAR 531 VALCHAR = %x21-3A / %x3C-7E 532 ; EXCLAMATION to TILDE except SEMICOLON 533 ALNUMPUNC = ALPHA / DIGIT / "_" 535 Note that WSP is allowed anywhere around tags. In particular, any 536 WSP after the "=" and any WSP before the terminating ";" is not part 537 of the value; however, WSP inside the value is significant. 539 Tags MUST be interpreted in a case-sensitive manner. Values MUST be 540 processed as case sensitive unless the specific tag description of 541 semantics specifies case insensitivity. 543 Tags with duplicate names MUST NOT occur within a single tag-list; if 544 a tag name does occur more than once, the entire tag-list is invalid. 546 Whitespace within a value MUST be retained unless explicitly excluded 547 by the specific tag description. 549 Tag=value pairs that represent the default value MAY be included to 550 aid legibility. 552 Unrecognized tags MUST be ignored. 554 Tags that have an empty value are not the same as omitted tags. An 555 omitted tag is treated as having the default value; a tag with an 556 empty value explicitly designates the empty string as the value. 558 3.3. Signing and Verification Algorithms 560 DKIM supports multiple digital signature algorithms. Two algorithms 561 are defined by this specification at this time: rsa-sha1 and rsa- 562 sha256. Signers MUST implement and SHOULD sign using rsa-sha256. 563 Verifiers MUST implement rsa-sha256. 565 INFORMATIVE NOTE: Although sha256 is strongly encouraged, some 566 senders of low-security messages (such as routine newsletters) may 567 prefer to use sha1 because of reduced CPU requirements to compute 568 a sha1 hash. In general, sha256 should always be used whenever 569 possible. 571 3.3.1. The rsa-sha1 Signing Algorithm 573 The rsa-sha1 Signing Algorithm computes a message hash as described 574 in Section 3.7 below using SHA-1 [FIPS-180-2-2002] as the hash-alg. 575 That hash is then signed by the signer using the RSA algorithm 576 (defined in PKCS#1 version 1.5 [RFC3447]) as the crypt-alg and the 577 signer's private key. The hash MUST NOT be truncated or converted 578 into any form other than the native binary form before being signed. 579 The signing algorithm SHOULD use a public exponent of 65537. 581 3.3.2. The rsa-sha256 Signing Algorithm 583 The rsa-sha256 Signing Algorithm computes a message hash as described 584 in Section 3.7 below using SHA-256 [FIPS-180-2-2002] as the hash-alg. 585 That hash is then signed by the signer using the RSA algorithm 586 (defined in PKCS#1 version 1.5 [RFC3447]) as the crypt-alg and the 587 signer's private key. The hash MUST NOT be truncated or converted 588 into any form other than the native binary form before being signed. 590 3.3.3. Key Sizes 592 Selecting appropriate key sizes is a trade-off between cost, 593 performance, and risk. Since short RSA keys more easily succumb to 594 off-line attacks, signers MUST use RSA keys of at least 1024 bits for 595 long-lived keys. Verifiers MUST be able to validate signatures with 596 keys ranging from 512 bits to 2048 bits, and they MAY be able to 597 validate signatures with larger keys. Verifier policies may use the 598 length of the signing key as one metric for determining whether a 599 signature is acceptable. 601 Factors that should influence the key size choice include the 602 following: 604 o The practical constraint that large (e.g., 4096 bit) keys may not 605 fit within a 512-byte DNS UDP response packet 607 o The security constraint that keys smaller than 1024 bits are 608 subject to off-line attacks 610 o Larger keys impose higher CPU costs to verify and sign email 612 o Keys can be replaced on a regular basis, thus their lifetime can 613 be relatively short 615 o The security goals of this specification are modest compared to 616 typical goals of other systems that employ digital signatures 618 See [RFC3766] for further discussion on selecting key sizes. 620 3.3.4. Other Algorithms 622 Other algorithms MAY be defined in the future. Verifiers MUST ignore 623 any signatures using algorithms that they do not implement. 625 3.4. Canonicalization 627 Some mail systems modify email in transit, potentially invalidating a 628 signature. For most signers, mild modification of email is 629 immaterial to validation of the DKIM domain name's use. For such 630 signers, a canonicalization algorithm that survives modest in-transit 631 modification is preferred. 633 Other signers demand that any modification of the email, however 634 minor, result in a signature verification failure. These signers 635 prefer a canonicalization algorithm that does not tolerate in-transit 636 modification of the signed email. 638 Some signers may be willing to accept modifications to header fields 639 that are within the bounds of email standards such as [RFC5322], but 640 are unwilling to accept any modification to the body of messages. 642 To satisfy all requirements, two canonicalization algorithms are 643 defined for each of the header and the body: a "simple" algorithm 644 that tolerates almost no modification and a "relaxed" algorithm that 645 tolerates common modifications such as whitespace replacement and 646 header field line rewrapping. A signer MAY specify either algorithm 647 for header or body when signing an email. If no canonicalization 648 algorithm is specified by the signer, the "simple" algorithm defaults 649 for both header and body. Verifiers MUST implement both 650 canonicalization algorithms. Note that the header and body may use 651 different canonicalization algorithms. Further canonicalization 652 algorithms MAY be defined in the future; verifiers MUST ignore any 653 signatures that use unrecognized canonicalization algorithms. 655 Canonicalization simply prepares the email for presentation to the 656 signing or verification algorithm. It MUST NOT change the 657 transmitted data in any way. Canonicalization of header fields and 658 body are described below. 660 NOTE: This section assumes that the message is already in "network 661 normal" format (text is ASCII encoded, lines are separated with CRLF 662 characters, etc.). See also Section 5.3 for information about 663 normalizing the message. 665 3.4.1. The "simple" Header Canonicalization Algorithm 667 The "simple" header canonicalization algorithm does not change header 668 fields in any way. Header fields MUST be presented to the signing or 669 verification algorithm exactly as they are in the message being 670 signed or verified. In particular, header field names MUST NOT be 671 case folded and whitespace MUST NOT be changed. 673 3.4.2. The "relaxed" Header Canonicalization Algorithm 675 The "relaxed" header canonicalization algorithm MUST apply the 676 following steps in order: 678 o Convert all header field names (not the header field values) to 679 lowercase. For example, convert "SUBJect: AbC" to "subject: AbC". 681 o Unfold all header field continuation lines as described in 682 [RFC5322]; in particular, lines with terminators embedded in 683 continued header field values (that is, CRLF sequences followed by 684 WSP) MUST be interpreted without the CRLF. Implementations MUST 685 NOT remove the CRLF at the end of the header field value. 687 o Convert all sequences of one or more WSP characters to a single SP 688 character. WSP characters here include those before and after a 689 line folding boundary. 691 o Delete all WSP characters at the end of each unfolded header field 692 value. 694 o Delete any WSP characters remaining before and after the colon 695 separating the header field name from the header field value. The 696 colon separator MUST be retained. 698 3.4.3. The "simple" Body Canonicalization Algorithm 700 The "simple" body canonicalization algorithm ignores all empty lines 701 at the end of the message body. An empty line is a line of zero 702 length after removal of the line terminator. If there is no body or 703 no trailing CRLF on the message body, a CRLF is added. It makes no 704 other changes to the message body. In more formal terms, the 705 "simple" body canonicalization algorithm converts "0*CRLF" at the end 706 of the body to a single "CRLF". 708 Note that a completely empty or missing body is canonicalized as a 709 single "CRLF"; that is, the canonicalized length will be 2 octets. 711 The sha1 value (in base64) for an empty body (canonicalized to a 712 "CRLF") is: 713 uoq1oCgLlTqpdDX/iUbLy7J1Wic= 714 The sha256 value is: 715 frcCV1k9oG9oKj3dpUqdJg1PxRT2RSN/XKdLCPjaYaY= 717 3.4.4. The "relaxed" Body Canonicalization Algorithm 719 The "relaxed" body canonicalization algorithm MUST apply the 720 following steps (a) and (b) in order: 722 a. Reduce whitespace: 724 * Ignore all whitespace at the end of lines. Implementations 725 MUST NOT remove the CRLF at the end of the line. 727 * Reduce all sequences of WSP within a line to a single SP 728 character. 730 b. Ignore all empty lines at the end of the message body. "Empty 731 line" is defined in Section 3.4.3. If the body is non-empty, but 732 does not end with a CRLF, a CRLF is added. (For email, this is 733 only possible when using extensions to SMTP or non-SMTP transport 734 mechanisms.) 736 The sha1 value (in base64) for an empty body (canonicalized to a null 737 input) is: 738 2jmj7l5rSw0yVb/vlWAYkK/YBwk= 739 The sha256 value is: 740 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU= 742 INFORMATIVE NOTE: It should be noted that the relaxed body 743 canonicalization algorithm may enable certain types of extremely 744 crude "ASCII Art" attacks where a message may be conveyed by 745 adjusting the spacing between words. If this is a concern, the 746 "simple" body canonicalization algorithm should be used instead. 748 3.4.5. Body Length Limits 750 A body length count MAY be specified to limit the signature 751 calculation to an initial prefix of the body text, measured in 752 octets. If the body length count is not specified, the entire 753 message body is signed. 755 INFORMATIVE RATIONALE: This capability is provided because it is 756 very common for mailing lists to add trailers to messages (e.g., 757 instructions how to get off the list). Until those messages are 758 also signed, the body length count is a useful tool for the 759 verifier since it may as a matter of policy accept messages having 760 valid signatures with extraneous data. 762 INFORMATIVE IMPLEMENTATION NOTE: Using body length limits enables 763 an attack in which an attacker modifies a message to include 764 content that solely benefits the attacker. It is possible for the 765 appended content to completely replace the original content in the 766 end recipient's eyes and to defeat duplicate message detection 767 algorithms. To avoid this attack, signers should be wary of using 768 this tag, and verifiers might wish to ignore the tag or remove 769 text that appears after the specified content length, perhaps 770 based on other criteria. 772 The body length count allows the signer of a message to permit data 773 to be appended to the end of the body of a signed message. The body 774 length count MUST be calculated following the canonicalization 775 algorithm; for example, any whitespace ignored by a canonicalization 776 algorithm is not included as part of the body length count. Signers 777 of MIME messages that include a body length count SHOULD be sure that 778 the length extends to the closing MIME boundary string. 780 INFORMATIVE IMPLEMENTATION NOTE: A signer wishing to ensure that 781 the only acceptable modifications are to add to the MIME postlude 782 would use a body length count encompassing the entire final MIME 783 boundary string, including the final "--CRLF". A signer wishing 784 to allow additional MIME parts but not modification of existing 785 parts would use a body length count extending through the final 786 MIME boundary string, omitting the final "--CRLF". Note that this 787 only works for some MIME types, e.g., multipart/mixed but not 788 multipart/signed. 790 A body length count of zero means that the body is completely 791 unsigned. 793 Signers wishing to ensure that no modification of any sort can occur 794 should specify the "simple" canonicalization algorithm for both 795 header and body and omit the body length count. 797 3.4.6. Canonicalization Examples (INFORMATIVE) 799 In the following examples, actual whitespace is used only for 800 clarity. The actual input and output text is designated using 801 bracketed descriptors: "" for a space character, "" for a 802 tab character, and "" for a carriage-return/line-feed sequence. 803 For example, "X Y" and "XY" represent the same three 804 characters. 806 Example 1: A message reading: 807 A: X 808 B : Y 809 Z 810 811 C 812 D E 813 814 816 when canonicalized using relaxed canonicalization for both header and 817 body results in a header reading: 818 a:X 819 b:Y Z 821 and a body reading: 822 C 823 D E 825 Example 2: The same message canonicalized using simple 826 canonicalization for both header and body results in a header 827 reading: 828 A: X 829 B : Y 830 Z 832 and a body reading: 833 C 834 D E 836 Example 3: When processed using relaxed header canonicalization and 837 simple body canonicalization, the canonicalized version has a header 838 of: 839 a:X 840 b:Y Z 842 and a body reading: 843 C 844 D E 846 3.5. The DKIM-Signature Header Field 848 The signature of the email is stored in the DKIM-Signature header 849 field. This header field contains all of the signature and key- 850 fetching data. The DKIM-Signature value is a tag-list as described 851 in Section 3.2. 853 The DKIM-Signature header field SHOULD be treated as though it were a 854 trace header field as defined in Section 3.6 of [RFC5322], and hence 855 SHOULD NOT be reordered and SHOULD be prepended to the message. 857 The DKIM-Signature header field being created or verified is always 858 included in the signature calculation, after the rest of the header 859 fields being signed; however, when calculating or verifying the 860 signature, the value of the "b=" tag (signature value) of that DKIM- 861 Signature header field MUST be treated as though it were an empty 862 string. Unknown tags in the DKIM-Signature header field MUST be 863 included in the signature calculation but MUST be otherwise ignored 864 by verifiers. Other DKIM-Signature header fields that are included 865 in the signature should be treated as normal header fields; in 866 particular, the "b=" tag is not treated specially. 868 The encodings for each field type are listed below. Tags described 869 as qp-section are encoded as described in Section 6.7 of MIME Part 870 One [RFC2045], with the additional conversion of semicolon characters 871 to "=3B"; intuitively, this is one line of quoted-printable encoded 872 text. The dkim-quoted-printable syntax is defined in Section 2.11. 874 Tags on the DKIM-Signature header field along with their type and 875 requirement status are shown below. Unrecognized tags MUST be 876 ignored. 878 v= Version (MUST be included). This tag defines the version of this 879 specification that applies to the signature record. It MUST have 880 the value "1". Note that verifiers must do a string comparison on 881 this value; for example, "1" is not the same as "1.0". 883 ABNF: 884 sig-v-tag = %x76 [FWS] "=" [FWS] "1" 886 INFORMATIVE NOTE: DKIM-Signature version numbers are expected 887 to increase arithmetically as new versions of this 888 specification are released. 890 a= The algorithm used to generate the signature (plain-text; 891 REQUIRED). Verifiers MUST support "rsa-sha1" and "rsa-sha256"; 892 signers SHOULD sign using "rsa-sha256". 894 ABNF: 896 sig-a-tag = %x61 [FWS] "=" [FWS] sig-a-tag-alg 897 sig-a-tag-alg = sig-a-tag-k "-" sig-a-tag-h 898 sig-a-tag-k = "rsa" / x-sig-a-tag-k 899 sig-a-tag-h = "sha1" / "sha256" / x-sig-a-tag-h 900 x-sig-a-tag-k = ALPHA *(ALPHA / DIGIT) 901 ; for later extension 902 x-sig-a-tag-h = ALPHA *(ALPHA / DIGIT) 903 ; for later extension 905 b= The signature data (base64; REQUIRED). Whitespace is ignored in 906 this value and MUST be ignored when reassembling the original 907 signature. In particular, the signing process can safely insert 908 FWS in this value in arbitrary places to conform to line-length 909 limits. See Signer Actions (Section 5) for how the signature is 910 computed. 912 ABNF: 913 sig-b-tag = %x62 [FWS] "=" [FWS] sig-b-tag-data 914 sig-b-tag-data = base64string 916 bh= The hash of the canonicalized body part of the message as 917 limited by the "l=" tag (base64; REQUIRED). Whitespace is ignored 918 in this value and MUST be ignored when reassembling the original 919 signature. In particular, the signing process can safely insert 920 FWS in this value in arbitrary places to conform to line-length 921 limits. See Section 3.7 for how the body hash is computed. 923 ABNF: 924 sig-bh-tag = %x62 %x68 [FWS] "=" [FWS] sig-bh-tag-data 925 sig-bh-tag-data = base64string 927 c= Message canonicalization (plain-text; OPTIONAL, default is 928 "simple/simple"). This tag informs the verifier of the type of 929 canonicalization used to prepare the message for signing. It 930 consists of two names separated by a "slash" (%d47) character, 931 corresponding to the header and body canonicalization algorithms 932 respectively. These algorithms are described in Section 3.4. If 933 only one algorithm is named, that algorithm is used for the header 934 and "simple" is used for the body. For example, "c=relaxed" is 935 treated the same as "c=relaxed/simple". 937 ABNF: 938 sig-c-tag = %x63 [FWS] "=" [FWS] sig-c-tag-alg 939 ["/" sig-c-tag-alg] 940 sig-c-tag-alg = "simple" / "relaxed" / x-sig-c-tag-alg 941 x-sig-c-tag-alg = hyphenated-word ; for later extension 943 d= The SDID claiming responsibility for an introduction of a message 944 into the mail stream (plain-text; REQUIRED). Hence, the SDID 945 value is used to form the query for the public key. The SDID MUST 946 correspond to a valid DNS name under which the DKIM key record is 947 published. The conventions and semantics used by a signer to 948 create and use a specific SDID are outside the scope of the DKIM 949 Signing specification, as is any use of those conventions and 950 semantics. When presented with a signature that does not meet 951 these requirements, verifiers MUST consider the signature invalid. 953 Internationalized domain names MUST be encoded as described in 954 [RFC3490]. 956 ABNF: 958 sig-d-tag = %x64 [FWS] "=" [FWS] domain-name 959 domain-name = sub-domain 1*("." sub-domain) 960 ; from RFC 5321 Domain, but excluding address-literal 962 h= Signed header fields (plain-text, but see description; REQUIRED). 963 A colon-separated list of header field names that identify the 964 header fields presented to the signing algorithm. The field MUST 965 contain the complete list of header fields in the order presented 966 to the signing algorithm. The field MAY contain names of header 967 fields that do not exist when signed; nonexistent header fields do 968 not contribute to the signature computation (that is, they are 969 treated as the null input, including the header field name, the 970 separating colon, the header field value, and any CRLF 971 terminator). The field MUST NOT include the DKIM-Signature header 972 field that is being created or verified, but may include others. 973 Folding whitespace (FWS) MAY be included on either side of the 974 colon separator. Header field names MUST be compared against 975 actual header field names in a case-insensitive manner. This list 976 MUST NOT be empty. See Section 5.4 for a discussion of choosing 977 header fields to sign. 979 ABNF: 980 sig-h-tag = %x68 [FWS] "=" [FWS] hdr-name 981 0*( [FWS] ":" [FWS] hdr-name ) 983 INFORMATIVE EXPLANATION: By "signing" header fields that do not 984 actually exist, a signer can prevent insertion of those header 985 fields before verification. However, since a signer cannot 986 possibly know what header fields might be created in the 987 future, and that some MUAs might present header fields that are 988 embedded inside a message (e.g., as a message/rfc822 content 989 type), the security of this solution is not total. 991 INFORMATIVE EXPLANATION: The exclusion of the header field name 992 and colon as well as the header field value for non-existent 993 header fields prevents an attacker from inserting an actual 994 header field with a null value. 996 i= The Agent or User Identifier (AUID) on behalf of which the SDID is 997 taking responsibility (dkim-quoted-printable; OPTIONAL, default is 998 an empty Local-part followed by an "@" followed by the domain from 999 the "d=" tag). 1001 The syntax is a standard email address where the Local-part MAY be 1002 omitted. The domain part of the address MUST be the same as, or a 1003 subdomain of, the value of the "d=" tag. 1005 Internationalized domain names MUST be converted using the steps 1006 listed in Section 4 of [RFC3490] using the "ToASCII" function. 1008 ABNF: 1010 sig-i-tag = %x69 [FWS] "=" [FWS] [ Local-part ] 1011 "@" domain-name 1013 The AUID is specified as having the same syntax as an email 1014 address, but is not required to have the same semantics. Notably, 1015 the domain name is not required to be registered in the DNS -- so 1016 it might not resolve in a query -- and the Local-part MAY be drawn 1017 from a namespace unrelated to any mailbox. The details of the 1018 structure and semantics for the namespace are determined by the 1019 Signer. Any knowledge or use of those details by verifiers or 1020 assessors is outside the scope of the DKIM Signing specification. 1021 The Signer MAY choose to use the same namespace for its AUIDs as 1022 its users' email addresses or MAY choose other means of 1023 representing its users. However, the signer SHOULD use the same 1024 AUID for each message intended to be evaluated as being within the 1025 same sphere of responsibility, if it wishes to offer receivers the 1026 option of using the AUID as a stable identifier that is finer 1027 grained than the SDID. 1029 INFORMATIVE NOTE: The Local-part of the "i=" tag is optional 1030 because in some cases a signer may not be able to establish a 1031 verified individual identity. In such cases, the signer might 1032 wish to assert that although it is willing to go as far as 1033 signing for the domain, it is unable or unwilling to commit to 1034 an individual user name within their domain. It can do so by 1035 including the domain part but not the Local-part of the 1036 identity. 1038 INFORMATIVE DISCUSSION: This specification does not require the 1039 value of the "i=" tag to match the identity in any message 1040 header fields. This is considered to be a verifier policy 1041 issue. Constraints between the value of the "i=" tag and other 1042 identities in other header fields seek to apply basic 1043 authentication into the semantics of trust associated with a 1044 role such as content author. Trust is a broad and complex 1045 topic and trust mechanisms are subject to highly creative 1046 attacks. The real-world efficacy of any but the most basic 1047 bindings between the "i=" value and other identities is not 1048 well established, nor is its vulnerability to subversion by an 1049 attacker. Hence reliance on the use of these options should be 1050 strictly limited. In particular, it is not at all clear to 1051 what extent a typical end-user recipient can rely on any 1052 assurances that might be made by successful use of the "i=" 1053 options. 1055 l= Body length count (plain-text unsigned decimal integer; OPTIONAL, 1056 default is entire body). This tag informs the verifier of the 1057 number of octets in the body of the email after canonicalization 1058 included in the cryptographic hash, starting from 0 immediately 1059 following the CRLF preceding the body. This value MUST NOT be 1060 larger than the actual number of octets in the canonicalized 1061 message body. 1063 INFORMATIVE IMPLEMENTATION WARNING: Use of the "l=" tag might 1064 allow display of fraudulent content without appropriate warning 1065 to end users. The "l=" tag is intended for increasing 1066 signature robustness when sending to mailing lists that both 1067 modify their content and do not sign their messages. However, 1068 using the "l=" tag enables attacks in which an intermediary 1069 with malicious intent modifies a message to include content 1070 that solely benefits the attacker. It is possible for the 1071 appended content to completely replace the original content in 1072 the end recipient's eyes and to defeat duplicate message 1073 detection algorithms. Examples are described in Security 1074 Considerations Section 8. To avoid this attack, signers should 1075 be extremely wary of using this tag, and verifiers might wish 1076 to ignore the tag or remove text that appears after the 1077 specified content length. 1079 INFORMATIVE NOTE: The value of the "l=" tag is constrained to 1080 76 decimal digits. This constraint is not intended to predict 1081 the size of future messages or to require implementations to 1082 use an integer representation large enough to represent the 1083 maximum possible value, but is intended to remind the 1084 implementer to check the length of this and all other tags 1085 during verification and to test for integer overflow when 1086 decoding the value. Implementers may need to limit the actual 1087 value expressed to a value smaller than 10^76, e.g., to allow a 1088 message to fit within the available storage space. 1090 ABNF: 1091 sig-l-tag = %x6c [FWS] "=" [FWS] 1092 1*76DIGIT 1094 q= A colon-separated list of query methods used to retrieve the 1095 public key (plain-text; OPTIONAL, default is "dns/txt"). Each 1096 query method is of the form "type[/options]", where the syntax and 1097 semantics of the options depend on the type and specified options. 1098 If there are multiple query mechanisms listed, the choice of query 1099 mechanism MUST NOT change the interpretation of the signature. 1100 Implementations MUST use the recognized query mechanisms in the 1101 order presented. Unrecognized query mechanisms MUST be ignored. 1103 Currently, the only valid value is "dns/txt", which defines the 1104 DNS TXT record lookup algorithm described elsewhere in this 1105 document. The only option defined for the "dns" query type is 1106 "txt", which MUST be included. Verifiers and signers MUST support 1107 "dns/txt". 1109 ABNF: 1110 sig-q-tag = %x71 [FWS] "=" [FWS] sig-q-tag-method 1111 *([FWS] ":" [FWS] sig-q-tag-method) 1112 sig-q-tag-method = "dns/txt" / x-sig-q-tag-type 1113 ["/" x-sig-q-tag-args] 1114 x-sig-q-tag-type = hyphenated-word ; for future extension 1115 x-sig-q-tag-args = qp-hdr-value 1117 s= The selector subdividing the namespace for the "d=" (domain) tag 1118 (plain-text; REQUIRED). 1120 ABNF: 1121 sig-s-tag = %x73 [FWS] "=" [FWS] selector 1123 t= Signature Timestamp (plain-text unsigned decimal integer; 1124 RECOMMENDED, default is an unknown creation time). The time that 1125 this signature was created. The format is the number of seconds 1126 since 00:00:00 on January 1, 1970 in the UTC time zone. The value 1127 is expressed as an unsigned integer in decimal ASCII. This value 1128 is not constrained to fit into a 31- or 32-bit integer. 1129 Implementations SHOULD be prepared to handle values up to at least 1130 10^12 (until approximately AD 200,000; this fits into 40 bits). 1131 To avoid denial-of-service attacks, implementations MAY consider 1132 any value longer than 12 digits to be infinite. Leap seconds are 1133 not counted. Implementations MAY ignore signatures that have a 1134 timestamp in the future. 1136 ABNF: 1137 sig-t-tag = %x74 [FWS] "=" [FWS] 1*12DIGIT 1138 x= Signature Expiration (plain-text unsigned decimal integer; 1139 RECOMMENDED, default is no expiration). The format is the same as 1140 in the "t=" tag, represented as an absolute date, not as a time 1141 delta from the signing timestamp. The value is expressed as an 1142 unsigned integer in decimal ASCII, with the same constraints on 1143 the value in the "t=" tag. Signatures MAY be considered invalid 1144 if the verification time at the verifier is past the expiration 1145 date. The verification time should be the time that the message 1146 was first received at the administrative domain of the verifier if 1147 that time is reliably available; otherwise the current time should 1148 be used. The value of the "x=" tag MUST be greater than the value 1149 of the "t=" tag if both are present. 1151 INFORMATIVE NOTE: The "x=" tag is not intended as an anti- 1152 replay defense. 1154 INFORMATIVE NOTE: Due to clock drift, the receiver's notion of 1155 when to consider the signature expired may not match exactly 1156 when the sender is expecting. Receivers MAY add a 'fudge 1157 factor' to allow for such possible drift. 1159 ABNF: 1160 sig-x-tag = %x78 [FWS] "=" [FWS] 1161 1*12DIGIT 1163 z= Copied header fields (dkim-quoted-printable, but see description; 1164 OPTIONAL, default is null). A vertical-bar-separated list of 1165 selected header fields present when the message was signed, 1166 including both the field name and value. It is not required to 1167 include all header fields present at the time of signing. This 1168 field need not contain the same header fields listed in the "h=" 1169 tag. The header field text itself must encode the vertical bar 1170 ("|", %x7C) character (i.e., vertical bars in the "z=" text are 1171 meta-characters, and any actual vertical bar characters in a 1172 copied header field must be encoded). Note that all whitespace 1173 must be encoded, including whitespace between the colon and the 1174 header field value. After encoding, FWS MAY be added at arbitrary 1175 locations in order to avoid excessively long lines; such 1176 whitespace is NOT part of the value of the header field, and MUST 1177 be removed before decoding. 1179 The header fields referenced by the "h=" tag refer to the fields 1180 in the [RFC5322] header of the message, not to any copied fields 1181 in the "z=" tag. Copied header field values are for diagnostic 1182 use. 1184 Header fields with characters requiring conversion (perhaps from 1185 legacy MTAs that are not [RFC5322] compliant) SHOULD be converted 1186 as described in MIME Part Three [RFC2047]. 1188 ABNF: 1189 sig-z-tag = %x7A [FWS] "=" [FWS] sig-z-tag-copy 1190 *( "|" [FWS] sig-z-tag-copy ) 1191 sig-z-tag-copy = hdr-name [FWS] ":" qp-hdr-value 1193 INFORMATIVE EXAMPLE of a signature header field spread across 1194 multiple continuation lines: 1195 DKIM-Signature: v=1; a=rsa-sha256; d=example.net; s=brisbane; 1196 c=simple; q=dns/txt; i=@eng.example.net; 1197 t=1117574938; x=1118006938; 1198 h=from:to:subject:date; 1199 z=From:foo@eng.example.net|To:joe@example.com| 1200 Subject:demo=20run|Date:July=205,=202005=203:44:08=20PM=20-0700; 1201 bh=MTIzNDU2Nzg5MDEyMzQ1Njc4OTAxMjM0NTY3ODkwMTI=; 1202 b=dzdVyOfAKCdLXdJOc9G2q8LoXSlEniSbav+yuU4zGeeruD00lszZVoG4ZHRNiYzR 1204 3.6. Key Management and Representation 1206 Signature applications require some level of assurance that the 1207 verification public key is associated with the claimed signer. Many 1208 applications achieve this by using public key certificates issued by 1209 a trusted third party. However, DKIM can achieve a sufficient level 1210 of security, with significantly enhanced scalability, by simply 1211 having the verifier query the purported signer's DNS entry (or some 1212 security-equivalent) in order to retrieve the public key. 1214 DKIM keys can potentially be stored in multiple types of key servers 1215 and in multiple formats. The storage and format of keys are 1216 irrelevant to the remainder of the DKIM algorithm. 1218 Parameters to the key lookup algorithm are the type of the lookup 1219 (the "q=" tag), the domain of the signer (the "d=" tag of the DKIM- 1220 Signature header field), and the selector (the "s=" tag). 1222 public_key = dkim_find_key(q_val, d_val, s_val) 1224 This document defines a single binding, using DNS TXT records to 1225 distribute the keys. Other bindings may be defined in the future. 1227 3.6.1. Textual Representation 1229 It is expected that many key servers will choose to present the keys 1230 in an otherwise unstructured text format (for example, an XML form 1231 would not be considered to be unstructured text for this purpose). 1232 The following definition MUST be used for any DKIM key represented in 1233 an otherwise unstructured textual form. 1235 The overall syntax is a tag-list as described in Section 3.2. The 1236 current valid tags are described below. Other tags MAY be present 1237 and MUST be ignored by any implementation that does not understand 1238 them. 1240 v= Version of the DKIM key record (plain-text; RECOMMENDED, default 1241 is "DKIM1"). If specified, this tag MUST be set to "DKIM1" 1242 (without the quotes). This tag MUST be the first tag in the 1243 record. Records beginning with a "v=" tag with any other value 1244 MUST be discarded. Note that verifiers must do a string 1245 comparison on this value; for example, "DKIM1" is not the same as 1246 "DKIM1.0". 1248 ABNF: 1249 key-v-tag = %x76 [FWS] "=" [FWS] %x44 %x4B %x49 %x4D %x31 1251 h= Acceptable hash algorithms (plain-text; OPTIONAL, defaults to 1252 allowing all algorithms). A colon-separated list of hash 1253 algorithms that might be used. Signers and Verifiers MUST support 1254 the "sha256" hash algorithm. Verifiers MUST also support the 1255 "sha1" hash algorithm. Unrecognized hash algorithms MUST be 1256 ignored. 1258 ABNF: 1259 key-h-tag = %x68 [FWS] "=" [FWS] key-h-tag-alg 1260 0*( [FWS] ":" [FWS] key-h-tag-alg ) 1261 key-h-tag-alg = "sha1" / "sha256" / x-key-h-tag-alg 1262 x-key-h-tag-alg = hyphenated-word ; for future extension 1263 k= Key type (plain-text; OPTIONAL, default is "rsa"). Signers and 1264 verifiers MUST support the "rsa" key type. The "rsa" key type 1265 indicates that an ASN.1 DER-encoded [ITU-X660-1997] RSAPublicKey 1266 [RFC3447] (see Sections Section 3.1 and A.1.1) is being used in 1267 the "p=" tag. (Note: the "p=" tag further encodes the value using 1268 the base64 algorithm.) Unrecognized key types MUST be ignored. 1270 ABNF: 1271 key-k-tag = %x76 [FWS] "=" [FWS] key-k-tag-type 1272 key-k-tag-type = "rsa" / x-key-k-tag-type 1273 x-key-k-tag-type = hyphenated-word ; for future extension 1275 n= Notes that might be of interest to a human (qp-section; OPTIONAL, 1276 default is empty). No interpretation is made by any program. 1277 This tag should be used sparingly in any key server mechanism that 1278 has space limitations (notably DNS). This is intended for use by 1279 administrators, not end users. 1281 ABNF: 1282 key-n-tag = %x6e [FWS] "=" [FWS] qp-section 1284 p= Public-key data (base64; REQUIRED). An empty value means that 1285 this public key has been revoked. The syntax and semantics of 1286 this tag value before being encoded in base64 are defined by the 1287 "k=" tag. 1289 INFORMATIVE RATIONALE: If a private key has been compromised or 1290 otherwise disabled (e.g., an outsourcing contract has been 1291 terminated), a signer might want to explicitly state that it 1292 knows about the selector, but all messages using that selector 1293 should fail verification. Verifiers should ignore any DKIM- 1294 Signature header fields with a selector referencing a revoked 1295 key. 1297 ABNF: 1298 key-p-tag = %x70 [FWS] "=" [ [FWS] base64string] 1300 INFORMATIVE NOTE: A base64string is permitted to include white 1301 space (FWS) at arbitrary places; however, any CRLFs must be 1302 followed by at least one WSP character. Implementors and 1303 administrators are cautioned to ensure that selector TXT 1304 records conform to this specification. 1306 s= Service Type (plain-text; OPTIONAL; default is "*"). A colon- 1307 separated list of service types to which this record applies. 1308 Verifiers for a given service type MUST ignore this record if the 1309 appropriate type is not listed. Unrecognized service types MUST 1310 be ignored. Currently defined service types are as follows: 1312 * matches all service types 1314 email electronic mail (not necessarily limited to SMTP) 1316 This tag is intended to constrain the use of keys for other 1317 purposes, should use of DKIM be defined by other services in the 1318 future. 1320 ABNF: 1321 key-s-tag = %x73 [FWS] "=" [FWS] key-s-tag-type 1322 0*( [FWS] ":" [FWS] key-s-tag-type ) 1323 key-s-tag-type = "email" / "*" / x-key-s-tag-type 1324 x-key-s-tag-type = hyphenated-word ; for future extension 1326 t= Flags, represented as a colon-separated list of names (plain- 1327 text; OPTIONAL, default is no flags set). Unrecognized flags MUST 1328 be ignored. The defined flags are as follows: 1330 y This domain is testing DKIM. Verifiers MUST NOT treat messages 1331 from signers in testing mode differently from unsigned email, even 1332 should the signature fail to verify. Verifiers MAY wish to track 1333 testing mode results to assist the signer. 1335 s Any DKIM-Signature header fields using the "i=" tag MUST have the 1336 same domain value on the right-hand side of the "@" in the "i=" 1337 tag and the value of the "d=" tag. That is, the "i=" domain MUST 1338 NOT be a subdomain of "d=". Use of this flag is RECOMMENDED 1339 unless subdomaining is required. 1341 ABNF: 1342 key-t-tag = %x74 [FWS] "=" [FWS] key-t-tag-flag 1343 0*( [FWS] ":" [FWS] key-t-tag-flag ) 1344 key-t-tag-flag = "y" / "s" / x-key-t-tag-flag 1345 x-key-t-tag-flag = hyphenated-word ; for future extension 1347 Unrecognized flags MUST be ignored. 1349 3.6.2. DNS Binding 1351 A binding using DNS TXT records as a key service is hereby defined. 1352 All implementations MUST support this binding. 1354 3.6.2.1. Namespace 1356 All DKIM keys are stored in a subdomain named "_domainkey". Given a 1357 DKIM-Signature field with a "d=" tag of "example.com" and an "s=" tag 1358 of "foo.bar", the DNS query will be for 1359 "foo.bar._domainkey.example.com". 1361 INFORMATIVE OPERATIONAL NOTE: Wildcard DNS records (e.g., 1362 *.bar._domainkey.example.com) do not make sense in this context 1363 and should not be used. Note also that wildcards within domains 1364 (e.g., s._domainkey.*.example.com) are not supported by the DNS. 1366 3.6.2.2. Resource Record Types for Key Storage 1368 The DNS Resource Record type used is specified by an option to the 1369 query-type ("q=") tag. The only option defined in this base 1370 specification is "txt", indicating the use of a TXT Resource Record 1371 (RR). A later extension of this standard may define another RR type. 1373 Strings in a TXT RR MUST be concatenated together before use with no 1374 intervening whitespace. TXT RRs MUST be unique for a particular 1375 selector name; that is, if there are multiple records in an RRset, 1376 the results are undefined. 1378 TXT RRs are encoded as described in Section 3.6.1 1380 3.7. Computing the Message Hashes 1382 Both signing and verifying message signatures start with a step of 1383 computing two cryptographic hashes over the message. Signers will 1384 choose the parameters of the signature as described in Signer Actions 1385 Section 5; verifiers will use the parameters specified in the DKIM- 1386 Signature header field being verified. In the following discussion, 1387 the names of the tags in the DKIM-Signature header field that either 1388 exists (when verifying) or will be created (when signing) are used. 1389 Note that canonicalization (Section 3.4) is only used to prepare the 1390 email for signing or verifying; it does not affect the transmitted 1391 email in any way. 1393 The signer/verifier MUST compute two hashes, one over the body of the 1394 message and one over the selected header fields of the message. 1396 Signers MUST compute them in the order shown. Verifiers MAY compute 1397 them in any order convenient to the verifier, provided that the 1398 result is semantically identical to the semantics that would be the 1399 case had they been computed in this order. 1401 In hash step 1, the signer/verifier MUST hash the message body, 1402 canonicalized using the body canonicalization algorithm specified in 1403 the "c=" tag and then truncated to the length specified in the "l=" 1404 tag. That hash value is then converted to base64 form and inserted 1405 into (signers) or compared to (verifiers) the "bh=" tag of the DKIM- 1406 Signature header field. 1408 In hash step 2, the signer/verifier MUST pass the following to the 1409 hash algorithm in the indicated order. 1411 1. The header fields specified by the "h=" tag, in the order 1412 specified in that tag, and canonicalized using the header 1413 canonicalization algorithm specified in the "c=" tag. Each 1414 header field MUST be terminated with a single CRLF. 1416 2. The DKIM-Signature header field that exists (verifying) or will 1417 be inserted (signing) in the message, with the value of the "b=" 1418 tag (including all surrounding whitespace) deleted (i.e., treated 1419 as the empty string), canonicalized using the header 1420 canonicalization algorithm specified in the "c=" tag, and without 1421 a trailing CRLF. 1423 All tags and their values in the DKIM-Signature header field are 1424 included in the cryptographic hash with the sole exception of the 1425 value portion of the "b=" (signature) tag, which MUST be treated as 1426 the null string. All tags MUST be included even if they might not be 1427 understood by the verifier. The header field MUST be presented to 1428 the hash algorithm after the body of the message rather than with the 1429 rest of the header fields and MUST be canonicalized as specified in 1430 the "c=" (canonicalization) tag. The DKIM-Signature header field 1431 MUST NOT be included in its own h= tag, although other DKIM-Signature 1432 header fields MAY be signed (see Section 4). 1434 When calculating the hash on messages that will be transmitted using 1435 base64 or quoted-printable encoding, signers MUST compute the hash 1436 after the encoding. Likewise, the verifier MUST incorporate the 1437 values into the hash before decoding the base64 or quoted-printable 1438 text. However, the hash MUST be computed before transport level 1439 encodings such as SMTP "dot-stuffing" (the modification of lines 1440 beginning with a "." to avoid confusion with the SMTP end-of-message 1441 marker, as specified in [RFC5321]). 1443 With the exception of the canonicalization procedure described in 1444 Section 3.4, the DKIM signing process treats the body of messages as 1445 simply a string of octets. DKIM messages MAY be either in plain-text 1446 or in MIME format; no special treatment is afforded to MIME content. 1447 Message attachments in MIME format MUST be included in the content 1448 that is signed. 1450 More formally, the ABNF of the algorithm for the signature is as 1451 follows: 1452 body-hash = bh-hash-alg (canon-body, l-param) 1453 data-hash = a-hash-alg (h-headers, D-SIG, content-hash) 1454 signature = sig-alg (d-domain, selector, data-hash) 1456 where: 1458 body-hash: is the output of a function to hash the Body. 1460 bh-hash-alg: is the hashing algorithm specified in the "bh" 1461 parameter. 1463 canon-body: is a canonicalized representation of the body. 1465 l-param: is the value of the l= length parameter. 1467 data-hash: is the output from hashing the header, the 1468 DOSETA-Signature header, and the Content hash. 1470 a-hash-alg: is the hash algorithm specified by the "a=" tag, 1471 h-headers: is the list of headers to be signed, as specified in 1472 the h= parameter. 1474 D-SIG: is the canonicalized DOSETA-Signature field sans the 1475 signature value itself. 1477 canon-body: is the canonicalized Body as defined in Section 3.4 1478 (excluding the DKIM-Signature field). 1480 signature: is the signature value produced by the signing 1481 algorithm. 1483 sig-alg: is the signature algorithm specified by the "a=" tag, 1485 d-domain: is the domain name specified in the d= parameter. 1487 selector: is the value of the s= selector parameter 1489 NOTE: Many digital signature APIs provide both hashing and 1490 application of the RSA private key using a single "sign()" 1491 primitive. When using such an API, the last two steps in the 1492 algorithm would probably be combined into a single call that would 1493 perform both the "a-hash-alg" and the "sig-alg". 1495 3.8. Signing by Parent Domains 1497 In some circumstances, it is desirable for a domain to apply a 1498 signature on behalf of any of its subdomains without the need to 1499 maintain separate selectors (key records) in each subdomain. By 1500 default, private keys corresponding to key records can be used to 1501 sign messages for any subdomain of the domain in which they reside; 1502 for example, a key record for the domain example.com can be used to 1503 verify messages where the AUID ("i=" tag of the signature) is 1504 sub.example.com, or even sub1.sub2.example.com. In order to limit 1505 the capability of such keys when this is not intended, the "s" flag 1506 MAY be set in the "t=" tag of the key record, to constrain the 1507 validity of the domain of the AUID. If the referenced key record 1508 contains the "s" flag as part of the "t=" tag, the domain of the AUID 1509 ("i=" flag) MUST be the same as that of the SDID (d=) domain. If 1510 this flag is absent, the domain of the AUID MUST be the same as, or a 1511 subdomain of, the SDID. 1513 3.9. Relationship between SDID and AUID 1515 DKIM's primary task is to communicate from the Signer to a recipient- 1516 side Identity Assessor a single Signing Domain Identifier (SDID) that 1517 refers to a responsible identity. DKIM MAY optionally provide a 1518 single responsible Agent or User Identifier (AUID). 1520 Hence, DKIM's mandatory output to a receive-side Identity Assessor is 1521 a single domain name. Within the scope of its use as DKIM output, 1522 the name has only basic domain name semantics; any possible owner- 1523 specific semantics are outside the scope of DKIM. That is, within 1524 its role as a DKIM identifier, additional semantics cannot be assumed 1525 by an Identity Assessor. 1527 Upon successfully verifying the signature, a receive-side DKIM 1528 verifier MUST communicate the Signing Domain Identifier (d=) to a 1529 consuming Identity Assessor module and MAY communicate the Agent or 1530 User Identifier (i=) if present. 1532 To the extent that a receiver attempts to intuit any structured 1533 semantics for either of the identifiers, this is a heuristic function 1534 that is outside the scope of DKIM's specification and semantics. 1535 Hence, it is relegated to a higher-level service, such as a delivery 1536 handling filter that integrates a variety of inputs and performs 1537 heuristic analysis of them. 1539 INFORMATIVE DISCUSSION: This document does not require the value 1540 of the SDID or AUID to match an identifier in any other message 1541 header field. This requirement is, instead, an assessor policy 1542 issue. The purpose of such a linkage would be to authenticate the 1543 value in that other header field. This, in turn, is the basis for 1544 applying a trust assessment based on the identifier value. Trust 1545 is a broad and complex topic and trust mechanisms are subject to 1546 highly creative attacks. The real-world efficacy of any but the 1547 most basic bindings between the SDID or AUID and other identities 1548 is not well established, nor is its vulnerability to subversion by 1549 an attacker. Hence, reliance on the use of such bindings should 1550 be strictly limited. In particular, it is not at all clear to 1551 what extent a typical end-user recipient can rely on any 1552 assurances that might be made by successful use of the SDID or 1553 AUID. 1555 4. Semantics of Multiple Signatures 1557 4.1. Example Scenarios 1559 There are many reasons why a message might have multiple signatures. 1560 For example, a given signer might sign multiple times, perhaps with 1561 different hashing or signing algorithms during a transition phase. 1563 INFORMATIVE EXAMPLE: Suppose SHA-256 is in the future found to be 1564 insufficiently strong, and DKIM usage transitions to SHA-1024. A 1565 signer might immediately sign using the newer algorithm, but 1566 continue to sign using the older algorithm for interoperability 1567 with verifiers that had not yet upgraded. The signer would do 1568 this by adding two DKIM-Signature header fields, one using each 1569 algorithm. Older verifiers that did not recognize SHA-1024 as an 1570 acceptable algorithm would skip that signature and use the older 1571 algorithm; newer verifiers could use either signature at their 1572 option, and all other things being equal might not even attempt to 1573 verify the other signature. 1575 Similarly, a signer might sign a message including all headers and no 1576 "l=" tag (to satisfy strict verifiers) and a second time with a 1577 limited set of headers and an "l=" tag (in anticipation of possible 1578 message modifications in route to other verifiers). Verifiers could 1579 then choose which signature they preferred. 1581 INFORMATIVE EXAMPLE: A verifier might receive a message with two 1582 signatures, one covering more of the message than the other. If 1583 the signature covering more of the message verified, then the 1584 verifier could make one set of policy decisions; if that signature 1585 failed but the signature covering less of the message verified, 1586 the verifier might make a different set of policy decisions. 1588 Of course, a message might also have multiple signatures because it 1589 passed through multiple signers. A common case is expected to be 1590 that of a signed message that passes through a mailing list that also 1591 signs all messages. Assuming both of those signatures verify, a 1592 recipient might choose to accept the message if either of those 1593 signatures were known to come from trusted sources. 1595 INFORMATIVE EXAMPLE: Recipients might choose to whitelist mailing 1596 lists to which they have subscribed and that have acceptable anti- 1597 abuse policies so as to accept messages sent to that list even 1598 from unknown authors. They might also subscribe to less trusted 1599 mailing lists (e.g., those without anti-abuse protection) and be 1600 willing to accept all messages from specific authors, but insist 1601 on doing additional abuse scanning for other messages. 1603 Another related example of multiple signers might be forwarding 1604 services, such as those commonly associated with academic alumni 1605 sites. 1607 INFORMATIVE EXAMPLE: A recipient might have an address at 1608 members.example.org, a site that has anti-abuse protection that is 1609 somewhat less effective than the recipient would prefer. Such a 1610 recipient might have specific authors whose messages would be 1611 trusted absolutely, but messages from unknown authors that had 1612 passed the forwarder's scrutiny would have only medium trust. 1614 4.2. Interpretation 1616 A signer that is adding a signature to a message merely creates a new 1617 DKIM-Signature header, using the usual semantics of the h= option. A 1618 signer MAY sign previously existing DKIM-Signature header fields 1619 using the method described in Section 5.4 to sign trace header 1620 fields. 1622 INFORMATIVE NOTE: Signers should be cognizant that signing DKIM- 1623 Signature header fields may result in signature failures with 1624 intermediaries that do not recognize that DKIM-Signature header 1625 fields are trace header fields and unwittingly reorder them, thus 1626 breaking such signatures. For this reason, signing existing DKIM- 1627 Signature header fields is unadvised, albeit legal. 1629 INFORMATIVE NOTE: If a header field with multiple instances is 1630 signed, those header fields are always signed from the bottom up. 1631 Thus, it is not possible to sign only specific DKIM-Signature 1632 header fields. For example, if the message being signed already 1633 contains three DKIM-Signature header fields A, B, and C, it is 1634 possible to sign all of them, B and C only, or C only, but not A 1635 only, B only, A and B only, or A and C only. 1637 A signer MAY add more than one DKIM-Signature header field using 1638 different parameters. For example, during a transition period a 1639 signer might want to produce signatures using two different hash 1640 algorithms. 1642 Signers SHOULD NOT remove any DKIM-Signature header fields from 1643 messages they are signing, even if they know that the signatures 1644 cannot be verified. 1646 When evaluating a message with multiple signatures, a verifier SHOULD 1647 evaluate signatures independently and on their own merits. For 1648 example, a verifier that by policy chooses not to accept signatures 1649 with deprecated cryptographic algorithms would consider such 1650 signatures invalid. Verifiers MAY process signatures in any order of 1651 their choice; for example, some verifiers might choose to process 1652 signatures corresponding to the From field in the message header 1653 before other signatures. See Section 6.1 for more information about 1654 signature choices. 1656 INFORMATIVE IMPLEMENTATION NOTE: Verifier attempts to correlate 1657 valid signatures with invalid signatures in an attempt to guess 1658 why a signature failed are ill-advised. In particular, there is 1659 no general way that a verifier can determine that an invalid 1660 signature was ever valid. 1662 Verifiers SHOULD ignore failed signatures as though they were not 1663 present in the message. Verifiers SHOULD continue to check 1664 signatures until a signature successfully verifies to the 1665 satisfaction of the verifier. To limit potential denial-of-service 1666 attacks, verifiers MAY limit the total number of signatures they will 1667 attempt to verify. 1669 5. Signer Actions 1671 The following steps are performed in order by signers. 1673 5.1. Determine Whether the Email Should Be Signed and by Whom 1675 A signer can obviously only sign email for domains for which it has a 1676 private key and the necessary knowledge of the corresponding public 1677 key and selector information. However, there are a number of other 1678 reasons beyond the lack of a private key why a signer could choose 1679 not to sign an email. 1681 INFORMATIVE NOTE: Signing modules may be incorporated into any 1682 portion of the mail system as deemed appropriate, including an 1683 MUA, a SUBMISSION server, or an MTA. Wherever implemented, 1684 signers should beware of signing (and thereby asserting 1685 responsibility for) messages that may be problematic. In 1686 particular, within a trusted enclave the signing address might be 1687 derived from the header according to local policy; SUBMISSION 1688 servers might only sign messages from users that are properly 1689 authenticated and authorized. 1691 INFORMATIVE IMPLEMENTER ADVICE: SUBMISSION servers should not sign 1692 Received header fields if the outgoing gateway MTA obfuscates 1693 Received header fields, for example, to hide the details of 1694 internal topology. 1696 If an email cannot be signed for some reason, it is a local policy 1697 decision as to what to do with that email. 1699 5.2. Select a Private Key and Corresponding Selector Information 1701 This specification does not define the basis by which a signer should 1702 choose which private key and selector information to use. Currently, 1703 all selectors are equal as far as this specification is concerned, so 1704 the decision should largely be a matter of administrative 1705 convenience. Distribution and management of private keys is also 1706 outside the scope of this document. 1708 INFORMATIVE OPERATIONS ADVICE: A signer should not sign with a 1709 private key when the selector containing the corresponding public 1710 key is expected to be revoked or removed before the verifier has 1711 an opportunity to validate the signature. The signer should 1712 anticipate that verifiers may choose to defer validation, perhaps 1713 until the message is actually read by the final recipient. In 1714 particular, when rotating to a new key pair, signing should 1715 immediately commence with the new private key and the old public 1716 key should be retained for a reasonable validation interval before 1717 being removed from the key server. 1719 5.3. Normalize the Message to Prevent Transport Conversions 1721 Some messages, particularly those using 8-bit characters, are subject 1722 to modification during transit, notably conversion to 7-bit form. 1723 Such conversions will break DKIM signatures. In order to minimize 1724 the chances of such breakage, signers SHOULD convert the message to a 1725 suitable MIME content transfer encoding such as quoted-printable or 1726 base64 as described in [RFC2045] before signing. Such conversion is 1727 outside the scope of DKIM; the actual message SHOULD be converted to 1728 7-bit MIME by an MUA or MSA prior to presentation to the DKIM 1729 algorithm. 1731 Similarly, a message that is not compliant with RFC5322, RFC2045 and 1732 RFC2047, can be subject to attempts by intermediaries to correct or 1733 interpret such content. See Section 8 of [RFC4409] for examples of 1734 changes that are commonly made. Such "corrections" may break DKIM 1735 signatures or have other undesirable effects. Therefore, a verifier 1736 SHOULD NOT validate a message that is not compliant with those 1737 specifications. 1739 If the message is submitted to the signer with any local encoding 1740 that will be modified before transmission, that modification to 1741 canonical [RFC5322] form MUST be done before signing. In particular, 1742 bare CR or LF characters (used by some systems as a local line 1743 separator convention) MUST be converted to the SMTP-standard CRLF 1744 sequence before the message is signed. Any conversion of this sort 1745 SHOULD be applied to the message actually sent to the recipient(s), 1746 not just to the version presented to the signing algorithm. 1748 More generally, the signer MUST sign the message as it is expected to 1749 be received by the verifier rather than in some local or internal 1750 form. 1752 5.4. Determine the Header Fields to Sign 1754 The From header field MUST be signed (that is, included in the "h=" 1755 tag of the resulting DKIM-Signature header field). Signers SHOULD 1756 NOT sign an existing header field likely to be legitimately modified 1757 or removed in transit. In particular, [RFC5321] explicitly permits 1758 modification or removal of the Return-Path header field in transit. 1759 Signers MAY include any other header fields present at the time of 1760 signing at the discretion of the signer. 1762 INFORMATIVE OPERATIONS NOTE: The choice of which header fields to 1763 sign is non-obvious. One strategy is to sign all existing, non- 1764 repeatable header fields. An alternative strategy is to sign only 1765 header fields that are likely to be displayed to or otherwise be 1766 likely to affect the processing of the message at the receiver. A 1767 third strategy is to sign only "well known" headers. Note that 1768 verifiers may treat unsigned header fields with extreme 1769 skepticism, including refusing to display them to the end user or 1770 even ignoring the signature if it does not cover certain header 1771 fields. For this reason, signing fields present in the message 1772 such as Date, Subject, Reply-To, Sender, and all MIME header 1773 fields are highly advised. 1775 The DKIM-Signature header field is always implicitly signed and MUST 1776 NOT be included in the "h=" tag except to indicate that other 1777 preexisting signatures are also signed. 1779 Signers MAY claim to have signed header fields that do not exist 1780 (that is, signers MAY include the header field name in the "h=" tag 1781 even if that header field does not exist in the message). When 1782 computing the signature, the non-existing header field MUST be 1783 treated as the null string (including the header field name, header 1784 field value, all punctuation, and the trailing CRLF). 1786 INFORMATIVE RATIONALE: This allows signers to explicitly assert 1787 the absence of a header field; if that header field is added later 1788 the signature will fail. 1790 INFORMATIVE NOTE: A header field name need only be listed once 1791 more than the actual number of that header field in a message at 1792 the time of signing in order to prevent any further additions. 1793 For example, if there is a single Comments header field at the 1794 time of signing, listing Comments twice in the "h=" tag is 1795 sufficient to prevent any number of Comments header fields from 1796 being appended; it is not necessary (but is legal) to list 1797 Comments three or more times in the "h=" tag. 1799 Signers choosing to sign an existing header field that occurs more 1800 than once in the message (such as Received) MUST sign the physically 1801 last instance of that header field in the header block. Signers 1802 wishing to sign multiple instances of such a header field MUST 1803 include the header field name multiple times in the h= tag of the 1804 DKIM-Signature header field, and MUST sign such header fields in 1805 order from the bottom of the header field block to the top. The 1806 signer MAY include more instances of a header field name in h= than 1807 there are actual corresponding header fields to indicate that 1808 additional header fields of that name SHOULD NOT be added. 1810 INFORMATIVE EXAMPLE: 1812 If the signer wishes to sign two existing Received header fields, 1813 and the existing header contains: 1814 Received: 1815 Received: 1816 Received: 1818 then the resulting DKIM-Signature header field should read: 1820 DKIM-Signature: ... h=Received : Received :... 1821 and Received header fields and will be signed in that 1822 order. 1824 Signers should be careful of signing header fields that might have 1825 additional instances added later in the delivery process, since such 1826 header fields might be inserted after the signed instance or 1827 otherwise reordered. Trace header fields (such as Received) and 1828 Resent-* blocks are the only fields prohibited by [RFC5322] from 1829 being reordered. In particular, since DKIM-Signature header fields 1830 may be reordered by some intermediate MTAs, signing existing DKIM- 1831 Signature header fields is error-prone. 1833 INFORMATIVE ADMONITION: Despite the fact that [RFC5322] permits 1834 header fields to be reordered (with the exception of Received 1835 header fields), reordering of signed header fields with multiple 1836 instances by intermediate MTAs will cause DKIM signatures to be 1837 broken; such anti-social behavior should be avoided. 1839 INFORMATIVE IMPLEMENTER'S NOTE: Although not required by this 1840 specification, all end-user visible header fields should be signed 1841 to avoid possible "indirect spamming". For example, if the 1842 Subject header field is not signed, a spammer can resend a 1843 previously signed mail, replacing the legitimate subject with a 1844 one-line spam. 1846 5.5. Recommended Signature Content 1848 In order to maximize compatibility with a variety of verifiers, it is 1849 recommended that signers follow the practices outlined in this 1850 section when signing a message. However, these are generic 1851 recommendations applying to the general case; specific senders may 1852 wish to modify these guidelines as required by their unique 1853 situations. Verifiers MUST be capable of verifying signatures even 1854 if one or more of the recommended header fields is not signed (with 1855 the exception of From, which must always be signed) or if one or more 1856 of the dis-recommended header fields is signed. Note that verifiers 1857 do have the option of ignoring signatures that do not cover a 1858 sufficient portion of the header or body, just as they may ignore 1859 signatures from an identity they do not trust. 1861 The following header fields SHOULD be included in the signature, if 1862 they are present in the message being signed: 1864 o From (REQUIRED in all signatures) 1866 o Sender, Reply-To 1868 o Subject 1870 o Date, Message-ID 1872 o To, Cc 1874 o MIME-Version 1876 o Content-Type, Content-Transfer-Encoding, Content-ID, Content- 1877 Description 1879 o Resent-Date, Resent-From, Resent-Sender, Resent-To, Resent-Cc, 1880 Resent-Message-ID 1882 o In-Reply-To, References 1884 o List-Id, List-Help, List-Unsubscribe, List-Subscribe, List-Post, 1885 List-Owner, List-Archive 1887 The following header fields SHOULD NOT be included in the signature: 1889 o Return-Path 1891 o Received 1893 o Comments, Keywords 1895 o Bcc, Resent-Bcc 1897 o DKIM-Signature 1899 Optional header fields (those not mentioned above) normally SHOULD 1900 NOT be included in the signature, because of the potential for 1901 additional header fields of the same name to be legitimately added or 1902 reordered prior to verification. There are likely to be legitimate 1903 exceptions to this rule, because of the wide variety of application- 1904 specific header fields that may be applied to a message, some of 1905 which are unlikely to be duplicated, modified, or reordered. 1907 Signers SHOULD choose canonicalization algorithms based on the types 1908 of messages they process and their aversion to risk. For example, 1909 e-commerce sites sending primarily purchase receipts, which are not 1910 expected to be processed by mailing lists or other software likely to 1911 modify messages, will generally prefer "simple" canonicalization. 1912 Sites sending primarily person-to-person email will likely prefer to 1913 be more resilient to modification during transport by using "relaxed" 1914 canonicalization. 1916 Signers SHOULD NOT use "l=" unless they intend to accommodate 1917 intermediate mail processors that append text to a message. For 1918 example, many mailing list processors append "unsubscribe" 1919 information to message bodies. If signers use "l=", they SHOULD 1920 include the entire message body existing at the time of signing in 1921 computing the count. In particular, signers SHOULD NOT specify a 1922 body length of 0 since this may be interpreted as a meaningless 1923 signature by some verifiers. 1925 5.6. Compute the Message Hash and Signature 1927 The signer MUST compute the message hash as described in Section 3.7 1928 and then sign it using the selected public-key algorithm. This will 1929 result in a DKIM-Signature header field that will include the body 1930 hash and a signature of the header hash, where that header includes 1931 the DKIM-Signature header field itself. 1933 Entities such as mailing list managers that implement DKIM and that 1934 modify the message or a header field (for example, inserting 1935 unsubscribe information) before retransmitting the message SHOULD 1936 check any existing signature on input and MUST make such 1937 modifications before re-signing the message. 1939 The signer MAY elect to limit the number of bytes of the body that 1940 will be included in the hash and hence signed. The length actually 1941 hashed should be inserted in the "l=" tag of the DKIM-Signature 1942 header field. 1944 5.7. Insert the DKIM-Signature Header Field 1946 Finally, the signer MUST insert the DKIM-Signature header field 1947 created in the previous step prior to transmitting the email. The 1948 DKIM-Signature header field MUST be the same as used to compute the 1949 hash as described above, except that the value of the "b=" tag MUST 1950 be the appropriately signed hash computed in the previous step, 1951 signed using the algorithm specified in the "a=" tag of the DKIM- 1952 Signature header field and using the private key corresponding to the 1953 selector given in the "s=" tag of the DKIM-Signature header field, as 1954 chosen above in Section 5.2 1956 The DKIM-Signature header field MUST be inserted before any other 1957 DKIM-Signature fields in the header block. 1959 INFORMATIVE IMPLEMENTATION NOTE: The easiest way to achieve this 1960 is to insert the DKIM-Signature header field at the beginning of 1961 the header block. In particular, it may be placed before any 1962 existing Received header fields. This is consistent with treating 1963 DKIM-Signature as a trace header field. 1965 6. Verifier Actions 1967 Since a signer MAY remove or revoke a public key at any time, it is 1968 recommended that verification occur in a timely manner. In many 1969 configurations, the most timely place is during acceptance by the 1970 border MTA or shortly thereafter. In particular, deferring 1971 verification until the message is accessed by the end user is 1972 discouraged. 1974 A border or intermediate MTA MAY verify the message signature(s). An 1975 MTA who has performed verification MAY communicate the result of that 1976 verification by adding a verification header field to incoming 1977 messages. This considerably simplifies things for the user, who can 1978 now use an existing mail user agent. Most MUAs have the ability to 1979 filter messages based on message header fields or content; these 1980 filters would be used to implement whatever policy the user wishes 1981 with respect to unsigned mail. 1983 A verifying MTA MAY implement a policy with respect to unverifiable 1984 mail, regardless of whether or not it applies the verification header 1985 field to signed messages. 1987 Verifiers MUST produce a result that is semantically equivalent to 1988 applying the following steps in the order listed. In practice, 1989 several of these steps can be performed in parallel in order to 1990 improve performance. 1992 6.1. Extract Signatures from the Message 1994 The order in which verifiers try DKIM-Signature header fields is not 1995 defined; verifiers MAY try signatures in any order they like. For 1996 example, one implementation might try the signatures in textual 1997 order, whereas another might try signatures by identities that match 1998 the contents of the From header field before trying other signatures. 1999 Verifiers MUST NOT attribute ultimate meaning to the order of 2000 multiple DKIM-Signature header fields. In particular, there is 2001 reason to believe that some relays will reorder the header fields in 2002 potentially arbitrary ways. 2004 INFORMATIVE IMPLEMENTATION NOTE: Verifiers might use the order as 2005 a clue to signing order in the absence of any other information. 2006 However, other clues as to the semantics of multiple signatures 2007 (such as correlating the signing host with Received header fields) 2008 may also be considered. 2010 A verifier SHOULD NOT treat a message that has one or more bad 2011 signatures and no good signatures differently from a message with no 2012 signature at all; such treatment is a matter of local policy and is 2013 beyond the scope of this document. 2015 When a signature successfully verifies, a verifier will either stop 2016 processing or attempt to verify any other signatures, at the 2017 discretion of the implementation. A verifier MAY limit the number of 2018 signatures it tries to avoid denial-of-service attacks. 2020 INFORMATIVE NOTE: An attacker could send messages with large 2021 numbers of faulty signatures, each of which would require a DNS 2022 lookup and corresponding CPU time to verify the message. This 2023 could be an attack on the domain that receives the message, by 2024 slowing down the verifier by requiring it to do a large number of 2025 DNS lookups and/or signature verifications. It could also be an 2026 attack against the domains listed in the signatures, essentially 2027 by enlisting innocent verifiers in launching an attack against the 2028 DNS servers of the actual victim. 2030 In the following description, text reading "return status 2031 (explanation)" (where "status" is one of "PERMFAIL" or "TEMPFAIL") 2032 means that the verifier MUST immediately cease processing that 2033 signature. The verifier SHOULD proceed to the next signature, if any 2034 is present, and completely ignore the bad signature. If the status 2035 is "PERMFAIL", the signature failed and should not be reconsidered. 2036 If the status is "TEMPFAIL", the signature could not be verified at 2037 this time but may be tried again later. A verifier MAY either defer 2038 the message for later processing, perhaps by queueing it locally or 2039 issuing a 451/4.7.5 SMTP reply, or try another signature; if no good 2040 signature is found and any of the signatures resulted in a TEMPFAIL 2041 status, the verifier MAY save the message for later processing. The 2042 "(explanation)" is not normative text; it is provided solely for 2043 clarification. 2045 Verifiers SHOULD ignore any DKIM-Signature header fields where the 2046 signature does not validate. Verifiers that are prepared to validate 2047 multiple signature header fields SHOULD proceed to the next signature 2048 header field, should it exist. However, verifiers MAY make note of 2049 the fact that an invalid signature was present for consideration at a 2050 later step. 2052 INFORMATIVE NOTE: The rationale of this requirement is to permit 2053 messages that have invalid signatures but also a valid signature 2054 to work. For example, a mailing list exploder might opt to leave 2055 the original submitter signature in place even though the exploder 2056 knows that it is modifying the message in some way that will break 2057 that signature, and the exploder inserts its own signature. In 2058 this case, the message should succeed even in the presence of the 2059 known-broken signature. 2061 For each signature to be validated, the following steps should be 2062 performed in such a manner as to produce a result that is 2063 semantically equivalent to performing them in the indicated order. 2065 6.1.1. Validate the Signature Header Field 2067 Implementers MUST meticulously validate the format and values in the 2068 DKIM-Signature header field; any inconsistency or unexpected values 2069 MUST cause the header field to be completely ignored and the verifier 2070 to return PERMFAIL (signature syntax error). Being "liberal in what 2071 you accept" is definitely a bad strategy in this security context. 2072 Note however that this does not include the existence of unknown tags 2073 in a DKIM-Signature header field, which are explicitly permitted. 2074 Verifiers MUST ignore DKIM-Signature header fields with a "v=" tag 2075 that is inconsistent with this specification and return PERMFAIL 2076 (incompatible version). 2078 INFORMATIVE IMPLEMENTATION NOTE: An implementation may, of course, 2079 choose to also verify signatures generated by older versions of 2080 this specification. 2082 If any tag listed as "required" in Section 3.5 is omitted from the 2083 DKIM-Signature header field, the verifier MUST ignore the DKIM- 2084 Signature header field and return PERMFAIL (signature missing 2085 required tag). 2087 INFORMATIONAL NOTE: The tags listed as required in Section 3.5 are 2088 "v=", "a=", "b=", "bh=", "d=", "h=", and "s=". Should there be a 2089 conflict between this note and Section 3.5, Section 3.5 is 2090 normative. 2092 If the DKIM-Signature header field does not contain the "i=" tag, the 2093 verifier MUST behave as though the value of that tag were "@d", where 2094 "d" is the value from the "d=" tag. 2096 Verifiers MUST confirm that the domain specified in the "d=" tag is 2097 the same as or a parent domain of the domain part of the "i=" tag. 2098 If not, the DKIM-Signature header field MUST be ignored and the 2099 verifier should return PERMFAIL (domain mismatch). 2101 If the "h=" tag does not include the From header field, the verifier 2102 MUST ignore the DKIM-Signature header field and return PERMFAIL (From 2103 field not signed). 2105 Verifiers MAY ignore the DKIM-Signature header field and return 2106 PERMFAIL (signature expired) if it contains an "x=" tag and the 2107 signature has expired. 2109 Verifiers MAY ignore the DKIM-Signature header field if the domain 2110 used by the signer in the "d=" tag is not associated with a valid 2111 signing entity. For example, signatures with "d=" values such as 2112 "com" and "co.uk" may be ignored. The list of unacceptable domains 2113 SHOULD be configurable. 2115 Verifiers MAY ignore the DKIM-Signature header field and return 2116 PERMFAIL (unacceptable signature header) for any other reason, for 2117 example, if the signature does not sign header fields that the 2118 verifier views to be essential. As a case in point, if MIME header 2119 fields are not signed, certain attacks may be possible that the 2120 verifier would prefer to avoid. 2122 6.1.2. Get the Public Key 2124 The public key for a signature is needed to complete the verification 2125 process. The process of retrieving the public key depends on the 2126 query type as defined by the "q=" tag in the DKIM-Signature header 2127 field. Obviously, a public key need only be retrieved if the process 2128 of extracting the signature information is completely successful. 2129 Details of key management and representation are described in 2130 Section 3.6. The verifier MUST validate the key record and MUST 2131 ignore any public key records that are malformed. 2133 NOTE: The use of wildcard TXT records in the DNS will produce a 2134 response to a DKIM query that is unlikely to be valid DKIM key 2135 record. This problem applies to many other types of queries, and 2136 client software that processes DNS responses needs to take this 2137 problem into account. 2139 When validating a message, a verifier MUST perform the following 2140 steps in a manner that is semantically the same as performing them in 2141 the order indicated -- in some cases the implementation may 2142 parallelize or reorder these steps, as long as the semantics remain 2143 unchanged: 2145 1. Retrieve the public key as described in Section 3.6 using the 2146 algorithm in the "q=" tag, the domain from the "d=" tag, and the 2147 selector from the "s=" tag. 2149 2. If the query for the public key fails to respond, the verifier 2150 MAY defer acceptance of this email and return TEMPFAIL (key 2151 unavailable). If verification is occurring during the incoming 2152 SMTP session, this MAY be achieved with a 451/4.7.5 SMTP reply 2153 code. Alternatively, the verifier MAY store the message in the 2154 local queue for later trial or ignore the signature. Note that 2155 storing a message in the local queue is subject to denial-of- 2156 service attacks. 2158 3. If the query for the public key fails because the corresponding 2159 key record does not exist, the verifier MUST immediately return 2160 PERMFAIL (no key for signature). 2162 4. If the query for the public key returns multiple key records, the 2163 verifier may choose one of the key records or may cycle through 2164 the key records performing the remainder of these steps on each 2165 record at the discretion of the implementer. The order of the 2166 key records is unspecified. If the verifier chooses to cycle 2167 through the key records, then the "return ..." wording in the 2168 remainder of this section means "try the next key record, if any; 2169 if none, return to try another signature in the usual way". 2171 5. If the result returned from the query does not adhere to the 2172 format defined in this specification, the verifier MUST ignore 2173 the key record and return PERMFAIL (key syntax error). Verifiers 2174 are urged to validate the syntax of key records carefully to 2175 avoid attempted attacks. In particular, the verifier MUST ignore 2176 keys with a version code ("v=" tag) that they do not implement. 2178 6. If the "h=" tag exists in the public key record and the hash 2179 algorithm implied by the a= tag in the DKIM-Signature header 2180 field is not included in the contents of the "h=" tag, the 2181 verifier MUST ignore the key record and return PERMFAIL 2182 (inappropriate hash algorithm). 2184 7. If the public key data (the "p=" tag) is empty, then this key has 2185 been revoked and the verifier MUST treat this as a failed 2186 signature check and return PERMFAIL (key revoked). There is no 2187 defined semantic difference between a key that has been revoked 2188 and a key record that has been removed. 2190 8. If the public key data is not suitable for use with the algorithm 2191 and key types defined by the "a=" and "k=" tags in the DKIM- 2192 Signature header field, the verifier MUST immediately return 2193 PERMFAIL (inappropriate key algorithm). 2195 6.1.3. Compute the Verification 2197 Given a signer and a public key, verifying a signature consists of 2198 actions semantically equivalent to the following steps. 2200 1. Based on the algorithm defined in the "c=" tag, the body length 2201 specified in the "l=" tag, and the header field names in the "h=" 2202 tag, prepare a canonicalized version of the message as is 2203 described in Section 3.7 (note that this version does not 2204 actually need to be instantiated). When matching header field 2205 names in the "h=" tag against the actual message header field, 2206 comparisons MUST be case-insensitive. 2208 2. Based on the algorithm indicated in the "a=" tag, compute the 2209 message hashes from the canonical copy as described in 2210 Section 3.7. 2212 3. Verify that the hash of the canonicalized message body computed 2213 in the previous step matches the hash value conveyed in the "bh=" 2214 tag. If the hash does not match, the verifier SHOULD ignore the 2215 signature and return PERMFAIL (body hash did not verify). 2217 4. Using the signature conveyed in the "b=" tag, verify the 2218 signature against the header hash using the mechanism appropriate 2219 for the public key algorithm described in the "a=" tag. If the 2220 signature does not validate, the verifier SHOULD ignore the 2221 signature and return PERMFAIL (signature did not verify). 2223 5. Otherwise, the signature has correctly verified. 2225 INFORMATIVE IMPLEMENTER'S NOTE: Implementations might wish to 2226 initiate the public-key query in parallel with calculating the 2227 hash as the public key is not needed until the final decryption is 2228 calculated. Implementations may also verify the signature on the 2229 message header before validating that the message hash listed in 2230 the "bh=" tag in the DKIM-Signature header field matches that of 2231 the actual message body; however, if the body hash does not match, 2232 the entire signature must be considered to have failed. 2234 A body length specified in the "l=" tag of the signature limits the 2235 number of bytes of the body passed to the verification algorithm. 2236 All data beyond that limit is not validated by DKIM. Hence, 2237 verifiers might treat a message that contains bytes beyond the 2238 indicated body length with suspicion, such as by truncating the 2239 message at the indicated body length, declaring the signature invalid 2240 (e.g., by returning PERMFAIL (unsigned content)), or conveying the 2241 partial verification to the policy module. 2243 INFORMATIVE IMPLEMENTATION NOTE: Verifiers that truncate the body 2244 at the indicated body length might pass on a malformed MIME 2245 message if the signer used the "N-4" trick (omitting the final 2246 "--CRLF") described in the informative note in Section 3.4.5. 2247 Such verifiers may wish to check for this case and include a 2248 trailing "--CRLF" to avoid breaking the MIME structure. A simple 2249 way to achieve this might be to append "--CRLF" to any "multipart" 2250 message with a body length; if the MIME structure is already 2251 correctly formed, this will appear in the postlude and will not be 2252 displayed to the end user. 2254 6.2. Communicate Verification Results 2256 Verifiers wishing to communicate the results of verification to other 2257 parts of the mail system may do so in whatever manner they see fit. 2258 For example, implementations might choose to add an email header 2259 field to the message before passing it on. Any such header field 2260 SHOULD be inserted before any existing DKIM-Signature or preexisting 2261 authentication status header fields in the header field block. The 2262 Authentication-Results: header field ([RFC5451]) MAY be used for this 2263 purpose. 2265 INFORMATIVE ADVICE to MUA filter writers: Patterns intended to 2266 search for results header fields to visibly mark authenticated 2267 mail for end users should verify that such header field was added 2268 by the appropriate verifying domain and that the verified identity 2269 matches the author identity that will be displayed by the MUA. In 2270 particular, MUA filters should not be influenced by bogus results 2271 header fields added by attackers. To circumvent this attack, 2272 verifiers may wish to delete existing results header fields after 2273 verification and before adding a new header field. 2275 6.3. Interpret Results/Apply Local Policy 2277 It is beyond the scope of this specification to describe what actions 2278 an Identity Assessor can make, but mail carrying a validated SDID 2279 presents an opportunity to an Identity Assessor that unauthenticated 2280 email does not. Specifically, an authenticated email creates a 2281 predictable identifier by which other decisions can reliably be 2282 managed, such as trust and reputation. Conversely, unauthenticated 2283 email lacks a reliable identifier that can be used to assign trust 2284 and reputation. It is reasonable to treat unauthenticated email as 2285 lacking any trust and having no positive reputation. 2287 In general, verifiers SHOULD NOT reject messages solely on the basis 2288 of a lack of signature or an unverifiable signature; such rejection 2289 would cause severe interoperability problems. However, if the 2290 verifier does opt to reject such messages (for example, when 2291 communicating with a peer who, by prior agreement, agrees to only 2292 send signed messages), and the verifier runs synchronously with the 2293 SMTP session and a signature is missing or does not verify, the MTA 2294 SHOULD use a 550/5.7.x reply code. 2296 If it is not possible to fetch the public key, perhaps because the 2297 key server is not available, a temporary failure message MAY be 2298 generated using a 451/4.7.5 reply code, such as: 2299 451 4.7.5 Unable to verify signature - key server unavailable 2301 Temporary failures such as inability to access the key server or 2302 other external service are the only conditions that SHOULD use a 4xx 2303 SMTP reply code. In particular, cryptographic signature verification 2304 failures MUST NOT return 4xx SMTP replies. 2306 Once the signature has been verified, that information MUST be 2307 conveyed to the Identity Assessor (such as an explicit allow/ 2308 whitelist and reputation system) and/or to the end user. If the SDID 2309 is not the same as the address in the From: header field, the mail 2310 system SHOULD take pains to ensure that the actual SDID is clear to 2311 the reader. 2313 The verifier MAY treat unsigned header fields with extreme 2314 skepticism, including marking them as untrusted or even deleting them 2315 before display to the end user. 2317 While the symptoms of a failed verification are obvious -- the 2318 signature doesn't verify -- establishing the exact cause can be more 2319 difficult. If a selector cannot be found, is that because the 2320 selector has been removed, or was the value changed somehow in 2321 transit? If the signature line is missing, is that because it was 2322 never there, or was it removed by an overzealous filter? For 2323 diagnostic purposes, the exact reason why the verification fails 2324 SHOULD be made available to the policy module and possibly recorded 2325 in the system logs. If the email cannot be verified, then it SHOULD 2326 be rendered the same as all unverified email regardless of whether or 2327 not it looks like it was signed. 2329 7. IANA Considerations 2331 DKIM has registered new namespaces with IANA. In all cases, new 2332 values are assigned only for values that have been documented in a 2333 published RFC that has IETF Consensus [RFC5226]. 2335 7.1. DKIM-Signature Tag Specifications 2337 A DKIM-Signature provides for a list of tag specifications. IANA has 2338 established the DKIM-Signature Tag Specification Registry for tag 2339 specifications that can be used in DKIM-Signature fields. 2341 The initial entries in the registry comprise: 2343 +------+-----------------+ 2344 | TYPE | REFERENCE | 2345 +------+-----------------+ 2346 | v | (this document) | 2347 | a | (this document) | 2348 | b | (this document) | 2349 | bh | (this document) | 2350 | c | (this document) | 2351 | d | (this document) | 2352 | h | (this document) | 2353 | i | (this document) | 2354 | l | (this document) | 2355 | q | (this document) | 2356 | s | (this document) | 2357 | t | (this document) | 2358 | x | (this document) | 2359 | z | (this document) | 2360 +------+-----------------+ 2362 Table 1: DKIM-Signature Tag Specification Registry Initial 2363 Values 2365 7.2. DKIM-Signature Query Method Registry 2367 The "q=" tag-spec (specified in Section 3.5) provides for a list of 2368 query methods. 2370 IANA has established the DKIM-Signature Query Method Registry for 2371 mechanisms that can be used to retrieve the key that will permit 2372 validation processing of a message signed using DKIM. 2374 The initial entry in the registry comprises: 2376 +------+--------+-----------------+ 2377 | TYPE | OPTION | REFERENCE | 2378 +------+--------+-----------------+ 2379 | dns | txt | (this document) | 2380 +------+--------+-----------------+ 2382 DKIM-Signature Query Method Registry Initial Values 2384 7.3. DKIM-Signature Canonicalization Registry 2386 The "c=" tag-spec (specified in Section 3.5) provides for a specifier 2387 for canonicalization algorithms for the header and body of the 2388 message. 2390 IANA has established the DKIM-Signature Canonicalization Algorithm 2391 Registry for algorithms for converting a message into a canonical 2392 form before signing or verifying using DKIM. 2394 The initial entries in the body registry comprise: 2396 +---------+-----------------+ 2397 | TYPE | REFERENCE | 2398 +---------+-----------------+ 2399 | simple | (this document) | 2400 | relaxed | (this document) | 2401 +---------+-----------------+ 2403 DKIM-Signature Body Canonicalization Algorithm Registry 2404 Initial Values 2406 7.4. _domainkey DNS TXT Record Tag Specifications 2408 A _domainkey DNS TXT record provides for a list of tag 2409 specifications. IANA has established the DKIM _domainkey DNS TXT Tag 2410 Specification Registry for tag specifications that can be used in DNS 2411 TXT Records. 2413 The initial entries in the registry comprise: 2415 +------+-----------------+ 2416 | TYPE | REFERENCE | 2417 +------+-----------------+ 2418 | v | (this document) | 2419 | g | (this document) | 2420 | h | (this document) | 2421 | k | (this document) | 2422 | n | (this document) | 2423 | p | (this document) | 2424 | s | (this document) | 2425 | t | (this document) | 2426 +------+-----------------+ 2428 DKIM _domainkey DNS TXT Record Tag Specification Registry 2429 Initial Values 2431 The initial entries in the body registry comprise: 2433 +---------+-----------------+ 2434 | TYPE | REFERENCE | 2435 +---------+-----------------+ 2436 | simple | (this document) | 2437 | relaxed | (this document) | 2438 +---------+-----------------+ 2440 DKIM-Signature Body Canonicalization Algorithm Registry 2441 Initial Values 2443 7.5. DKIM Key Type Registry 2445 The "k=" (specified in Section 3.6.1) and the "a=" (specified in Section 3.5) tags provide for a list of 2447 mechanisms that can be used to decode a DKIM signature. 2449 IANA has established the DKIM Key Type Registry for such mechanisms. 2451 The initial entry in the registry comprises: 2453 +------+-----------+ 2454 | TYPE | REFERENCE | 2455 +------+-----------+ 2456 | rsa | [RFC3447] | 2457 +------+-----------+ 2459 DKIM Key Type Initial Values 2461 7.6. DKIM Hash Algorithms Registry 2463 The "h=" (specified in Section 3.6.1) and the "a=" (specified in Section 3.5) tags provide for a list of 2465 mechanisms that can be used to produce a digest of message data. 2467 IANA has established the DKIM Hash Algorithms Registry for such 2468 mechanisms. 2470 The initial entries in the registry comprise: 2472 +--------+-------------------+ 2473 | TYPE | REFERENCE | 2474 +--------+-------------------+ 2475 | sha1 | [FIPS-180-2-2002] | 2476 | sha256 | [FIPS-180-2-2002] | 2477 +--------+-------------------+ 2479 DKIM Hash Algorithms Initial Values 2481 7.7. DKIM Service Types Registry 2483 The "s=" tag (specified in Section 3.6.1) provides for a 2484 list of service types to which this selector may apply. 2486 IANA has established the DKIM Service Types Registry for service 2487 types. 2489 The initial entries in the registry comprise: 2491 +-------+-----------------+ 2492 | TYPE | REFERENCE | 2493 +-------+-----------------+ 2494 | email | (this document) | 2495 | * | (this document) | 2496 +-------+-----------------+ 2498 DKIM Service Types Registry Initial Values 2500 7.8. DKIM Selector Flags Registry 2502 The "t=" tag (specified in Section 3.6.1) provides for a 2503 list of flags to modify interpretation of the selector. 2505 IANA has established the DKIM Selector Flags Registry for additional 2506 flags. 2508 The initial entries in the registry comprise: 2510 +------+-----------------+ 2511 | TYPE | REFERENCE | 2512 +------+-----------------+ 2513 | y | (this document) | 2514 | s | (this document) | 2515 +------+-----------------+ 2517 DKIM Selector Flags Registry Initial Values 2519 7.9. DKIM-Signature Header Field 2521 IANA has added DKIM-Signature to the "Permanent Message Header 2522 Fields" registry (see [RFC3864]) for the "mail" protocol, using this 2523 document as the reference. 2525 8. Security Considerations 2527 It has been observed that any mechanism that is introduced that 2528 attempts to stem the flow of spam is subject to intensive attack. 2529 DKIM needs to be carefully scrutinized to identify potential attack 2530 vectors and the vulnerability to each. See also [RFC4686]. 2532 8.1. Misuse of Body Length Limits ("l=" Tag) 2534 Body length limits (in the form of the "l=" tag) are subject to 2535 several potential attacks. 2537 8.1.1. Addition of New MIME Parts to Multipart/* 2539 If the body length limit does not cover a closing MIME multipart 2540 section (including the trailing "--CRLF" portion), then it is 2541 possible for an attacker to intercept a properly signed multipart 2542 message and add a new body part. Depending on the details of the 2543 MIME type and the implementation of the verifying MTA and the 2544 receiving MUA, this could allow an attacker to change the information 2545 displayed to an end user from an apparently trusted source. 2547 For example, if attackers can append information to a "text/html" 2548 body part, they may be able to exploit a bug in some MUAs that 2549 continue to read after a "" marker, and thus display HTML text 2550 on top of already displayed text. If a message has a "multipart/ 2551 alternative" body part, they might be able to add a new body part 2552 that is preferred by the displaying MUA. 2554 8.1.2. Addition of new HTML content to existing content 2556 Several receiving MUA implementations do not cease display after a 2557 """" tag. In particular, this allows attacks involving 2558 overlaying images on top of existing text. 2560 INFORMATIVE EXAMPLE: Appending the following text to an existing, 2561 properly closed message will in many MUAs result in inappropriate 2562 data being rendered on top of existing, correct data: 2564
2565
2567 8.2. Misappropriated Private Key 2569 If the private key for a user is resident on their computer and is 2570 not protected by an appropriately secure mechanism, it is possible 2571 for malware to send mail as that user and any other user sharing the 2572 same private key. The malware would not, however, be able to 2573 generate signed spoofs of other signers' addresses, which would aid 2574 in identification of the infected user and would limit the 2575 possibilities for certain types of attacks involving socially 2576 engineered messages. This threat applies mainly to MUA-based 2577 implementations; protection of private keys on servers can be easily 2578 achieved through the use of specialized cryptographic hardware. 2580 A larger problem occurs if malware on many users' computers obtains 2581 the private keys for those users and transmits them via a covert 2582 channel to a site where they can be shared. The compromised users 2583 would likely not know of the misappropriation until they receive 2584 "bounce" messages from messages they are purported to have sent. 2585 Many users might not understand the significance of these bounce 2586 messages and would not take action. 2588 One countermeasure is to use a user-entered passphrase to encrypt the 2589 private key, although users tend to choose weak passphrases and often 2590 reuse them for different purposes, possibly allowing an attack 2591 against DKIM to be extended into other domains. Nevertheless, the 2592 decoded private key might be briefly available to compromise by 2593 malware when it is entered, or might be discovered via keystroke 2594 logging. The added complexity of entering a passphrase each time one 2595 sends a message would also tend to discourage the use of a secure 2596 passphrase. 2598 A somewhat more effective countermeasure is to send messages through 2599 an outgoing MTA that can authenticate the submitter using existing 2600 techniques (e.g., SMTP Authentication), possibly validate the message 2601 itself (e.g., verify that the header is legitimate and that the 2602 content passes a spam content check), and sign the message using a 2603 key appropriate for the submitter address. Such an MTA can also 2604 apply controls on the volume of outgoing mail each user is permitted 2605 to originate in order to further limit the ability of malware to 2606 generate bulk email. 2608 8.3. Key Server Denial-of-Service Attacks 2610 Since the key servers are distributed (potentially separate for each 2611 domain), the number of servers that would need to be attacked to 2612 defeat this mechanism on an Internet-wide basis is very large. 2613 Nevertheless, key servers for individual domains could be attacked, 2614 impeding the verification of messages from that domain. This is not 2615 significantly different from the ability of an attacker to deny 2616 service to the mail exchangers for a given domain, although it 2617 affects outgoing, not incoming, mail. 2619 A variation on this attack is that if a very large amount of mail 2620 were to be sent using spoofed addresses from a given domain, the key 2621 servers for that domain could be overwhelmed with requests. However, 2622 given the low overhead of verification compared with handling of the 2623 email message itself, such an attack would be difficult to mount. 2625 8.4. Attacks Against the DNS 2627 Since the DNS is a required binding for key services, specific 2628 attacks against the DNS must be considered. 2630 While the DNS is currently insecure [RFC3833], these security 2631 problems are the motivation behind DNS Security (DNSSEC) [RFC4033], 2632 and all users of the DNS will reap the benefit of that work. 2634 DKIM is only intended as a "sufficient" method of proving 2635 authenticity. It is not intended to provide strong cryptographic 2636 proof about authorship or contents. Other technologies such as 2637 OpenPGP [RFC4880] and S/MIME [RFC5751] address those requirements. 2639 A second security issue related to the DNS revolves around the 2640 increased DNS traffic as a consequence of fetching selector-based 2641 data as well as fetching signing domain policy. Widespread 2642 deployment of DKIM will result in a significant increase in DNS 2643 queries to the claimed signing domain. In the case of forgeries on a 2644 large scale, DNS servers could see a substantial increase in queries. 2646 A specific DNS security issue that should be considered by DKIM 2647 verifiers is the name chaining attack described in Section 2.3 of 2648 [RFC3833]. A DKIM verifier, while verifying a DKIM-Signature header 2649 field, could be prompted to retrieve a key record of an attacker's 2650 choosing. This threat can be minimized by ensuring that name 2651 servers, including recursive name servers, used by the verifier 2652 enforce strict checking of "glue" and other additional information in 2653 DNS responses and are therefore not vulnerable to this attack. 2655 8.5. Replay Attacks 2657 In this attack, a spammer sends a message to be spammed to an 2658 accomplice, which results in the message being signed by the 2659 originating MTA. The accomplice resends the message, including the 2660 original signature, to a large number of recipients, possibly by 2661 sending the message to many compromised machines that act as MTAs. 2662 The messages, not having been modified by the accomplice, have valid 2663 signatures. 2665 Partial solutions to this problem involve the use of reputation 2666 services to convey the fact that the specific email address is being 2667 used for spam and that messages from that signer are likely to be 2668 spam. This requires a real-time detection mechanism in order to 2669 react quickly enough. However, such measures might be prone to 2670 abuse, if for example an attacker resent a large number of messages 2671 received from a victim in order to make them appear to be a spammer. 2673 Large verifiers might be able to detect unusually large volumes of 2674 mails with the same signature in a short time period. Smaller 2675 verifiers can get substantially the same volume of information via 2676 existing collaborative systems. 2678 8.6. Limits on Revoking Keys 2680 When a large domain detects undesirable behavior on the part of one 2681 of its users, it might wish to revoke the key used to sign that 2682 user's messages in order to disavow responsibility for messages that 2683 have not yet been verified or that are the subject of a replay 2684 attack. However, the ability of the domain to do so can be limited 2685 if the same key, for scalability reasons, is used to sign messages 2686 for many other users. Mechanisms for explicitly revoking keys on a 2687 per-address basis have been proposed but require further study as to 2688 their utility and the DNS load they represent. 2690 8.7. Intentionally Malformed Key Records 2692 It is possible for an attacker to publish key records in DNS that are 2693 intentionally malformed, with the intent of causing a denial-of- 2694 service attack on a non-robust verifier implementation. The attacker 2695 could then cause a verifier to read the malformed key record by 2696 sending a message to one of its users referencing the malformed 2697 record in a (not necessarily valid) signature. Verifiers MUST 2698 thoroughly verify all key records retrieved from the DNS and be 2699 robust against intentionally as well as unintentionally malformed key 2700 records. 2702 8.8. Intentionally Malformed DKIM-Signature Header Fields 2704 Verifiers MUST be prepared to receive messages with malformed DKIM- 2705 Signature header fields, and thoroughly verify the header field 2706 before depending on any of its contents. 2708 8.9. Information Leakage 2710 An attacker could determine when a particular signature was verified 2711 by using a per-message selector and then monitoring their DNS traffic 2712 for the key lookup. This would act as the equivalent of a "web bug" 2713 for verification time rather than when the message was read. 2715 8.10. Remote Timing Attacks 2717 In some cases it may be possible to extract private keys using a 2718 remote timing attack [BONEH03]. Implementations should consider 2719 obfuscating the timing to prevent such attacks. 2721 8.11. Reordered Header Fields 2723 Existing standards allow intermediate MTAs to reorder header fields. 2724 If a signer signs two or more header fields of the same name, this 2725 can cause spurious verification errors on otherwise legitimate 2726 messages. In particular, signers that sign any existing DKIM- 2727 Signature fields run the risk of having messages incorrectly fail to 2728 verify. 2730 8.12. RSA Attacks 2732 An attacker could create a large RSA signing key with a small 2733 exponent, thus requiring that the verification key have a large 2734 exponent. This will force verifiers to use considerable computing 2735 resources to verify the signature. Verifiers might avoid this attack 2736 by refusing to verify signatures that reference selectors with public 2737 keys having unreasonable exponents. 2739 In general, an attacker might try to overwhelm a verifier by flooding 2740 it with messages requiring verification. This is similar to other 2741 MTA denial-of-service attacks and should be dealt with in a similar 2742 fashion. 2744 8.13. Inappropriate Signing by Parent Domains 2746 The trust relationship described in Section 3.8 could conceivably be 2747 used by a parent domain to sign messages with identities in a 2748 subdomain not administratively related to the parent. For example, 2749 the ".com" registry could create messages with signatures using an 2750 "i=" value in the example.com domain. There is no general solution 2751 to this problem, since the administrative cut could occur anywhere in 2752 the domain name. For example, in the domain "example.podunk.ca.us" 2753 there are three administrative cuts (podunk.ca.us, ca.us, and us), 2754 any of which could create messages with an identity in the full 2755 domain. 2757 INFORMATIVE NOTE: This is considered an acceptable risk for the 2758 same reason that it is acceptable for domain delegation. For 2759 example, in the example above any of the domains could potentially 2760 simply delegate "example.podunk.ca.us" to a server of their choice 2761 and completely replace all DNS-served information. Note that a 2762 verifier MAY ignore signatures that come from an unlikely domain 2763 such as ".com", as discussed in Section 6.1.1. 2765 8.14. Attacks Involving Addition of Header Fields 2767 Many email implementations do not enforce [RFC5322] with strictness. 2768 As discussed in Section 5.3 DKIM processing is predicated on a valid 2769 mail message as its input. However, DKIM implementers should be 2770 aware of the potential effect of having loose enforcement by email 2771 components interacting with DKIM modules. 2773 For example, a message with multiple From: header fields violates 2774 Section 3.6 of [RFC5322]. With the intent of providing a better user 2775 experience, many agents tolerate these violations and deliver the 2776 message anyway. An MUA then might elect to render to the user the 2777 value of the last, or "top", From: field. This may also be done 2778 simply out of the expectation that there is only one, where a "find 2779 first" algorithm would have the same result. Such code in an MUA can 2780 be exploited to fool the user if it is also known that the other 2781 From: field is the one checked by arriving message filters. Such is 2782 the case with DKIM; although the From: field must be signed, a 2783 malformed message bearing more than one From: field might only have 2784 the first ("bottom") one signed, in an attempt to show the message 2785 with some "DKIM passed" annotation while also rendering the From: 2786 field that was not authenticated. (This can also be taken as a 2787 demonstration that DKIM is not designed to support author 2788 validation.) 2790 To resist this specific attack the signed header field list can 2791 include an additional reference for each field that was present at 2792 signing. For example, a proper message with one From: field could be 2793 signed using "h=From:From:..." Due to the way header fields are 2794 canonicalized for input to the hash function, the extra field 2795 references will prevent instances of the cited fields from being 2796 added after signing, as doing so would render the signature invalid. 2798 The From: field is used above to illustrate this issue, but it is 2799 only one of > several fields that Section 3.6 of [RFC5322] constrains 2800 in this way. In reality any agent that forgives malformations, or is 2801 careless about identifying which parts of a message were 2802 authenticated, is open to exploitation. 2804 9. References 2806 9.1. Normative References 2808 [FIPS-180-2-2002] 2809 U.S. Department of Commerce, "Secure Hash Standard", FIPS 2810 PUB 180-2, August 2002. 2812 [ITU-X660-1997] 2813 "Information Technology - ASN.1 encoding rules: 2814 Specification of Basic Encoding Rules (BER), Canonical 2815 Encoding Rules (CER) and Distinguished Encoding Rules 2816 (DER)", 1997. 2818 [RFC1034] Mockapetris, P., "DOMAIN NAMES - CONCEPTS AND FACILITIES", 2819 RFC 1034, November 1987. 2821 [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2822 Extensions (MIME) Part One: Format of Internet Message 2823 Bodies", RFC 2045, November 1996. 2825 [RFC2047] Moore, K., "MIME (Multipurpose Internet Mail Extensions) 2826 Part Three: Message Header Extensions for Non-ASCII Text", 2827 RFC 2047, November 1996. 2829 [RFC2049] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 2830 Extensions (MIME) Part Five: Conformance Criteria and 2831 Examples", RFC 2049, November 1996. 2833 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 2834 Requirement Levels", BCP 14, RFC 2119, March 1997. 2836 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 2837 Standards (PKCS) #1: RSA Cryptography Specifications 2838 Version 2.1", RFC 3447, February 2003. 2840 [RFC3490] Faltstrom, P., Hoffman, P., and A. Costello, 2841 "Internationalizing Domain Names in Applications (IDNA)", 2842 RFC 3490, March 2003. 2844 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax 2845 Specifications: ABNF", RFC 4234, January 2008. 2847 [RFC5321] Klensin, J., "Simple Mail Transfer Protocol", RFC 5321, 2848 October 2008. 2850 [RFC5322] Resnick, P., "Internet Message Format", RFC 5322, 2851 October 2008. 2853 [RFC5598] Crocker, D., "Internet Mail Architecture", RFC 5598, 2854 July 2009. 2856 9.2. Informative References 2858 [BONEH03] "Remote Timing Attacks are Practical", Proceedings 12th 2859 USENIX Security Symposium, 2003. 2861 [RFC1847] Galvin, J., Murphy, S., Crocker, S., and N. Freed, 2862 "Security Multiparts for MIME: Multipart/Signed and 2863 Multipart/Encrypted", RFC 1847, October 1995. 2865 [RFC3766] Orman, H. and P. Hoffman, "Determining Strengths For 2866 Public Keys Used For Exchanging Symmetric Keys", BCP 86, 2867 RFC 3766, April 2004. 2869 [RFC3833] Atkins, D. and R. Austein, "Threat Analysis of the Domain 2870 Name System (DNS)", RFC 3833, August 2004. 2872 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration 2873 Procedures for Message Header Fields", BCP 90, RFC 3864, 2874 September 2004. 2876 [RFC4033] Arends, R., Austein, R., Larson, M., Massey, D., and S. 2877 Rose, "DNS Security Introduction and Requirements", 2878 RFC 4033, March 2005. 2880 [RFC4409] Gellens, R. and J. Klensin, "Message Submission for Mail", 2881 RFC 4409, April 2006. 2883 [RFC4686] Fenton, J., "Analysis of Threats Motivating DomainKeys 2884 Identified Mail (DKIM)", RFC 4686, September 2006. 2886 [RFC4870] Delany, M., "Domain-Based Email Authentication Using 2887 Public Keys Advertised in the DNS (DomainKeys)", RFC 4870, 2888 May 2007. 2890 [RFC4871] Allman, E., Callas, J., Delany, M., Libbey, M., Fenton, 2891 J., and M. Thomas, "DomainKeys Identified Mail (DKIM) 2892 Signatures", RFC 4871, May 2007. 2894 [RFC4880] Callas, J., Donnerhacke, L., Finney, H., and R. Thayer, 2895 "OpenPGP Message Format", RFC 4880, November 2007. 2897 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 2898 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 2899 May 2008. 2901 [RFC5451] Kucherawy, M., "Message Header Field for Indicating 2902 Message Authentication Status", RFC 5451, April 2009. 2904 [RFC5751] Ramsdell, B., "Secure/Multipurpose Internet Mail 2905 Extensions (S/MIME) Version 3.1 Message Specification", 2906 RFC 5751, January 2010. 2908 Appendix A. Example of Use (INFORMATIVE) 2910 This section shows the complete flow of an email from submission to 2911 final delivery, demonstrating how the various components fit 2912 together. The key used in this example is shown in Appendix C. 2914 A.1. The User Composes an Email 2916 From: Joe SixPack 2917 To: Suzie Q 2918 Subject: Is dinner ready? 2919 Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) 2920 Message-ID: <;20030712040037.46341.5F8J@football.example.com> 2922 Hi. 2924 We lost the game. Are you hungry yet? 2926 Joe. 2928 Figure 1: The User Composes an Email 2930 A.2. The Email is Signed 2931 This email is signed by the example.com outbound email server and now 2932 looks like this: 2933 DKIM-Signature: v=1; a=rsa-sha256; s=brisbane; d=example.com; 2934 c=simple/simple; q=dns/txt; i=joe@football.example.com; 2935 h=Received : From : To : Subject : Date : Message-ID; 2936 bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=; 2937 b=AuUoFEfDxTDkHlLXSZEpZj79LICEps6eda7W3deTVFOk4yAUoqOB 2938 4nujc7YopdG5dWLSdNg6xNAZpOPr+kHxt1IrE+NahM6L/LbvaHut 2939 KVdkLLkpVaVVQPzeRDI009SO2Il5Lu7rDNH6mZckBdrIx0orEtZV 2940 4bmp/YzhwvcubU4=; 2941 Received: from client1.football.example.com [192.0.2.1] 2942 by submitserver.example.com with SUBMISSION; 2943 Fri, 11 Jul 2003 21:01:54 -0700 (PDT) 2944 From: Joe SixPack 2945 To: Suzie Q 2946 Subject: Is dinner ready? 2947 Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) 2948 Message-ID: <20030712040037.46341.5F8J@football.example.com> 2950 Hi. 2952 We lost the game. Are you hungry yet? 2954 Joe. 2956 The Email is Signed 2958 The signing email server requires access to the private key 2959 associated with the "brisbane" selector to generate this signature. 2961 A.3. The Email Signature is Verified 2963 The signature is normally verified by an inbound SMTP server or 2964 possibly the final delivery agent. However, intervening MTAs can 2965 also perform this verification if they choose to do so. The 2966 verification process uses the domain "example.com" extracted from the 2967 "d=" tag and the selector "brisbane" from the "s=" tag in the DKIM- 2968 Signature header field to form the DNS DKIM query for: 2969 brisbane._domainkey.example.com 2971 Signature verification starts with the physically last Received 2972 header field, the From header field, and so forth, in the order 2973 listed in the "h=" tag. Verification follows with a single CRLF 2974 followed by the body (starting with "Hi."). The email is canonically 2975 prepared for verifying with the "simple" method. The result of the 2976 query and subsequent verification of the signature is stored (in this 2977 example) in the X-Authentication-Results header field line. After 2978 successful verification, the email looks like this: 2980 X-Authentication-Results: shopping.example.net 2981 header.from=joe@football.example.com; dkim=pass 2982 Received: from mout23.football.example.com (192.168.1.1) 2983 by shopping.example.net with SMTP; 2984 Fri, 11 Jul 2003 21:01:59 -0700 (PDT) 2985 DKIM-Signature: v=1; a=rsa-sha256; s=brisbane; d=example.com; 2986 c=simple/simple; q=dns/txt; i=joe@football.example.com; 2987 h=Received : From : To : Subject : Date : Message-ID; 2988 bh=2jUSOH9NhtVGCQWNr9BrIAPreKQjO6Sn7XIkfJVOzv8=; 2989 b=AuUoFEfDxTDkHlLXSZEpZj79LICEps6eda7W3deTVFOk4yAUoqOB 2990 4nujc7YopdG5dWLSdNg6xNAZpOPr+kHxt1IrE+NahM6L/LbvaHut 2991 KVdkLLkpVaVVQPzeRDI009SO2Il5Lu7rDNH6mZckBdrIx0orEtZV 2992 4bmp/YzhwvcubU4=; 2993 Received: from client1.football.example.com [192.0.2.1] 2994 by submitserver.example.com with SUBMISSION; 2995 Fri, 11 Jul 2003 21:01:54 -0700 (PDT) 2996 From: Joe SixPack 2997 To: Suzie Q 2998 Subject: Is dinner ready? 2999 Date: Fri, 11 Jul 2003 21:00:37 -0700 (PDT) 3000 Message-ID: <20030712040037.46341.5F8J@football.example.com> 3002 Hi. 3004 We lost the game. Are you hungry yet? 3006 Joe. 3008 Successful verification 3010 Appendix B. Usage Examples (INFORMATIVE) 3012 DKIM signing and validating can be used in different ways, for 3013 different operational scenarios. This Appendix discusses some common 3014 examples. 3016 NOTE: Descriptions in this Appendix are for informational purposes 3017 only. They describe various ways that DKIM can be used, given 3018 particular constraints and needs. In no case are these examples 3019 intended to be taken as providing explanation or guidance 3020 concerning DKIM specification details, when creating an 3021 implementation. 3023 B.1. Alternate Submission Scenarios 3025 In the most simple scenario, a user's MUA, MSA, and Internet 3026 (boundary) MTA are all within the same administrative environment, 3027 using the same domain name. Therefore, all of the components 3028 involved in submission and initial transfer are related. However, it 3029 is common for two or more of the components to be under independent 3030 administrative control. This creates challenges for choosing and 3031 administering the domain name to use for signing, and for its 3032 relationship to common email identity header fields. 3034 B.1.1. Delegated Business Functions 3036 Some organizations assign specific business functions to discrete 3037 groups, inside or outside the organization. The goal, then, is to 3038 authorize that group to sign some mail, but to constrain what 3039 signatures they can generate. DKIM selectors (the "s=" signature 3040 tag) facilitate this kind of restricted authorization. Examples of 3041 these outsourced business functions are legitimate email marketing 3042 providers and corporate benefits providers. 3044 Here, the delegated group needs to be able to send messages that are 3045 signed, using the email domain of the client company. At the same 3046 time, the client often is reluctant to register a key for the 3047 provider that grants the ability to send messages for arbitrary 3048 addresses in the domain. 3050 There are multiple ways to administer these usage scenarios. In one 3051 case, the client organization provides all of the public query 3052 service (for example, DNS) administration, and in another it uses DNS 3053 delegation to enable all ongoing administration of the DKIM key 3054 record by the delegated group. 3056 If the client organization retains responsibility for all of the DNS 3057 administration, the outsourcing company can generate a key pair, 3058 supplying the public key to the client company, which then registers 3059 it in the query service, using a unique selector. The client company 3060 retains control over the use of the delegated key because it retains 3061 the ability to revoke the key at any time. 3063 If the client wants the delegated group to do the DNS administration, 3064 it can have the domain name that is specified with the selector point 3065 to the provider's DNS server. The provider then creates and 3066 maintains all of the DKIM signature information for that selector. 3067 Hence, the client cannot provide constraints on the Local-part of 3068 addresses that get signed, but it can revoke the provider's signing 3069 rights by removing the DNS delegation record. 3071 B.1.2. PDAs and Similar Devices 3073 PDAs demonstrate the need for using multiple keys per domain. 3074 Suppose that John Doe wanted to be able to send messages using his 3075 corporate email address, jdoe@example.com, and his email device did 3076 not have the ability to make a Virtual Private Network (VPN) 3077 connection to the corporate network, either because the device is 3078 limited or because there are restrictions enforced by his Internet 3079 access provider. If the device was equipped with a private key 3080 registered for jdoe@example.com by the administrator of the 3081 example.com domain, and appropriate software to sign messages, John 3082 could sign the message on the device itself before transmission 3083 through the outgoing network of the access service provider. 3085 B.1.3. Roaming Users 3087 Roaming users often find themselves in circumstances where it is 3088 convenient or necessary to use an SMTP server other than their home 3089 server; examples are conferences and many hotels. In such 3090 circumstances, a signature that is added by the submission service 3091 will use an identity that is different from the user's home system. 3093 Ideally, roaming users would connect back to their home server using 3094 either a VPN or a SUBMISSION server running with SMTP AUTHentication 3095 on port 587. If the signing can be performed on the roaming user's 3096 laptop, then they can sign before submission, although the risk of 3097 further modification is high. If neither of these are possible, 3098 these roaming users will not be able to send mail signed using their 3099 own domain key. 3101 B.1.4. Independent (Kiosk) Message Submission 3103 Stand-alone services, such as walk-up kiosks and web-based 3104 information services, have no enduring email service relationship 3105 with the user, but users occasionally request that mail be sent on 3106 their behalf. For example, a website providing news often allows the 3107 reader to forward a copy of the article to a friend. This is 3108 typically done using the reader's own email address, to indicate who 3109 the author is. This is sometimes referred to as the "Evite problem", 3110 named after the website of the same name that allows a user to send 3111 invitations to friends. 3113 A common way this is handled is to continue to put the reader's email 3114 address in the From header field of the message, but put an address 3115 owned by the email posting site into the Sender header field. The 3116 posting site can then sign the message, using the domain that is in 3117 the Sender field. This provides useful information to the receiving 3118 email site, which is able to correlate the signing domain with the 3119 initial submission email role. 3121 Receiving sites often wish to provide their end users with 3122 information about mail that is mediated in this fashion. Although 3123 the real efficacy of different approaches is a subject for human 3124 factors usability research, one technique that is used is for the 3125 verifying system to rewrite the From header field, to indicate the 3126 address that was verified. For example: From: John Doe via 3127 news@news-site.com . (Note that such rewriting 3128 will break a signature, unless it is done after the verification pass 3129 is complete.) 3131 B.2. Alternate Delivery Scenarios 3133 Email is often received at a mailbox that has an address different 3134 from the one used during initial submission. In these cases, an 3135 intermediary mechanism operates at the address originally used and it 3136 then passes the message on to the final destination. This mediation 3137 process presents some challenges for DKIM signatures. 3139 B.2.1. Affinity Addresses 3141 "Affinity addresses" allow a user to have an email address that 3142 remains stable, even as the user moves among different email 3143 providers. They are typically associated with college alumni 3144 associations, professional organizations, and recreational 3145 organizations with which they expect to have a long-term 3146 relationship. These domains usually provide forwarding of incoming 3147 email, and they often have an associated Web application that 3148 authenticates the user and allows the forwarding address to be 3149 changed. However, these services usually depend on users sending 3150 outgoing messages through their own service providers' MTAs. Hence, 3151 mail that is signed with the domain of the affinity address is not 3152 signed by an entity that is administered by the organization owning 3153 that domain. 3155 With DKIM, affinity domains could use the Web application to allow 3156 users to register per-user keys to be used to sign messages on behalf 3157 of their affinity address. The user would take away the secret half 3158 of the key pair for signing, and the affinity domain would publish 3159 the public half in DNS for access by verifiers. 3161 This is another application that takes advantage of user-level 3162 keying, and domains used for affinity addresses would typically have 3163 a very large number of user-level keys. Alternatively, the affinity 3164 domain could handle outgoing mail, operating a mail submission agent 3165 that authenticates users before accepting and signing messages for 3166 them. This is of course dependent on the user's service provider not 3167 blocking the relevant TCP ports used for mail submission. 3169 B.2.2. Simple Address Aliasing (.forward) 3171 In some cases a recipient is allowed to configure an email address to 3172 cause automatic redirection of email messages from the original 3173 address to another, such as through the use of a Unix .forward file. 3174 In this case, messages are typically redirected by the mail handling 3175 service of the recipient's domain, without modification, except for 3176 the addition of a Received header field to the message and a change 3177 in the envelope recipient address. In this case, the recipient at 3178 the final address' mailbox is likely to be able to verify the 3179 original signature since the signed content has not changed, and DKIM 3180 is able to validate the message signature. 3182 B.2.3. Mailing Lists and Re-Posters 3184 There is a wide range of behaviors in services that take delivery of 3185 a message and then resubmit it. A primary example is with mailing 3186 lists (collectively called "forwarders" below), ranging from those 3187 that make no modification to the message itself, other than to add a 3188 Received header field and change the envelope information, to those 3189 that add header fields, change the Subject header field, add content 3190 to the body (typically at the end), or reformat the body in some 3191 manner. The simple ones produce messages that are quite similar to 3192 the automated alias services. More elaborate systems essentially 3193 create a new message. 3195 A Forwarder that does not modify the body or signed header fields of 3196 a message is likely to maintain the validity of the existing 3197 signature. It also could choose to add its own signature to the 3198 message. 3200 Forwarders which modify a message in a way that could make an 3201 existing signature invalid are particularly good candidates for 3202 adding their own signatures (e.g., mailing-list-name@example.net). 3203 Since (re-)signing is taking responsibility for the content of the 3204 message, these signing forwarders are likely to be selective, and 3205 forward or re-sign a message only if it is received with a valid 3206 signature or if they have some other basis for knowing that the 3207 message is not spoofed. 3209 A common practice among systems that are primarily redistributors of 3210 mail is to add a Sender header field to the message, to identify the 3211 address being used to sign the message. This practice will remove 3212 any preexisting Sender header field as required by [RFC5322]. The 3213 forwarder applies a new DKIM-Signature header field with the 3214 signature, public key, and related information of the forwarder. 3216 Appendix C. Creating a Public Key (INFORMATIVE) 3218 The default signature is an RSA signed SHA256 digest of the complete 3219 email. For ease of explanation, the openssl command is used to 3220 describe the mechanism by which keys and signatures are managed. One 3221 way to generate a 1024-bit, unencrypted private key suitable for DKIM 3222 is to use openssl like this: 3223 $ openssl genrsa -out rsa.private 1024 3224 For increased security, the "-passin" parameter can also be added to 3225 encrypt the private key. Use of this parameter will require entering 3226 a password for several of the following steps. Servers may prefer to 3227 use hardware cryptographic support. 3229 The "genrsa" step results in the file rsa.private containing the key 3230 information similar to this: 3231 -----BEGIN RSA PRIVATE KEY----- 3232 MIICXwIBAAKBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkMoGeLnQg1fWn7/zYtIxN2SnFC 3233 jxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v/RtdC2UzJ1lWT947qR+Rcac2gb 3234 to/NMqJ0fzfVjH4OuKhitdY9tf6mcwGjaNBcWToIMmPSPDdQPNUYckcQ2QIDAQAB 3235 AoGBALmn+XwWk7akvkUlqb+dOxyLB9i5VBVfje89Teolwc9YJT36BGN/l4e0l6QX 3236 /1//6DWUTB3KI6wFcm7TWJcxbS0tcKZX7FsJvUz1SbQnkS54DJck1EZO/BLa5ckJ 3237 gAYIaqlA9C0ZwM6i58lLlPadX/rtHb7pWzeNcZHjKrjM461ZAkEA+itss2nRlmyO 3238 n1/5yDyCluST4dQfO8kAB3toSEVc7DeFeDhnC1mZdjASZNvdHS4gbLIA1hUGEF9m 3239 3hKsGUMMPwJBAPW5v/U+AWTADFCS22t72NUurgzeAbzb1HWMqO4y4+9Hpjk5wvL/ 3240 eVYizyuce3/fGke7aRYw/ADKygMJdW8H/OcCQQDz5OQb4j2QDpPZc0Nc4QlbvMsj 3241 7p7otWRO5xRa6SzXqqV3+F0VpqvDmshEBkoCydaYwc2o6WQ5EBmExeV8124XAkEA 3242 qZzGsIxVP+sEVRWZmW6KNFSdVUpk3qzK0Tz/WjQMe5z0UunY9Ax9/4PVhp/j61bf 3243 eAYXunajbBSOLlx4D+TunwJBANkPI5S9iylsbLs6NkaMHV6k5ioHBBmgCak95JGX 3244 GMot/L2x0IYyMLAz6oLWh2hm7zwtb0CgOrPo1ke44hFYnfc= 3245 -----END RSA PRIVATE KEY----- 3247 To extract the public-key component from the private key, use openssl 3248 like this: 3249 $ openssl rsa -in rsa.private -out rsa.public -pubout -outform PEM 3251 This results in the file rsa.public containing the key information 3252 similar to this: 3253 -----BEGIN PUBLIC KEY----- 3254 MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkM 3255 oGeLnQg1fWn7/zYtIxN2SnFCjxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v/R 3256 tdC2UzJ1lWT947qR+Rcac2gbto/NMqJ0fzfVjH4OuKhitdY9tf6mcwGjaNBcWToI 3257 MmPSPDdQPNUYckcQ2QIDAQAB 3258 -----END PUBLIC KEY----- 3259 This public-key data (without the BEGIN and END tags) is placed in 3260 the DNS: 3261 brisbane IN TXT ("v=DKIM1; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQ" 3262 "KBgQDwIRP/UC3SBsEmGqZ9ZJW3/DkMoGeLnQg1fWn7/zYt" 3263 "IxN2SnFCjxOCKG9v3b4jYfcTNh5ijSsq631uBItLa7od+v" 3264 "/RtdC2UzJ1lWT947qR+Rcac2gbto/NMqJ0fzfVjH4OuKhi" 3265 "tdY9tf6mcwGjaNBcWToIMmPSPDdQPNUYckcQ2QIDAQAB") 3267 Appendix D. MUA Considerations 3269 When a DKIM signature is verified, the processing system sometimes 3270 makes the result available to the recipient user's MUA. How to 3271 present this information to the user in a way that helps them is a 3272 matter of continuing human factors usability research. The tendency 3273 is to have the MUA highlight the SDID, in an attempt to show the user 3274 the identity that is claiming responsibility for the message. An MUA 3275 might do this with visual cues such as graphics, or it might include 3276 the address in an alternate view, or it might even rewrite the 3277 original From address using the verified information. Some MUAs 3278 might indicate which header fields were protected by the validated 3279 DKIM signature. This could be done with a positive indication on the 3280 signed header fields, with a negative indication on the unsigned 3281 header fields, by visually hiding the unsigned header fields, or some 3282 combination of these. If an MUA uses visual indications for signed 3283 header fields, the MUA probably needs to be careful not to display 3284 unsigned header fields in a way that might be construed by the end 3285 user as having been signed. If the message has an l= tag whose value 3286 does not extend to the end of the message, the MUA might also hide or 3287 mark the portion of the message body that was not signed. 3289 The aforementioned information is not intended to be exhaustive. The 3290 MUA may choose to highlight, accentuate, hide, or otherwise display 3291 any other information that may, in the opinion of the MUA author, be 3292 deemed important to the end user. 3294 Appendix E. Acknowledgements 3296 The previous IETF version of DKIM [RFC4871] was edited by: Eric 3297 Allman, Jon Callas, Mark Delany, Miles Libbey, Jim Fenton and Michael 3298 Thomas. 3300 That specification was the result of an extended, collaborative 3301 effort, including participation by: Russ Allbery, Edwin Aoki, Claus 3302 Assmann, Steve Atkins, Rob Austein, Fred Baker, Mark Baugher, Steve 3303 Bellovin, Nathaniel Borenstein, Dave Crocker, Michael Cudahy, Dennis 3304 Dayman, Jutta Degener, Frank Ellermann, Patrik Faeltstroem, Mark 3305 Fanto, Stephen Farrell, Duncan Findlay, Elliot Gillum, Olafur 3306 Gu[eth]mundsson, Phillip Hallam-Baker, Tony Hansen, Sam Hartman, 3307 Arvel Hathcock, Amir Herzberg, Paul Hoffman, Russ Housley, Craig 3308 Hughes, Cullen Jennings, Don Johnsen, Harry Katz, Murray S. 3309 Kucherawy, Barry Leiba, John Levine, Charles Lindsey, Simon 3310 Longsdale, David Margrave, Justin Mason, David Mayne, Thierry Moreau, 3311 Steve Murphy, Russell Nelson, Dave Oran, Doug Otis, Shamim Pirzada, 3312 Juan Altmayer Pizzorno, Sanjay Pol, Blake Ramsdell, Christian Renaud, 3313 Scott Renfro, Neil Rerup, Eric Rescorla, Dave Rossetti, Hector 3314 Santos, Jim Schaad, the Spamhaus.org team, Malte S. Stretz, Robert 3315 Sanders, Rand Wacker, Sam Weiler, and Dan Wing. 3317 The earlier DomainKeys was a primary source from which DKIM was 3318 derived. Further information about DomainKeys is at [RFC4870]. 3320 Authors' Addresses 3322 D. Crocker (editor) 3323 Brandenburg InternetWorking 3324 675 Spruce Dr. 3325 Sunnyvale 3326 USA 3328 Phone: +1.408.246.8253 3329 Email: dcrocker@bbiw.net 3330 URI: http://bbiw.net 3332 Tony Hansen (editor) 3333 AT&T Laboratories 3334 200 Laurel Ave. South 3335 Middletown, NJ 07748 3336 USA 3338 Email: tony+dkimov@maillennium.att.com 3340 M. Kucherawy (editor) 3341 Cloudmark 3342 128 King St., 2nd Floor 3343 San Francisco, CA 94107 3344 USA 3346 Email: msk@cloudmark.com