DMARC Engine
Home/Blog/DMARC and Email Header Rewriting
Blog

DMARC and Email Header Rewriting

Email header rewriting can alter the From header, causing DMARC alignment to fail, leading to delivery issues. Concrete examples and solutions are provided

18 August 2026 · DMARC Engine · 37 min read

DMARC and Email Header Rewriting

The Hidden Dangers of Email Header Rewriting on DMARC

Email header rewriting, a common practice in email forwarding and mailing lists, can have unintended consequences on DMARC, leading to authentication failures and delivery issues. At DMARC Engine, we have seen numerous cases where email header rewriting has broken DMARC alignment, resulting in emails being rejected or flagged as spam. In this section, we will delve into the hidden dangers of email header rewriting on DMARC and provide concrete examples of how it can affect email deliverability.

One of the primary issues with email header rewriting is that it can alter the From header, which is used by DMARC to determine the domain alignment. For instance, if an email is forwarded from example.com to forwarded.example.com, the From header may be rewritten to forwarded.example.com, causing DMARC alignment to fail. This can be seen in the following example:

From: user@example.com
To: forwarded-user@forwarded.example.com

becomes

From: user@forwarded.example.com
To: forwarded-user@forwarded.example.com

In this case, the DMARC check will fail because the From domain forwarded.example.com does not match the domain in the Return-Path header, which is still example.com. This can lead to emails being rejected or flagged as spam, even if the email is legitimate.

Another issue with email header rewriting is that it can affect the DKIM signature. When an email is forwarded, the DKIM signature may be invalidated if the rewriting process alters the headers or body of the email. For example, if the rewriting process adds or removes headers, the DKIM signature will no longer match the email content, causing the DKIM check to fail. This can be seen in the following example:

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.com;
 s=selector; t=1643723900;
 bh=...;
 h=From:To:Subject;
 b=...

If the rewriting process adds a new header, such as X-Forwarded-For, the DKIM signature will no longer match the email content, causing the DKIM check to fail.

In a hosted or managed setup, such as DMARC Engine, we can mitigate some of these issues by using advanced DMARC features, such as the ps alignment mode, which allows for a more relaxed alignment check. However, this is not a foolproof solution, and email header rewriting can still cause issues.

To minimise the impact of email header rewriting on DMARC, it is essential to use a rewriting solution that preserves the original From header and DKIM signature. One approach is to use a solution that adds a new header, such as X-Original-From, to preserve the original From header. For example:

From: user@forwarded.example.com
X-Original-From: user@example.com
To: forwarded-user@forwarded.example.com

This allows the DMARC check to use the original From header, while still allowing the rewriting process to alter the From header for delivery purposes.

In addition, it is crucial to monitor DMARC aggregate reports to detect any issues caused by email header rewriting. By analysing these reports, email administrators can identify rewriting issues and take corrective action to preserve DMARC alignment and ensure email deliverability.

In short, email header rewriting can have unintended consequences on DMARC, leading to authentication failures and delivery issues. To mitigate these issues, it is essential to use a rewriting solution that preserves the original From header and DKIM signature, and to monitor DMARC aggregate reports to detect any rewriting issues. By taking a proactive approach to email header rewriting, email administrators can ensure that their emails are delivered successfully and that their domain reputation is preserved. At DMARC Engine, we recommend that our customers take a careful approach to email header rewriting, and we provide guidance and support to help them navigate the complexities of DMARC and email deliverability.

Real-World Scenarios: When Intermediaries Break DMARC

When dealing with DMARC, one of the most significant challenges is handling intermediaries that can break DMARC alignment, leading to failed authentication and potential delivery issues. Intermediaries, such as mailing lists, forwarding services, or email security gateways, can modify email headers, causing the DKIM signature to fail or the SPF check to pass with a different domain. This is particularly problematic when the intermediary does not rewrite the headers in a way that maintains DMARC alignment.

For instance, consider a scenario where a company uses a mailing list service to send newsletters to their subscribers. The mailing list service may add its own headers, such as a List-Id or X-Mailer header, which can cause the DKIM signature to fail. If the company has implemented DMARC with a policy of p=reject, this could lead to the email being rejected by the receiving mail server, resulting in delivery failures.

DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=example.com; s=selector1;
 h=From:To:Subject:MIME-Version:Content-Type;
 bh=...; b=...

In this example, the DKIM signature is generated by the company's mail server, but the mailing list service may modify the headers, causing the signature to fail. To mitigate this, the company could use a relaxed DKIM alignment, such as adkim=r, which allows for some flexibility in the DKIM signature verification.

Another common scenario is when an email security gateway or a cloud-based email service modifies the email headers, causing the SPF check to fail. For example, if an email is sent from a company's mail server to a recipient's mail server via a cloud-based email security service, the security service may add its own IP address to the Received header, causing the SPF check to fail.

Received: from mail.example.com (mail.example.com [192.0.2.1])
 by security.example.net (Postfix) with ESMTP id 1234567890
 for <recipient@example.net>; Thu, 18 Feb 2023 14:30:00 +0000

In this case, the SPF check would fail because the IP address of the security service (192.0.2.1) is not included in the company's SPF record. To resolve this, the company could add the IP address of the security service to their SPF record or use a third-party SPF service that can handle this scenario.

In a hosted or managed setup, such as the one provided by DMARC Engine, these scenarios can be handled more efficiently. For instance, DMARC Engine can provide detailed aggregate reports that highlight DMARC failures caused by intermediaries, allowing email administrators to identify and address the issues more quickly. Also, DMARC Engine can offer guidance on how to optimise DMARC settings and SPF records to minimise the impact of intermediaries on email deliverability.

It is also worth considering the impact of email header rewriting on DMARC alignment. When an intermediary rewrites the headers, it can cause the From domain to be modified, leading to a DMARC alignment failure. To mitigate this, email administrators can use a spf alignment of relaxed, which allows for some flexibility in the SPF check.

DMARC: v=DMARC1; p=reject; sp=none; adkim=r; aspf=r; pct=100; fo=1

In this example, the DMARC policy is set to reject, but the adkim and aspf alignments are set to relaxed, allowing for some flexibility in the DKIM and SPF checks.

In short, when dealing with intermediaries that can break DMARC alignment, it is crucial to understand the specific scenarios that can cause DMARC failures and to take steps to mitigate them. This can include using relaxed DKIM and SPF alignments, adding IP addresses to SPF records, and monitoring DMARC aggregate reports to identify and address issues quickly. By taking a proactive approach to managing intermediaries and DMARC alignment, email administrators can optimise their email deliverability and minimise the risk of delivery failures.

Understanding the Impact on SPF, DKIM, and DMARC Alignment

When email headers are rewritten, the impact on SPF, DKIM, and DMARC alignment can be significant, and it is crucial to understand these effects to optimise email deliverability. In a hosted or managed DMARC setup, such as the one we operate at DMARC Engine, we often see customers struggling with the consequences of email header rewriting on their authentication mechanisms.

One of the primary concerns is the rewriting of the Return-Path header, which is used by SPF to determine the domain that is authorised to send emails on behalf of the sender's domain. For instance, if an intermediary rewrites the Return-Path header from bounce@example.com to bounce@intermediary.com, SPF checks may fail because the intermediary's domain is not listed in the sender's SPF record. To mitigate this, it is essential to include the intermediary's domain in the SPF record, as shown in the following example:

example.com. IN TXT "v=spf1 include:intermediary.com -all"

However, this approach requires careful management to avoid over-permitting, which can lead to spam and abuse.

DKIM, on the other hand, is more resilient to email header rewriting because it uses a cryptographic signature to authenticate the email headers and body. Nevertheless, if an intermediary modifies the email headers, the DKIM signature may no longer match the rewritten headers, causing DKIM verification to fail. To address this issue, it is vital to ensure that intermediaries do not modify the headers that are included in the DKIM signature, such as the From and Subject headers.

In a managed setup, we often recommend using a relaxed DKIM canonicalisation algorithm, such as relaxed/relaxed, to reduce the impact of minor header modifications on DKIM verification. The following example illustrates a DKIM record with relaxed canonicalisation:

default._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC+yt+4BcTm4xKzAXHj6j9QkzQc8hl+JU4yz4H0k+2QJqjJj8RyJ0Ftjp0XbJU4E+1jHxkX6Q0zgKX6Q0zgKX6Q0zgKX6Q0zgKX6Q0zgKX6Q0zgKX6Q0zgKX6Q0zgKX6Q0zgKX6Q0zgKX6Q0zgKX6Q0zgKX6Q0zgKX6Q0z"

DMARC alignment is also affected by email header rewriting, particularly when the From header is modified. To achieve DMARC alignment, the domain in the From header must match the domain in the SPF or DKIM authentication mechanism. If an intermediary rewrites the From header, DMARC alignment may be broken, causing DMARC verification to fail.

To preserve DMARC alignment, it is essential to ensure that intermediaries do not modify the From header or that the modified header still aligns with the SPF or DKIM domain. In our experience, using a DMARC policy with a p tag set to none can help identify alignment issues, as shown in the following example:

_dmarc.example.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:dmarc@example.com; ruf=mailto:dmarc@example.com; fo=1"

In this example, the DMARC policy is set to monitor mode, which allows us to collect aggregate reports and identify potential alignment issues without affecting email deliverability.

In addition to these technical considerations, it is crucial to centre the email deliverability strategy around the management of intermediaries and the minimisation of email header rewriting. This can be achieved by implementing a robust email authentication mechanism, monitoring email headers and authentication mechanisms, and working closely with intermediaries to ensure that they do not modify email headers in a way that breaks authentication or alignment.

By taking a proactive and managed approach to email header rewriting and its impact on SPF, DKIM, and DMARC alignment, email administrators can optimise email deliverability, reduce the risk of spam and abuse, and improve the overall security and integrity of their email ecosystem. In our experience, a managed DMARC setup, such as the one we operate at DMARC Engine, can provide valuable insights and guidance on how to navigate the complexities of email header rewriting and authentication, ultimately helping organisations to preserve their brand reputation and maintain a high level of email deliverability.

To illustrate the importance of careful management, consider a scenario where an organisation uses a third-party email service provider to send marketing emails. If the service provider rewrites the email headers in a way that breaks SPF, DKIM, or DMARC alignment, the organisation's emails may be blocked or flagged as spam, resulting in a loss of reputation and deliverability. By working closely with the service provider and implementing a robust email authentication mechanism, the organisation can minimise the risk of header rewriting and ensure that their emails are delivered to the intended recipients.

In conclusion to this section, the impact of email header rewriting on SPF, DKIM, and DMARC alignment is a critical consideration for email administrators, and a managed approach can help mitigate the risks and optimise email deliverability. By understanding the technical implications of header rewriting and implementing a robust email authentication mechanism, organisations can preserve their brand reputation, reduce the risk of spam and abuse, and maintain a high level of email deliverability.

Diagnosing DMARC Failures: A Deep Dive into Aggregate Reports

Diagnosing DMARC failures can be a complex task, especially when dealing with a large volume of emails and multiple senders. At the centre of this process are aggregate reports, which provide valuable insights into DMARC failures. These reports are typically sent to the domain owner by receivers, such as Gmail or Yahoo, and contain information about emails that failed DMARC validation.

When analysing aggregate reports, it is essential to understand the report format and the information it contains. The reports are usually in XML format and include details such as the sender's IP address, the email header, and the reason for the DMARC failure. For instance, a report might indicate that an email failed DMARC due to a mismatch between the From domain and the Return-Path domain, which is a common issue when using email service providers or mailing lists.

<feedback>
 <version>1</version>
 <record>
 <row>
 <source_ip>192.0.2.1</source_ip>
 <count>10</count>
 <policy_evaluated>
 <disposition>none</disposition>
 <dkim>fail</dkim>
 <spf>fail</spf>
 </policy_evaluated>
 </row>
 </record>
</feedback>

In this example, the report indicates that 10 emails from the IP address 192.0.2.1 failed DMARC validation due to both DKIM and SPF failures. This information can be used to identify the root cause of the issue and take corrective action.

One common issue that can cause DMARC failures is email header rewriting, which can break the DKIM signature or alter the SPF alignment. When an email is forwarded or redirected, the email headers may be modified, which can cause the DKIM signature to fail verification. Similarly, if the Return-Path domain is rewritten, it can affect the SPF alignment and cause DMARC failures.

To diagnose DMARC failures caused by email header rewriting, it is crucial to examine the email headers and the aggregate reports carefully. Look for any signs of header rewriting, such as changes to the From or Return-Path domains, and check the DKIM signature and SPF alignment. In some cases, it may be necessary to use tools such as email header analysers or DMARC debugging tools to help identify the issue.

In a hosted or managed setup, such as the one we use at DMARC Engine, diagnosing DMARC failures can be more straightforward. Our system automatically collects and analyses aggregate reports, providing our customers with detailed insights into DMARC failures and recommendations for corrective action. This can include identifying email service providers or mailing lists that are causing DMARC failures and providing guidance on how to configure them correctly.

Another critical aspect of diagnosing DMARC failures is to monitor the email ecosystem regularly. This includes keeping an eye on the aggregate reports, email headers, and sender reputations. By doing so, email administrators can quickly identify and address any issues that may arise, minimising the impact on email deliverability.

In addition to monitoring the email ecosystem, it is also essential to optimise the DMARC setup regularly. This includes updating the DMARC policy, adjusting the alignment, and verifying the DKIM and SPF records. By optimising the DMARC setup, email administrators can improve the email deliverability and reduce the risk of DMARC failures.

To illustrate this, let's consider a real-world example. Suppose we have a customer who is using a mailing list service to send emails to their subscribers. The mailing list service is rewriting the email headers, which is causing DMARC failures. To diagnose the issue, we would examine the aggregate reports and email headers to identify the root cause of the problem. We might see a report like this:

<feedback>
 <version>1</version>
 <record>
 <row>
 <source_ip>198.51.100.1</source_ip>
 <count>50</count>
 <policy_evaluated>
 <disposition>none</disposition>
 <dkim>fail</dkim>
 <spf>fail</spf>
 </policy_evaluated>
 </row>
 </record>
</feedback>

In this case, the report indicates that 50 emails from the IP address 198.51.100.1 failed DMARC validation due to both DKIM and SPF failures. We would then examine the email headers to see if there are any signs of header rewriting. If we find that the mailing list service is rewriting the headers, we would work with the customer to configure the service correctly and update the DMARC setup to reflect the changes.

By taking a proactive approach to diagnosing DMARC failures and optimising the DMARC setup, email administrators can improve the email deliverability and reduce the risk of DMARC failures. This requires careful monitoring of the email ecosystem, regular analysis of aggregate reports, and a deep understanding of the DMARC protocol and its interactions with email headers and sender reputations.

In our experience, diagnosing DMARC failures is often a complex task that requires a thorough understanding of the email ecosystem and the DMARC protocol. By using the right tools and techniques, email administrators can quickly identify and address DMARC failures, improving the email deliverability and reducing the risk of spam filtering or blocking.

To make the process easier, we recommend that email administrators use a combination of automated tools and manual analysis to diagnose DMARC failures. Automated tools can help to identify potential issues and provide insights into the email ecosystem, while manual analysis can help to verify the findings and identify the root cause of the problem.

By following these best practices and staying up-to-date with the latest developments in the DMARC protocol, email administrators can optimise their DMARC setup and improve the email deliverability. This requires a deep understanding of the DMARC protocol and its interactions with email headers and sender reputations, as well as the ability to analyse complex data and make informed decisions.

In the next section, we will discuss operational guidance for setting up and monitoring DMARC, including how to configure the DMARC policy, update the DKIM and SPF records, and monitor the email ecosystem for potential issues. We will also provide recommendations for optimising the DMARC setup and improving the email deliverability.

For now, let's summarise the key takeaways from this section. Diagnosing DMARC failures requires a thorough understanding of the DMARC protocol and its interactions with email headers and sender reputations. Email administrators should use a combination of automated tools and manual analysis to identify potential issues and verify the findings. By optimising the DMARC setup and monitoring the email ecosystem regularly, email administrators can improve the email deliverability and reduce the risk of DMARC failures.

In a hosted or managed setup, such as the one we use at DMARC Engine, diagnosing DMARC failures can be more straightforward. Our system automatically collects and analyses aggregate reports, providing our customers with detailed insights into DMARC failures and recommendations for corrective action. This can include identifying email service providers or mailing lists that are causing DMARC failures and providing guidance on how to configure them correctly.

By working with a hosted or managed setup, email administrators can benefit from the expertise and resources of a dedicated team, improving the email deliverability and reducing the risk of DMARC failures. This can be especially helpful for organisations that lack the resources or expertise to manage their DMARC setup in-house.

In any case, diagnosing DMARC failures is a critical task that requires careful attention to detail and a deep understanding of the DMARC protocol. By following best practices and staying up-to-date with the latest developments, email administrators can optimise their DMARC setup and improve the email deliverability.

Operational Guidance: Setting Up and Monitoring DMARC

Setting up and monitoring DMARC effectively is crucial to optimise email deliverability and prevent spam. A key aspect of this process is understanding how DMARC records are published and how aggregate reports are used to identify authentication issues. When setting up DMARC, it is essential to start with a monitoring-only policy, as specified in the DMARC record, to gather data on email authentication without affecting deliverability. For example, a DMARC record might look like this:

_dmarc.example.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:dmarc@example.com; ruf=mailto:dmarc@example.com; fo=1"

In this record, p=none indicates that the policy is set to monitoring only, and pct=100 means that 100% of messages will be subject to this policy. The rua and ruf tags specify the email addresses where aggregate and failure reports will be sent, respectively.

When using a hosted or managed DMARC setup, such as the one provided by DMARC Engine, the process of setting up and monitoring DMARC is simplified. These services often provide a user-friendly interface to configure DMARC records and automatically collect and analyse aggregate reports. For instance, DMARC Engine's dashboard allows customers to easily set up DMARC records, view aggregate reports, and identify authentication issues.

A critical step in the DMARC setup process is validating SPF and DKIM records. SPF records must be correctly configured to include all authorised senders, and DKIM records must be properly set up to sign emails with a valid domain key. A common issue encountered during DMARC setup is SPF record misconfiguration, which can lead to authentication failures. To avoid this, it is recommended to use a tool like SPF Flusher to validate SPF records and ensure they are correctly configured.

In addition to validating SPF and DKIM records, it is essential to monitor aggregate reports regularly to identify authentication issues. Aggregate reports provide valuable insights into email authentication, including the number of messages that passed or failed DMARC authentication. By analysing these reports, email administrators can identify issues with SPF or DKIM alignment and take corrective action to improve email deliverability. For example, an aggregate report might show a high number of messages failing DMARC authentication due to SPF alignment issues. In this case, the email administrator can investigate the cause of the issue and update the SPF record accordingly.

To optimise DMARC setup and monitoring, it is crucial to implement a feedback loop that allows for continuous improvement. This involves regularly reviewing aggregate reports, identifying authentication issues, and making adjustments to DMARC records and email infrastructure as needed. By doing so, email administrators can ensure that their DMARC setup is effective in preventing spam and improving email deliverability.

In terms of specific tools and techniques, there are several options available to help with DMARC setup and monitoring. For example, the DMARC Analyser tool provides a comprehensive analysis of DMARC records and aggregate reports, highlighting authentication issues and providing recommendations for improvement. Similarly, the SPF Wizard tool helps to validate SPF records and ensure they are correctly configured.

When dealing with complex email ecosystems, it is often necessary to implement additional measures to preserve authentication and prevent DMARC failures. This might involve using techniques like email header rewriting or implementing custom DMARC policies for specific domains or senders. However, these measures must be carefully implemented to avoid introducing new authentication issues or affecting email deliverability.

In the centre of any effective DMARC setup is a deep understanding of email authentication and the ability to analyse and act on aggregate reports. By combining this knowledge with the right tools and techniques, email administrators can create a robust DMARC setup that optimises email deliverability and prevents spam. To achieve this, it is essential to stay up-to-date with the latest developments in email authentication and DMARC best practices, and to continuously monitor and improve the DMARC setup to ensure it remains effective.

A key aspect of DMARC monitoring is colour coding aggregate reports to quickly identify authentication issues. For example, a report might use red to indicate messages that failed DMARC authentication, yellow to indicate messages that passed but had authentication issues, and green to indicate messages that passed with no issues. By using this colour coding system, email administrators can quickly identify areas for improvement and take corrective action to optimise DMARC setup.

In a hosted or managed DMARC setup, the colour coding of aggregate reports is often automated, making it easier to identify authentication issues. For instance, DMARC Engine's dashboard uses a colour coding system to highlight authentication issues in aggregate reports, allowing customers to quickly identify areas for improvement.

To organise DMARC setup and monitoring effectively, it is recommended to create a centralised dashboard that provides a clear overview of DMARC records, aggregate reports, and authentication issues. This dashboard should include key metrics such as DMARC pass rates, SPF and DKIM alignment rates, and the number of messages that failed authentication. By having this information in one place, email administrators can quickly identify issues and take corrective action to optimise DMARC setup.

In addition to creating a centralised dashboard, it is essential to establish a routine for regularly reviewing aggregate reports and updating DMARC records as needed. This routine might involve weekly or monthly reviews of aggregate reports, depending on the volume of email traffic and the complexity of the email ecosystem. By establishing this routine, email administrators can ensure that their DMARC setup remains effective and up-to-date.

Overall, setting up and monitoring DMARC effectively requires a deep understanding of email authentication, the right tools and techniques, and a continuous improvement mindset. By following the guidance outlined in this section, email administrators can create a robust DMARC setup that optimises email deliverability and prevents spam. Whether using a hosted or managed DMARC setup or implementing DMARC in-house, the key to success lies in careful planning, regular monitoring, and continuous improvement.

Preserving Authentication: Strategies for Dealing with Intermediaries

When it comes to preserving authentication in the presence of intermediaries, such as mailing lists, forwarding services, or email security gateways, the centre of the problem is often the rewriting of email headers. This rewriting can cause issues with SPF, DKIM, and DMARC alignment, ultimately leading to authentication failures. To mitigate these issues, it is essential to understand the strategies available for dealing with intermediaries.

One common approach is to use a technique called "authenticated redirection", where the intermediary adds an Authentication-Results header to the email, indicating the results of the authentication checks it performed. This allows the receiving mail server to make a more informed decision about the email's authenticity. For example, consider the following Authentication-Results header:

Authentication-Results: example.com;
 spf=pass (example.com: domain of user@example.com designates
 192.0.2.1 as permitted sender)
 dkim=pass (1024-bit key; unprotected);
 dmarc=pass (p=none dis=none) header.from=user@example.com

In this example, the intermediary has added an Authentication-Results header indicating that the email passed SPF and DKIM checks, as well as DMARC. This information can be used by the receiving mail server to optimise its spam filtering decisions.

Another strategy is to use a "mailing list agent" that is designed to preserve authentication information. These agents can add a List-Id header to the email, which can be used to identify the mailing list and apply special handling rules. For instance, consider the following List-Id header:

List-Id: <list.example.com>

In this example, the mailing list agent has added a List-Id header indicating that the email was sent through the list.example.com mailing list. This information can be used by the receiving mail server to apply special handling rules, such as whitelisting the mailing list or applying relaxed spam filtering rules.

In a hosted or managed setup, such as the one provided by DMARC Engine, these strategies can be implemented and managed on behalf of the customer. For example, DMARC Engine can be configured to add an Authentication-Results header to emails that pass authentication checks, or to apply special handling rules to emails sent through mailing lists. This can help to simplify the process of preserving authentication in the presence of intermediaries.

However, it is also important to note that these strategies are not foolproof, and there are trade-offs to consider. For example, the use of authenticated redirection can add complexity to the email authentication process, and may require additional configuration and management. Similarly, the use of mailing list agents can require special handling rules to be applied, which can add complexity to the spam filtering process.

To illustrate this point, consider the following example of a DMARC record that is configured to use relaxed alignment for mailing lists:

_dmarc.example.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:example@example.com; ruf=mailto:example@example.com; adkim=r; aspf=r; fo=1"

In this example, the DMARC record is configured to use relaxed alignment for mailing lists, which can help to reduce the risk of authentication failures. However, this also means that the DMARC record is not as strict, and may allow more spam emails to pass through.

In terms of concrete recommendations, it is essential to carefully evaluate the trade-offs and consider the specific requirements of your email ecosystem. For example, if you are using a mailing list agent, it may be necessary to configure special handling rules to preserve authentication information. Similarly, if you are using authenticated redirection, it may be necessary to add additional configuration and management to ensure that the Authentication-Results header is correctly added to emails.

Ultimately, the key to preserving authentication in the presence of intermediaries is to carefully consider the strategies available and to evaluate the trade-offs. By using a combination of authenticated redirection, mailing list agents, and relaxed alignment, it is possible to optimise email authentication and minimise the risk of authentication failures. However, this requires careful planning, configuration, and management, as well as a deep understanding of the email authentication process and the specific requirements of your email ecosystem.

In real-world scenarios, the colour of the email authentication process can be quite different, depending on the specific requirements and constraints of the email ecosystem. For instance, in some cases, it may be necessary to use a combination of different strategies to preserve authentication information, such as using both authenticated redirection and mailing list agents. In other cases, it may be necessary to apply special handling rules to emails sent through specific intermediaries, such as mailing lists or email security gateways.

To organise the email authentication process and preserve authentication information, it is essential to have a deep understanding of the different strategies available and to carefully evaluate the trade-offs. This requires a significant amount of expertise and experience, as well as a thorough understanding of the email authentication process and the specific requirements of your email ecosystem. By taking a careful and considered approach, it is possible to optimise email authentication and minimise the risk of authentication failures, even in the presence of intermediaries.

In our experience, the most effective approach is to use a combination of different strategies, such as authenticated redirection and mailing list agents, and to carefully evaluate the trade-offs. This requires a significant amount of planning, configuration, and management, as well as a deep understanding of the email authentication process and the specific requirements of your email ecosystem. By taking a careful and considered approach, it is possible to preserve authentication information and optimise email authentication, even in the presence of intermediaries.

To illustrate this point, consider the following example of a DMARC aggregate report, which shows the results of authentication checks for a specific domain:

<feedback>
 <report_metadata>
 <org_name>example.com</org_name>
 <email>example@example.com</email>
 <extra_contact_info>https://example.com/dmarc</extra_contact_info>
 <report_id>1234567890</report_id>
 <date_range>
 <begin>2022-01-01T00:00:00Z</begin>
 <end>2022-01-07T23:59:59Z</end>
 </date_range>
 </report_metadata>
 <policy_published>
 <domain>example.com</domain>
 <adkim>r</adkim>
 <aspf>r</aspf>
 <p>none</p>
 <sp>none</sp>
 <pct>100</pct>
 </policy_published>
 <record>
 <row>
 <source_ip>192.0.2.1</source_ip>
 <count>10</count>
 <policy_evaluated>
 <disposition>none</disposition>
 <dkim>pass</dkim>
 <spf>pass</spf>
 </policy_evaluated>
 </row>
 </record>
</feedback>

In this example, the DMARC aggregate report shows the results of authentication checks for the example.com domain, including the number of emails that passed or failed authentication checks. This information can be used to evaluate the effectiveness of

The Role of Email Header Rewriting in Security and Deliverability

Email header rewriting is a common practice that can have significant implications for both security and deliverability, particularly in the context of DMARC. At its core, header rewriting involves modifying the headers of an email message, which can be done for a variety of reasons, including to add or remove information, to modify the apparent sender, or to insert additional headers for tracking or authentication purposes. However, this process can also introduce complexities and challenges, especially when it comes to ensuring the integrity and authenticity of email communications.

One of the primary concerns with email header rewriting is its potential impact on DMARC alignment. DMARC relies on the alignment between the domain in the From header and the domains authenticated by SPF and DKIM. If the rewriting process alters the From header, it can disrupt this alignment, leading to DMARC failures. For instance, consider a scenario where an email is sent from user@example.com, but an intermediary rewrites the From header to user@rewritten-domain.com. If the SPF and DKIM records are set up for example.com, the rewritten header will cause a DMARC failure due to the lack of alignment.

Example of a rewritten From header:
From: user@rewritten-domain.com
Original-From: user@example.com

In a hosted or managed DMARC setup, such as the one we operate at DMARC Engine, we often see cases where customers are unaware of the header rewriting happening within their email ecosystem. This can be due to various factors, including the use of third-party email service providers, mailing lists, or internal forwarding mechanisms. To mitigate these issues, it's essential to monitor DMARC aggregate reports closely and to work with the intermediaries involved to ensure that any rewriting is done in a way that preserves DMARC alignment.

Another critical aspect of email header rewriting is its impact on security. By modifying email headers, intermediaries can potentially mask malicious activity, making it more challenging to detect and prevent phishing attacks or spam. For example, an attacker might use a rewritten From header to make an email appear as though it comes from a trusted sender, increasing the likelihood of the recipient interacting with the malicious content. To combat this, it's crucial to implement robust authentication mechanisms, such as DMARC, SPF, and DKIM, and to regularly review and update these records to ensure they reflect the current email sending infrastructure.

In terms of optimising email header rewriting for security and deliverability, there are several strategies that can be employed. Firstly, it's essential to understand the email ecosystem and to identify any intermediaries that may be rewriting headers. Once these intermediaries are known, it's possible to work with them to ensure that any rewriting is done in a way that preserves DMARC alignment and does not compromise security. Also, implementing a robust monitoring system, such as the one we use at DMARC Engine, can help to quickly identify and address any issues related to header rewriting.

Example of a DMARC record that can help to identify rewriting issues:
_dmarc.example.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:aggregate@example.com; ruf=mailto:failure@example.com; fo=1"

In this example, the DMARC record is set up to send aggregate reports to aggregate@example.com and failure reports to failure@example.com. By monitoring these reports, it's possible to quickly identify any issues related to header rewriting and to take corrective action.

Ultimately, the key to successfully managing email header rewriting in the context of DMARC and email security is to maintain a deep understanding of the email ecosystem and to be proactive in monitoring and addressing any issues that arise. By working closely with intermediaries, implementing robust authentication mechanisms, and regularly reviewing DMARC aggregate reports, it's possible to optimise email header rewriting for both security and deliverability, ensuring that email communications remain trustworthy and reliable. At DMARC Engine, we centre our approach around these principles, aiming to provide our customers with the best possible tools and guidance to navigate the complexities of email header rewriting and DMARC alignment.

Case Studies: Overcoming DMARC Failures in Complex Email Ecosystems

In the centre of many organisations' email ecosystems, DMARC failures can occur due to various reasons, including email header rewriting. To optimise DMARC and minimise rewriting issues, it is crucial to understand the complexities of these ecosystems and the trade-offs involved in overcoming DMARC failures. This section will delve into real-world case studies, highlighting the challenges and solutions in complex email ecosystems.

One common challenge is dealing with third-party senders that do not support DMARC or have misconfigured their DMARC settings. For instance, a company may use a marketing automation platform to send newsletters to its customers. However, the platform may not be configured to handle DMARC correctly, leading to DMARC failures. To overcome this issue, the company can work with the platform provider to configure DMARC settings correctly or use a hosted DMARC solution that can handle third-party senders.

Another challenge is handling email forwarding, which can break DMARC alignment. When an email is forwarded, the original sender's domain is replaced with the forwarder's domain, causing DMARC failures. To address this issue, organisations can use a technique called "email masking," where the original sender's domain is preserved in the email headers. This can be achieved using a hosted DMARC solution that supports email masking.

A real-world example of this is a company that uses a cloud-based email service to forward emails from its employees to its customers. The email service rewrites the email headers, causing DMARC failures. To resolve this issue, the company can configure its DMARC settings to use a "relaxed" alignment mode, which allows for some flexibility in the alignment of the sender's domain. Alternatively, the company can use a hosted DMARC solution that supports email masking, such as DMARC Engine, to preserve the original sender's domain.

Example of a DMARC record with relaxed alignment:
_dmarc.example.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:dmarc@example.com; ruf=mailto:dmarc@example.com; fo=1"

In addition to email forwarding, another common challenge is dealing with mailing lists, which can also break DMARC alignment. When an email is sent to a mailing list, the list server rewrites the email headers, causing DMARC failures. To overcome this issue, organisations can use a technique called "list rewriting," where the mailing list server is configured to preserve the original sender's domain in the email headers.

A hosted DMARC solution can handle mailing lists by configuring the list server to use a specific domain or subdomain for sending emails. For example, a company can configure its mailing list server to use a subdomain such as "lists.example.com" for sending emails. This allows the DMARC solution to recognise the mailing list server as a legitimate sender and prevent DMARC failures.

Example of a DMARC record for a mailing list:
_dmarc.lists.example.com. IN TXT "v=DMARC1; p=none; pct=100; rua=mailto:dmarc@example.com; ruf=mailto:dmarc@example.com; fo=1"

Another challenge is dealing with email intermediaries such as security gateways or cloud-based email services. These intermediaries can rewrite email headers, causing DMARC failures. To overcome this issue, organisations can use a hosted DMARC solution that supports intermediary handling. For example, DMARC Engine provides a feature called "intermediary handling" that allows organisations to configure their DMARC settings to handle email intermediaries correctly.

In one case study, a company used a cloud-based email service to scan its emails for malware and spam. However, the email service rewrote the email headers, causing DMARC failures. To resolve this issue, the company configured its DMARC settings to use the intermediary handling feature provided by DMARC Engine. This allowed the company to preserve the original sender's domain in the email headers and prevent DMARC failures.

Example of intermediary handling configuration:
intermediary_handling = {
 "email_service": {
 "domain": "email-service.com",
 "rewrite_headers": True
 }
}

In conclusion to this section, overcoming DMARC failures in complex email ecosystems requires a deep understanding of the challenges and trade-offs involved. By using a hosted DMARC solution and configuring DMARC settings correctly, organisations can prevent DMARC failures and ensure that their emails are delivered to the intended recipients. It is essential to note that each organisation's email ecosystem is unique, and a one-size-fits-all approach may not work. Therefore, it is crucial to work with a hosted DMARC solution provider that can provide customised solutions to meet the specific needs of each organisation.

To optimise DMARC and minimise rewriting issues, organisations should consider the following best practices:

  • Use a hosted DMARC solution that supports email masking and intermediary handling
  • Configure DMARC settings to use relaxed alignment mode
  • Use a subdomain for sending emails from mailing lists
  • Configure email intermediaries to preserve the original sender's domain in email headers
  • Monitor DMARC reports regularly to identify and resolve DMARC failures

By following these best practices and working with a hosted DMARC solution provider, organisations can ensure that their emails are delivered to the intended recipients and prevent DMARC failures. The colour and complexity of email ecosystems can be challenging to navigate, but with the right tools and expertise, organisations can optimise their DMARC settings and improve their email deliverability.

Best Practices for Email Administrators: Optimising DMARC and Minimising Rewriting Issues

As email administrators, optimising DMARC and minimising rewriting issues is crucial to ensure email deliverability and security. One of the key challenges is dealing with email intermediaries, such as mailing lists and forwarding services, which can rewrite email headers and break DMARC alignment. To mitigate this, it is essential to implement a robust DMARC policy and monitor aggregate reports regularly.

In a hosted or managed setup, such as the one we operate at DMARC Engine, we centre our approach around providing customers with detailed insights into their email ecosystem. This includes identifying potential rewriting issues and providing recommendations for optimisation. For instance, we often see customers with DMARC policies set to p=none or p=quarantine, which can lead to deliverability issues if not properly configured. To address this, we advise customers to set up a DMARC policy with a p=reject flag, but only after ensuring that all legitimate email sources are properly authenticated.

A critical aspect of optimising DMARC is understanding the impact of email header rewriting on SPF, DKIM, and DMARC alignment. When an intermediary rewrites email headers, it can break the alignment between the From domain and the Return-Path domain, leading to DMARC failures. To illustrate this, consider the following example:

Received-SPF: pass (example.com: domain of user@example.com designates 192.0.2.1 as permitted sender) client-ip=192.0.2.1;
Authentication-Results: example.com; dkim=pass (1024-bit key) header.d=example.com

In this example, the email passes both SPF and DKIM checks, but if an intermediary rewrites the From header, the DMARC alignment will be broken, leading to a DMARC failure.

To diagnose DMARC failures, it is essential to analyse aggregate reports, which provide insights into email authentication issues. For instance, the following report snippet shows a DMARC failure due to a rewriting issue:

{
 "source_ip": "192.0.2.2",
 "count": 10,
 "disposition": "none",
 "dkim": {
 "d": "example.com",
 "result": "pass"
 },
 "spf": {
 "domain": "example.com",
 "result": "pass"
 },
 "reason": {
 "type": "modified",
 "comment": "header.from rewritten"
 }
}

In this example, the report shows that the email passed both SPF and DKIM checks, but the DMARC alignment was broken due to a rewriting issue. To address this, we would recommend implementing a strategy to preserve authentication, such as using a mailing list that preserves the original From header or configuring the intermediary to use a custom Return-Path domain.

In terms of operational guidance, we recommend setting up a DMARC policy with a p=reject flag and monitoring aggregate reports regularly. It is also essential to configure SPF and DKIM properly, ensuring that all legitimate email sources are properly authenticated. Also, we advise customers to test their email ecosystem regularly, using tools such as DMARC Engine's diagnostic tools, to identify potential rewriting issues and optimise their DMARC policy accordingly.

To preserve authentication, we recommend using strategies such as using a custom Return-Path domain or implementing a mailing list that preserves the original From header. For instance, the following example shows a custom Return-Path domain configuration:

Return-Path: <bounce@example.com>

In this example, the custom Return-Path domain is used to preserve the authentication of the email, ensuring that the DMARC alignment is maintained even if an intermediary rewrites the From header.

In conclusion to this section, optimising DMARC and minimising rewriting issues requires a deep understanding of email authentication and the impact of intermediaries on DMARC alignment. By implementing a robust DMARC policy, monitoring aggregate reports regularly, and preserving authentication, email administrators can ensure email deliverability and security. At DMARC Engine, we centre our approach around providing customers with detailed insights into their email ecosystem, helping them to optimise their DMARC policy and minimise rewriting issues.

Share

See where your domain stands today

Run a free DMARC scan, then let us take you to enforced p=reject with no email outage.