Which tags must every DKIM-Signature header field carry under RFC 6376, and which header field must its h= list always include?
answer
- seven required tags
- version, algorithm, two hashes
- domain, header list, selector
- one header the RFC says MUST be signed
basics
~10 sRFC 6376 requires v=1, a=, b=, bh=, d=, h= and s= on every DKIM-Signature, and h= must list From. A verifier returns PERMFAIL for a signature missing a required tag or leaving From unsigned.
solid answer
~40 sRFC 6376 Section 3.5 lists seven required tags: `v=` (which must be `1`), `a=` (the algorithm), `b=` (the signature), `bh=` (the body hash), `d=` (the signing domain), `h=` (the colon-separated list of signed header fields) and `s=` (the selector). `d=` and `s=` together name where the public key lives. Section 5.4 adds that the `From` field MUST be signed, meaning it appears in `h=`. A verifier that finds a required tag missing ignores the signature with PERMFAIL (signature missing required tag), and one whose `h=` lacks `From` gets PERMFAIL (From field not signed). Everything else, such as `c=`, `i=`, `l=`, `q=`, `t=` and `x=`, is optional or recommended.
go deeper
Recall the seven required tags by grouping them: version and algorithm, the two hashes, then domain, header list and selector, plus the rule that From is always signed.
Explain what each required tag does for a verifier, which optional tags have defaults, and the PERMFAIL a verifier returns for a missing tag or an unsigned From.
When auditing a signer's output, show you check tags in a deliberate order and know which faults are permanent failures rather than something a retry could fix.
Treat the required set as a floor, not a policy: decide what the organisation's signer adds beyond it, such as t= and x=, and who reviews that configuration.
## The seven required tags A `DKIM-Signature` header field is a tag list: `name=value` pairs separated by semicolons. RFC 6376 (September 2011), Section 3.5, marks seven of them **REQUIRED**, and Section 6.1.1 repeats the list as an informative note for verifiers. | Tag | Holds | What a verifier does with it | |---|---|---| | `v=` | Version, which MUST be `1` | Any other value is PERMFAIL (incompatible version) | | `a=` | Signing algorithm, such as `rsa-sha256` or `ed25519-sha256` | Picks the hash and the signature scheme | | `b=` | The signature, base64 | Verified against the header hash | | `bh=` | Hash of the canonicalized body, base64 | Compared with its own hash of the body | | `d=` | Signing domain (the SDID) | Forms the key query and names who takes responsibility | | `h=` | Colon-separated header field names, in signing order | Selects which fields go into the header hash | | `s=` | Selector | With `d=`, names the key record `s._domainkey.d` | The key record itself, its tags and how several selectors coexist, are covered with DKIM selectors and key records. ## The From rule Section 5.4 says plainly: **the `From` header field MUST be signed**, that is, included in `h=`. Two reasons explain why it is the one header the RFC makes mandatory: - `From` is the author address the recipient sees, so a signature that does not cover it says nothing about the identity a reader relies on. - Downstream checks that compare the signing domain with the author domain need the author field to be part of what was signed. The verifier side enforces it. Section 6.1.1: if `h=` does not include `From`, the verifier MUST ignore the signature and return **PERMFAIL (From field not signed)**. Other rules on `h=` are worth knowing: - It MUST NOT be empty. - It MUST NOT name the `DKIM-Signature` field being created, which is hashed implicitly. - Names are compared case-insensitively, so `from` and `From` are the same. - It MAY name fields that do not exist, which makes their later addition detectable. - It MAY name a field more than once to cover several instances. ## The optional and recommended tags Everything else on the field can be absent: - `c=` is OPTIONAL and defaults to `simple/simple`; what the two algorithms do is covered with DKIM canonicalization. - `i=` is OPTIONAL and defaults to an empty local part, `@`, and the `d=` domain. - `l=` is OPTIONAL and defaults to the entire body. - `q=` is OPTIONAL and defaults to `dns/txt`, the only defined method. - `t=` (signing time) and `x=` (expiry) are **RECOMMENDED**, not required. - `z=` (copied header fields, for diagnostics) is OPTIONAL. Tags that no specification defines are allowed: RFC 6376 says unknown tags MUST be included in the signature calculation but MUST otherwise be ignored by verifiers. That is how the format extends without breaking older verifiers. ## What a missing tag does RFC 6376 is strict about the format. Section 6.1.1 tells verifiers to validate the field meticulously, and says that an inconsistency or unexpected value MUST cause the field to be ignored with PERMFAIL (signature syntax error). The specific outcomes: 1. A required tag is missing: ignore the signature, PERMFAIL (signature missing required tag). 2. `v=` is not `1`: PERMFAIL (incompatible version). 3. `h=` lacks `From`: PERMFAIL (From field not signed). 4. The `i=` domain is not `d=` or a subdomain of it: ignore it, PERMFAIL (domain mismatch). RFC 6376's own vocabulary is SUCCESS, PERMFAIL and TEMPFAIL: a PERMFAIL is a defect a retry will not cure, a TEMPFAIL a condition such as an unreachable key that might clear. How a receiver records these under the RFC 8601 result names in `Authentication-Results` is covered with DKIM verification. ## Reading a signature A minimal valid field, folded for reading, looks like this: - `v=1; a=rsa-sha256; d=example.com; s=s2026a;` - `h=from:to:subject:date:message-id;` - `bh=` followed by a base64 digest, `b=` followed by the base64 signature. When reviewing your own signer's output, check these in order: the seven tags present, `From` in `h=`, an algorithm that is still permitted, and `d=` naming the domain you intend to take responsibility.
- Why is d= required while i= is optional?`d=` is the signing domain: it forms the key query with `s=` and is the identity DKIM reports to receivers. `i=` only names an agent or user on whose behalf `d=` signs; when absent, RFC 6376 has verifiers treat it as `@` plus the `d=` domain, so nothing is lost.
- Are t= and x= required on a DKIM-Signature?No. RFC 6376 marks both RECOMMENDED. Without `t=` the creation time is unknown; without `x=` the signature has no expiry. When both are present, `x=` MUST be greater than `t=`.
- c= is required, and a signature without it is invalid.
- Any non-empty h= list is acceptable, From is optional.
- t= and x= are required tags on every signature.
- The DKIM-Signature field should be listed in its own h=.
- A verifier rejects any signature carrying a tag it does not know.