By elgon
Exim seems to be “delivering” mail locally if the recipient is on the same domain as the webserver. How do I force exim to always send out the mail?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Had the same issue. Here’s what I did to troubleshoot.
See where it fails by running (change example@domain.com to your destination)
exim -bt example@domain.com
Check if your hosts are getting resolved properly by running these commands on the terminal.
# the following should show the short 'hostname'
hostname
# following should show the full domain name (without www or subdomains)
hostname --fqdn
# following should show the external IP (not 127.0.0.1)
hostname -i
If all is good, and if the block is still unroutable, force the exim configuration to route it. So edit /etc/exim/exim4.conf.template file, and find the block within .ifdef DCconfig_internet. Add this as the first rule. (Change example.com to your domain)
my_domain_routing:
debug_print = "R: dnslookup for $local_part@$domain"
driver = dnslookup
domains = example.com
transport = remote_smtp
# ignore private rfc1918 and APIPA addresses
ignore_target_hosts = 0.0.0.0 : 127.0.0.0/8 : 192.168.0.0/16 :\
172.16.0.0/12 : 10.0.0.0/8 : 169.254.0.0/16 :\
255.255.255.255
no_more
Run the routing test again to see if it passes now.
Note about exim4.conf.template file. This can get regenerated if you run the config utility again. To avoid this, duplicate this change in the /etc/exim/conf.d/routing/ folder as well.
I was able to resolve this issue, I had inadvertently set the hostname to the domain name. Setting the hostname to:
something.domain.com and then reconfiguring exim fixed the issue.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.