Suped

What is the purpose of the MTA-STS policy 'id' value?

MTA-STS, or Mail Transfer Agent Strict Transport Security, is a crucial email security standard. It's designed to protect your inbound email by enforcing the use of encrypted TLS connections. When a sending mail server wants to deliver an email to your domain, MTA-STS provides a mechanism for it to verify that it's connecting to a legitimate server and that the connection is secure. A key part of this mechanism is the MTA-STS policy file, and within that policy, there's a small but vital field: the id. Understanding its purpose is essential for correctly implementing and maintaining your MTA-STS setup.

Suped DMARC monitor
Free forever, no credit card required
Get started for free
Trusted by teams securing millions of inboxes
Company logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logoCompany logo

The core function of the 'id' value

The primary purpose of the MTA-STS policy id is to signal that your policy has changed. Think of it as a version number for your security rules. When a remote mail server connects to send you an email, it first looks up your MTA-STS DNS record to find your policy. It then caches this policy for a period of time to avoid fetching it for every single message.

www.uriports.com logo
URIports Blog says:
Visit website
The id is used to track policy updates. This allows the sending server to determine when the policy has been updated.

The id value is what makes this caching system work effectively. Before using its cached policy, the sending server quickly checks the id from your _mta-sts DNS record. If the current id in your DNS record matches the id of its cached policy, it knows the policy is still valid and can proceed. If the IDs do not match, it signals to the sender that the policy has been updated, and it must fetch the new version from your web server before attempting delivery.

www.markloveless.net logo
Mark Loveless says:
Visit website
A change to the id value signifies to a potential sender of email that some is new, if the value is the same as their cache they can still use their cached policy. If not they are required to get the new policy file and re-evaluate.

Why policy versioning matters

This versioning is not just a technical detail; it's fundamental to the security MTA-STS provides. Your email infrastructure might change over time. You might add new mail servers, retire old ones, or switch email providers entirely. Each of these events requires an update to your MTA-STS policy file.

Without the id, sending servers would have no efficient way of knowing your policy had changed. They might continue trying to send emails based on an old, cached policy that lists mail servers you no longer use. This could lead to delayed or failed email delivery. By simply updating the id value in your DNS record, you create a clear signal that forces all sending servers to retrieve your latest rules, ensuring a smooth and secure transition.

Best practices for the 'id' value

To ensure your MTA-STS implementation is robust, follow these simple rules for the id field:

  • Update it with every change. Any time you modify your MTA-STS policy file (for example, changing the mode or updating mail server hostnames), you must change the id in your _mta-sts DNS TXT record. This is the trigger for remote servers to fetch the new policy.
  • Keep it unique. The id must be different from the previous one. A common and effective convention, as highlighted by 365labs.cloud, is to use a timestamp like 20240821103000. This ensures the ID is always unique and provides a handy reference for when the policy was last updated.
  • Follow the format. The id value must be an alphanumeric string up to 32 characters long, as noted by Tech Obsessed Blog. A simple numerical string or timestamp works perfectly.

In summary, the MTA-STS id is a simple yet powerful version control mechanism. It ensures that sending mail servers are always aware of your current security policy, which is essential for maintaining the integrity and reliability of your email delivery.

Start improving your email deliverability today

Get started