What DKIM tag indicates the expiration time of the signature?
Matthew Whittaker
Co-founder & CTO, Suped
Published 8 May 2025
Updated 19 Sep 2025
7 min read
Email authentication protocols like DKIM (DomainKeys Identified Mail) are crucial for verifying sender identity and ensuring email integrity. These protocols help protect against spoofing and phishing by adding a digital signature to outgoing messages. Within a DKIM signature, various tags provide specific details about the email and its authentication process.
One such tag is particularly important for defining the lifespan of the signature, adding a layer of security by limiting how long a signed email can be considered valid. This prevents malicious actors from reusing an old, but still technically valid, signature for illicit purposes.
Understanding these individual tags helps you configure and troubleshoot your email authentication properly. Let's delve into the specific DKIM tag that controls the expiration time of a signature.
The DKIM 'x=' tag: signature expiration
The DKIM tag that indicates the expiration time of the signature is the x tag. This optional tag specifies the exact time, in Unix epoch format, after which the DKIM signature is considered invalid. When an email receiver processes an incoming message, they check the x tag's value against the current time. If the current time exceeds the expiration time, the signature verification will fail.
While the x tag is not mandatory for a valid DKIM record, including it can be a good security practice. It ensures that older emails with valid signatures cannot be indefinitely replayed or used to impersonate your domain. Alongside other important tags like the h tag, which lists the signed header fields, and the a tag, indicating the algorithm used for signing, the x tag helps maintain the integrity of your email communication.
Example DKIM-Signature header with 'x=' tagplaintext
In the example above, x=1678886400 indicates that the signature expires at Unix epoch time 1678886400. This numerical value represents March 15, 2023, 12:00:00 PM GMT. For comparison, the t tag, also in Unix epoch format, indicates the signature creation timestamp. Understanding both timestamps is key to verifying the freshness and validity of an email's signature.
How the 'x=' tag impacts signature validity
When an email is sent, the sender's mail server generates a DKIM signature, which includes various tags. The x tag is populated with a future Unix timestamp, defining the expiration window. Upon receiving the email, the recipient's server extracts this tag, along with the signature itself, and performs a series of checks. One critical check is comparing the current time to the x tag's value.
If the expiration time has passed, the signature is deemed invalid, even if the cryptographic signature itself is correct. This mechanism is vital for mitigating certain types of email-based attacks. For example, if a sender's private key were compromised, an attacker couldn't indefinitely forge emails using old, valid signatures if those signatures had an x tag set. This helps limit the window of opportunity for attackers.
Unix epoch time explained
Unix epoch time, or POSIX time, is a system for describing points in time. It is the number of seconds that have elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January 1970, not counting leap seconds. This universal standard ensures consistent timekeeping across different systems and regions, which is crucial for the global nature of email and its authentication mechanisms.
The x tag is an important component of a robust email authentication strategy. It works in conjunction with other elements like the s tag, which represents the DKIM selector, to ensure that both the identity and validity period of the sending domain are verified.
Recommended practices and pitfalls
The recommended expiration time for a DKIM signature generally ranges from a few hours to a few days. Setting a short expiration time, such as 12-24 hours, offers a balance between security and practicality. This window is typically sufficient for an email to be delivered and processed, while also limiting the potential for an expired signature to be exploited.
However, the optimal value for the x tag can vary based on specific use cases and the nature of your email traffic. For instance, transactional emails that require immediate delivery might tolerate a slightly shorter expiration, whereas marketing emails that could experience slight delays might need a bit more leeway. Overly short expiration times could lead to legitimate emails failing DKIM verification if delivery is delayed.
Benefits of the 'x=' tag
Enhanced security: Limits the window for replay attacks, where old valid signatures are reused.
Improved trust: Signals to recipient mail servers that your domain is actively managing its email security. (Wikipedia describes this well.)
Best practice: Aligns with recommendations for cryptographic hygiene by expiring credentials.
Potential pitfalls
Delivery delays: If email delivery takes longer than the expiration time, legitimate emails may fail DKIM.
Configuration errors: Incorrectly set x tag values can lead to unexpected authentication failures.
Time synchronization: Differences in system clocks between sending and receiving servers can cause issues.
Monitoring your DKIM authentication results, especially for failures related to signature expiration, is critical. A robust DMARC monitoring solution can help you quickly identify issues caused by an incorrectly configured or expired x tag. Understanding the nuances of DMARC, SPF, and DKIM ensures your emails are consistently delivered.
Monitoring DKIM expiration and overall health
While the x tag focuses on the expiration of a specific signature, managing your overall email deliverability requires a broader perspective. Regular monitoring of your DKIM records and other authentication protocols is essential. Tools like Suped's DMARC monitoring platform provide a comprehensive view of your email authentication status.
Suped's platform offers AI-powered recommendations to help you fix issues quickly, provides real-time alerts, and unifies DMARC, SPF, and DKIM monitoring with deliverability insights. This integrated approach ensures that not only your DKIM signatures are correctly configured and respected, but your entire email ecosystem is healthy. We also provide SPF flattening to help manage complex SPF records, which often go hand in hand with DKIM and DMARC for email security.
Tag
Description
Example
v
Version of the DKIM specification (always DKIM1).
v=DKIM1
a
Algorithm used to generate the signature.
a=rsa-sha256
d
The domain responsible for signing the email.
d=yourdomain.com
s
The selector used to find the DKIM public key.
s=selector1
h
List of header fields included in the signature.
h=From:Subject
b
The actual cryptographic signature of the email.
b=AdfghkL123...
bh
Hash of the email body.
bh=xyz789...
t
Timestamp when the signature was created (Unix epoch).
t=1678800000
x
Expiration time of the signature (Unix epoch).
x=1678886400
Ultimately, a well-implemented and monitored DKIM configuration, including careful consideration of the x tag, contributes significantly to your email deliverability and overall domain reputation. By leveraging powerful monitoring tools and following best practices, you can ensure your legitimate emails reach the inbox while protecting against malicious activities.
Reinforcing email security with DKIM expiration
The DKIM x tag, while optional, plays a critical role in the security and validity of your email signatures by defining an explicit expiration time. Its proper configuration helps prevent the misuse of old signatures and bolsters your email's authenticity.
By setting an appropriate expiration period, you reinforce the integrity of your sent emails, ensuring that recipients can trust the origin and content of messages signed by your domain. However, misconfigurations can lead to legitimate emails failing authentication, impacting your sender reputation and deliverability.
Regularly reviewing your email authentication setup, including the nuances of DKIM tags, and leveraging robust monitoring tools are key to maintaining a healthy and secure email ecosystem. Suped helps you keep all your email authentication protocols aligned and performing optimally.