GreenArrow Email Software Documentation

Replace Content Domain


GreenArrow allows you to replace the domain name used in email messages based upon the actual IP address used to deliver the email.


The configuration directive replace_content_domain is used to configure content domain replacement.

Example Configuration

ip_address * {

ip_address ipaddr-1 {

relay_server * {

relay_server relay-1 {

In the above configuration, the IP address ipaddr-1 will use the domain All other IPs will use the domain

What is Replaced

The following is replaced:

Envelope Sender

Whatever domain is currently being used as the envelope sender (the “MAIL FROM” SMTP command) will be replaced with the new domain. In order to successfully process bounces, this means that the bounce mailbox which was used for the original domain (e.g. the return bounce mailbox) must exist in the new domain.

List-Unsubscribe and Message-ID headers

Whatever domain(s) are currently being used in these headers will be replaced with the new domain. This applies equally to headers added by GreenArrow or to headers added to the email prior to injection.

HTML and Text content

The URL domain configured for this campaign (Studio) or mail class (SimpleMH) will be replaced. This is done by substituting http(s)://OLDURLDOMAIN/ for http(s)://NEWURLDOMAIN/, regardless of context (not just in links and images), in both the HTML and text parts of the message.

Caveats and Warnings

Bounce Mailbox

You must have the same bounce mailbox in existence (e.g. the return bounce mailbox) in the old bounce domain as the new bounce domain. Failure to do so will prevent bounces from being processed correctly.

URL Domain

The new URL domain must exist and support HTTPS if needed.

This feature does not work with URL domain names that require HTML entity encoding.


If either List-Unsubscribe or X-GreenArrow-List-Unsubscribe-HTTP-URL is specified, the domains in those headers will be changed to the content domain. We recommend against doing this. It’s instead better to allow GreenArrow to add the List-Unsubscribe header.

DKIM Signatures

If any headers or content is changed as a result of this directive, any existing DKIM signatures will be stripped. New DKIM signatures will be re-added based upon whatever signing GreenArrow originally performed.

If the DKIM keys that would match this email for signing (such as changing which key is the default key for signing for the domain) are changed between the time of injection and the delivery attempt, that change will not affect to the new DKIM signatures.

If a DKIM key was deleted between the time of injection and the delivery attempt, that key will not be used when re-signing the new content.


The content replacement is done at the time of each delivery attempt. This can lead to a slight performance penalty for the additional CPU time required to replace the domains and re-sign DKIM.

Copyright © 2012–2022 GreenArrow Email