0

Please excuse the horrible title. I've been banging my head against this issue all afternoon, only to realize that I was on a wild goose chase.

In short:

  • Set up Google Apps to handle incoming emails for my domain (foobar.org)
  • Set up exim4 on my Linode to send outgoing emails for my web app
  • Tested by sending emails to my private email (julian@otherdomain.net), and to work email (julian@foobar.org).

After 3 hours, I still could not figure out why emails were being received at otherdomain.net, but not at foobar.org.

So I gave up. Ctrl+D out of the super-user account, and saw: You have new mail in /var/mail/julian

facepalm


So, any outgoing emails sent to foobar.org get delivered to the local user account. Makes sense. How do I tell exim4 to send the email out to the interwebs, so when it comes back to my DNS, it'll be routed to Google's servers?

vahid abdi
  • 9,636
  • 4
  • 29
  • 35
Julian H. Lam
  • 25,501
  • 13
  • 46
  • 73

3 Answers3

0

Your local mail service needs to be set up to use the MX record for your domain. Using things like Plesk or Cpanel it's a case of shutting down the email service and ensuring the local DNS records included an A record for the external mail exchanger (Google) and a suitable MX record pointing to it.

0

In the end, I had an incorrect hosts file entry added when setting up my server.

I had the following entry:

public-ip    domain.tld    machinename

Although the following was more appropriate

public-ip    machinename.domain.tld    machinename

From then on, all emails sent to domain.tld ended up being sent out of the server.

Julian H. Lam
  • 25,501
  • 13
  • 46
  • 73
0

This worked for me.

https://serverfault.com/a/341779/80240

Community
  • 1
  • 1
cmc
  • 4,294
  • 2
  • 35
  • 34