Suped

Summary

Detecting and verifying MTA-STS policy changes and locations primarily involves a two-phase process: first, querying the DNS for a specific TXT record, and then retrieving a policy file via HTTPS from a well-known URL. Receiving Mail Transfer Agents (MTAs) initiating this process first check for a _mta-sts.<domain> DNS TXT record. This record contains a policy ID and points to the location where the actual policy is hosted. Subsequently, the MTA fetches the mta-sts.txt policy file from a standardized HTTPS URL, typically https://mta-sts.<domain>/.well-known/mta-sts.txt. Verification is critical, requiring validation of the HTTPS server's certificate chain against trusted roots and ensuring the hostname matches. Policy changes are reflected and detected based on the 'max_age' directive within the policy file, which specifies how long the policy can be cached before a new check is required. Both manual command-line checks using tools like 'dig' and 'curl', and automated online validation tools, simplify this complex verification process, helping administrators confirm proper implementation and quickly identify any misconfigurations or unauthorized alterations.

Key findings

  • Two-Phase Lookup: MTA-STS policy detection is a two-step process: querying a _mta-sts.<domain> DNS TXT record and then fetching the mta-sts.txt policy file from a well-known HTTPS URL.
  • Standardized Location: The MTA-STS policy file is always stored at a fixed, 'well-known' URL path, typically /.well-known/mta-sts.txt, on an mta-sts.<domain> subdomain.
  • HTTPS Security is Key: Verification involves validating the HTTPS server's TLS certificate chain against trusted root CAs and ensuring the hostname matches the expected mta-sts.<domain>.
  • Max_Age for Updates: The 'max_age' directive within the policy file dictates how long receiving MTAs cache the policy, thereby controlling the interval for detecting policy changes.
  • Automated Verification Tools: Numerous online tools and services automate the entire MTA-STS verification process, checking DNS records, fetching policies, and validating their content and certificates.
  • Command-Line Verification: Manual verification can be performed using command-line tools like 'dig' for DNS lookups and 'curl' or 'wget' for fetching the HTTPS policy file.
  • Real-World Adaptability: Policies can revert from 'enforce' to 'testing' mode, as seen with Yahoo, indicating the need for flexibility and continuous monitoring in implementation.

Key considerations

  • DNS TXT Record Accuracy: Ensure the _mta-sts.<domain> DNS TXT record is correctly published with a valid 'id' to initiate the policy lookup process.
  • Secure HTTPS Hosting: The MTA-STS policy file must be hosted securely over HTTPS on your web server with a valid, trusted TLS certificate for the mta-sts.<domain> subdomain.
  • Policy File Accessibility: The mta-sts.txt file must be publicly accessible at the /.well-known/mta-sts.txt path to be retrieved by sending MTAs.
  • Understanding Max_Age: Correctly configure the 'max_age' value in your policy file, as it determines how frequently sending MTAs will check for policy updates.
  • Continuous Monitoring: Regularly monitor both the DNS TXT record and the HTTPS-hosted policy file for any unauthorized changes, misconfigurations, or accidental deletions.
  • Validation Tools are Essential: Utilize dedicated MTA-STS validation tools to verify your policy's correct implementation, accessibility, and adherence to RFC standards.
  • Consistent Policy ID: The 'id' value in the DNS TXT record must match the 'id' value within the policy file to ensure integrity and proper policy application.

What email marketers say

12 marketer opinions

The detection and verification of MTA-STS policy changes build upon the foundational two-phase lookup by focusing on the active methodologies. This involves a systematic approach to confirm the integrity of both the DNS TXT record and the HTTPS-hosted policy file. Practical verification methods range from manual command-line execution, using tools like 'dig' to inspect the '_mta-sts' DNS TXT record for the policy ID and 'curl' to retrieve the 'mta-sts.txt' policy file, to leveraging specialized online validation tools. These automated tools streamline the process by performing comprehensive checks, including DNS lookups, secure retrieval of the policy file via HTTPS, validation of the TLS certificate, and parsing of the policy content to ensure correct formatting, matching IDs, and proper 'max_age' and 'mode' settings. Continuous monitoring services are also crucial, providing alerts for discrepancies or unauthorized alterations, which is vital given real-world scenarios such as Yahoo's observed transition between enforcement and testing modes.

Key opinions

  • Verification Methodologies: MTA-STS policy verification actively involves validating the DNS TXT record, fetching the HTTPS policy file, validating its TLS certificate, and comparing policy details like 'id', 'mode', and 'max_age'.
  • Online Validation Tools: Specialized online tools are the simplest and most comprehensive way to detect and verify MTA-STS policies, automating DNS lookups, HTTPS fetches, and content parsing.
  • Manual Command-Line Checks: Administrators can manually detect and verify policies using command-line tools such as 'dig' for DNS TXT records and 'curl' or 'wget' for retrieving and inspecting the HTTPS policy file.
  • Importance of Policy ID Match: A critical detection and verification step is ensuring the 'id' in the DNS TXT record precisely matches the 'id' within the HTTPS-hosted policy file.
  • Detection via Log Observation: Policy changes, like a shift to 'enforce' mode or a reversion to 'testing', can be detected by monitoring server logs for messages reflecting the applied MTA-STS policy.
  • Continuous Monitoring for Alerts: Dedicated services provide continuous monitoring of MTA-STS policies, alerting users to any discrepancies, unauthorized changes, or misconfigurations in real time.

Key considerations

  • Regular Policy Checks: Conduct routine checks of both the DNS TXT record and the HTTPS-hosted policy file to proactively detect any unintended changes or misconfigurations.
  • Validate TLS Certificates: When fetching the HTTPS policy file, always verify the validity and chain of the TLS certificate to ensure secure and authentic policy retrieval.
  • Match DNS and File IDs: Consistently compare the 'id' value from the DNS TXT record with the 'id' in the policy file, as a mismatch indicates an issue or outdated policy.
  • Monitor Policy Mode and Max_Age: Pay close attention to the 'mode' (enforce, testing, none) and 'max_age' values in the policy file, as these dictate policy enforcement and caching behavior.
  • Leverage Automated Validators: Utilize reputable online MTA-STS validation tools to perform comprehensive checks and quickly identify compliance issues or policy errors.
  • Implement Proactive Monitoring: Set up continuous monitoring solutions that alert you to any alterations in your MTA-STS DNS record or policy file, protecting against tampering or errors.
  • Observe MTA Logs: For internal verification, review your mail server logs for indicators of MTA-STS policy application and any reported issues, similar to how Yahoo's changes were observed.

Marketer view

Email marketer from Email Geeks explains how he detected Yahoo's move to an enforce MTA-STS policy by observing logs and an increase in messages logged with an enforce policy. He also clarifies that the MTA-STS policy is stored in a fixed location, providing the example of https://mta-sts.yahoo.com/.well-known/mta-sts.txt, and later notes that Yahoo reverted to testing mode, suggesting they encountered issues.

6 Feb 2025 - Email Geeks

Marketer view

Email marketer from Email Geeks shares that Yahoo publishes its MTA-STS TXT record, indicating how to verify it using a DNS lookup tool.

29 Jan 2023 - Email Geeks

What the experts say

2 expert opinions

Receiving mail servers initiate MTA-STS policy detection through a two-step process, first querying a DNS TXT record in the `_mta-sts` subdomain, then fetching the detailed policy from a specific HTTPS URL. Policy updates are managed by the `max_age` value, which dictates how long a policy is cached before a new retrieval is prompted. Verification critically relies on the secure HTTPS connection used for policy retrieval, ensuring the authenticity of the policy data. It is important to note that the policy may be hosted on the domain associated with the MX record, ensuring proper alignment for email reception.

Key opinions

  • Two-Phase Policy Lookup: MTA-STS policy detection involves a two-part process: first, a DNS TXT record query for the `_mta-sts` subdomain, followed by fetching the policy file from a well-known HTTPS URL.
  • HTTPS for Policy Verification: Verification of the MTA-STS policy critically depends on the secure HTTPS connection used to retrieve the policy file, ensuring its authenticity and integrity.
  • Max_Age Controls Updates: The `max_age` field within the MTA-STS policy file is central to detecting changes, as it dictates the policy's caching duration and prompts receiving servers to re-fetch after expiration.
  • Standardized Policy Location: The actual MTA-STS policy data is consistently located at a 'well-known' URL path, typically `/.well-known/mta-sts.txt`, on the specified domain.
  • MX Domain Policy Hosting: In some cases, the domain hosting the MTA-STS policy file via HTTPS may correspond to the domain of the MX record, facilitating policy association.

Key considerations

  • Accurate DNS TXT Records: Ensure the `_mta-sts` DNS TXT record is correctly configured, as it serves as the initial pointer for policy discovery by receiving servers.
  • Secure HTTPS Hosting: The MTA-STS policy file must be securely hosted via HTTPS, as verification relies on the integrity and trustworthiness of this connection.
  • Optimal Max_Age Setting: Carefully determine the `max_age` value in your policy, as it dictates the caching duration and how quickly receiving servers will check for policy updates.
  • Policy File Accessibility: Confirm that the MTA-STS policy file is publicly accessible at its well-known HTTPS URL to ensure receiving MTAs can retrieve it.
  • Domain Consistency: Be aware that the policy might be hosted on the domain specified by your MX record, requiring alignment between your DNS setup and web server configuration.

Expert view

Expert from Spam Resource explains that MTA-STS policy detection by receiving servers involves two steps: first, a DNS TXT record query in the _mta-sts subdomain (e.g., _mta-sts.example.com) is performed. This TXT record points to a well-known URL (e.g., https://mta-sts.example.com/.well-known/mta-sts.txt) where the actual policy data is fetched via HTTPS. Verification relies on the secure HTTPS connection and the max_age field in the policy, which dictates how long the policy is cached before a new check is required.

28 Sep 2022 - Spam Resource

Expert view

Expert from Word To The Wise explains that detecting MTA-STS policies involves a two-part lookup: a DNS TXT record lookup for _mta-sts.example.com and then fetching the policy file from a well-known HTTPS URL (e.g., https://mail.example.com/.well-known/mta-sts.txt), where mail.example.com is the domain's MX record. Policy changes are detected by observing the max_age field within the policy, which specifies the caching duration, prompting re-fetching of the policy once expired to ensure the latest version is used.

16 Dec 2021 - Word To The Wise

What the documentation says

5 technical articles

Sending Mail Transfer Agents (MTAs) play a crucial role in detecting and verifying MTA-STS policies. This process begins with the sending MTA querying the DNS for a specific TXT record, typically `_mta-sts.<domain>`, which indicates the policy's existence and location. Following this initial DNS lookup, the MTA proceeds to fetch the actual policy file over a secure HTTPS connection from a standardized, well-known URL path, commonly `https://mta-sts.<domain>/.well-known/mta-sts.txt`. A critical step in this retrieval is the validation of the HTTPS server's TLS certificate chain against trusted root Certificate Authorities, ensuring both the authenticity of the policy source and that the hostname matches. Policy changes are primarily detected and applied based on the `max_age` directive specified within the policy file, which dictates how long sending MTAs should cache the policy before re-fetching it to check for updates. Administrators can verify their implementation using tools like Google Admin Toolbox Dig or by checking server configurations, ensuring the policy is correctly hosted and accessible.

Key findings

  • Sending MTA Driven: Sending Mail Transfer Agents (MTAs) actively perform the two-step detection and verification process for MTA-STS policies, beginning with a DNS lookup.
  • Policy Fetch via HTTPS: After DNS discovery, the MTA fetches the detailed policy file exclusively over a secure HTTPS connection from a standardized `/.well-known/mta-sts.txt` URL.
  • TLS Certificate Validation: Integrity and authenticity are ensured by the sending MTA's strict validation of the HTTPS server's TLS certificate chain against trusted root CAs and a matching hostname.
  • Max_Age Controls Updates: The `max_age` directive in the policy file is the primary mechanism for detecting changes, dictating the caching duration and prompting sending MTAs to re-fetch expired policies.
  • Admin Verification Tools: Administrators can leverage specific tools, like Google Admin Toolbox Dig, to verify the correct publication of the DNS TXT record and the secure hosting of the policy file.
  • Standardized Location: The policy file's location is consistently defined at `https://mta-sts.<domain>/.well-known/mta-sts.txt`, which simplifies discovery for sending MTAs.

Key considerations

  • Accurate DNS TXT Records: The `_mta-sts.<domain>` DNS TXT record must be precisely configured to ensure sending MTAs can correctly discover your MTA-STS policy.
  • Secure HTTPS Hosting: The MTA-STS policy file must be hosted securely over HTTPS, with a valid and trusted TLS certificate specifically for the `mta-sts.<domain>` subdomain.
  • Hostname and Certificate Match: Crucially, the hostname used to access the policy, typically `mta-sts.<domain>`, must match the hostname on the HTTPS server's TLS certificate to pass validation.
  • Optimal Max_Age Setting: Carefully configure the `max_age` value within your MTA-STS policy file, as it directly governs how frequently sending MTAs will check for policy updates.
  • Policy File Accessibility: Ensure the `mta-sts.txt` policy file is publicly accessible at the standard `/.well-known/mta-sts.txt` path for all sending MTAs to retrieve.
  • Regular Verification Tool Use: Proactively utilize online MTA-STS validation tools, such as Google Admin Toolbox Dig, and command-line checks to confirm your policy's correct implementation, accessibility, and integrity.

Technical article

Documentation from RFC Editor explains that MTA-STS policies are retrieved via HTTPS from a well-known URL path (/.well-known/mta-sts.txt) on the destination domain. The policy file's integrity is validated by checking the certificate chain of the HTTPS server against trusted root CAs and ensuring the hostname matches. Changes are detected by fetching the policy at intervals specified by the max_age directive, with caching mechanisms in place.

15 Nov 2021 - RFC Editor

Technical article

Documentation from Google Workspace Admin Help shares that administrators can verify their MTA-STS policy implementation by using tools like the Google Admin Toolbox Dig tool to check the DNS TXT record for '_mta-sts' and then ensuring the policy file is correctly hosted at the specified URL (https://mta-sts.yourdomain.com/.well-known/mta-sts.txt) and accessible via HTTPS with a valid certificate. Policy changes are reflected based on the 'max_age' value in the policy.

28 Apr 2025 - Google Workspace Admin Help

Start improving your email deliverability today

Sign up
    How to detect and verify MTA-STS policy changes and locations? - Technicals - Email deliverability - Knowledge base - Suped