Replace Content Domain
- Table of Contents
- Introduction
- Configuration
- Example Configuration
- What is Replaced
- Caveats and Warnings
Introduction
GreenArrow allows you to replace the domain name used in email messages based upon the actual IP address used to deliver the email.
Configuration
The configuration directive replace_content_domain is used to configure content domain replacement.
Example Configuration
ip_address * {
replace_content_domain default-for-all-ips.example.com
}
ip_address ipaddr-1 {
replace_content_domain specific-ip.example.com
}
relay_server * {
replace_content_domain default-for-all-relays.example.com
}
relay_server relay-1 {
replace_content_domain specific-relay.example.com
}
In the above configuration, the IP address ipaddr-1
will use the domain
example-other-domain.com
. All other IPs will use the domain
example-primary-domain.com
.
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.
From domains
If the directive replace_content_domain_applies_to_from_domain is enabled,
whatever domain(s) are listed in the From
header(s) will also be replaced with
the new domain.
A simple string replacement is performed, replacing existing domains with the
new domain. This means that if you have unusual encoding or wrapping in your
From
header, the domain may not be replaced as expected.
Reply-To domains
If the directive replace_content_domain_applies_to_reply_to_domain is enabled,
whatever domain(s) are listed in the Reply-To
header(s) will also be replaced with
the new domain.
A simple string replacement is performed, replacing existing domains with the
new domain. This means that if you have unusual encoding or wrapping in your
Reply-To
header, the domain may not be replaced as expected.
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.
List-Unsubscribe
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.
Performance
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.