If a domain is created / prepared to be moved: Mail sent from a domain on the same shared server/IP may go to a site in preparation that cannot receive mail yet.
When a domain has MS Exchange:
originaldomain.com -> forwardingdomain.com (exists on same shared server / IP)-> externalmxdomain.com returns with No such recipient here.
“cp /etc/virtual/domains /etc/virtual/external_mx_domains”
Keep only domains in the file that have MX elsewhere.
“chown mail:mail /etc/virtual/external_mx_domains”
(for wrong ownership I did not see a proper error message opening the exim mail queue)
To add in default exim.conf:
domainlist external_mx_domains = lsearch;/etc/virtual/external_mx_domains
Routing in both forwarding and regular:
domains = +external_mx_domains : ! +local_domains
originaldomain.com with -all (no ~all) -> forwardingdomain.com -> externaldomain.com
Note: SPF with ‘~all’ does pass what is then called ‘softfail’.
This is the example setup from DirectAdmin for Exim – http://files.directadmin.com/services/SpamBlocker/smart_route/exim.routers.pre.conf
smart_route:
driver = manualroute
domains = ! +local_domains
ignore_target_hosts = 127.0.0.0/8
condition = “${perl{check_limits}}”
#use remote_smtp only if you do not need smtp-auth.
#transport = remote_smtp
#use auth_relay if you do need to set the remote smtpauth
transport = auth_relay
route_list = * smtp.yourisp.com
no_more
# Jan Willem Stegink's proposed design for Exim's default configuration:
# 1. Copy setup: cp /etc/virtual/domains to /etc/virtual/external_mx_domains; and keep domains that have mx elsewhere.
# 2. Do not forget: chown mail:mail external_mx_domains
# 3. Tested new code in exim.conf: domainlist external_mx_domains = lsearch;/etc/virtual/external_mx_domains
# 4. The current exim.conf does work with SRS when needed, but ignores an external MX, even if the DNS where hosting
# the website is ok: 550 No such recipient here (in reply to RCPT TO command).
server_forward_router:
driver = dnslookup
domains = meetingdistrict.nl : hostfusion.nl : prwingenieurs.nl : ! +local_domains
#domains = +external_mx_domains : ! +local_domains
ignore_target_hosts = 127.0.0.0/8
condition = ${if !eq{$original_domain}{$domain}}
condition = ${if !eq{$original_domain}{}}
condition = "${perl{check_limits}}"
transport = remote_smtp_forward_transport
no_more
transip_email:
driver = manualroute
domains = meetingdistrict.nl : hostfusion.nl : prwingenieurs.nl : ! +local_domains
#domains = +external_mx_domains : ! +local_domains
ignore_target_hosts = 127.0.0.0/8
condition = "${perl{check_limits}}"
transport = auth_relay
route_list = * vps.transip.email::587
no_more
Important notice:
My correct forwarding with SRS is received but listed as possible spam by gmail.com / outlook.com even if the original domain setting is secure. The recipient can then accept as legitimate, including future email. If received by professional freedom.nl / soverin.net in the Netherlands, there is no spam notification.