views:

883

answers:

5

Mail for my domain is handled by google apps service, all required DNS MX records entered correctly. Also I have webserver that handles HTTP requests for the domain. And I can't send mail from that server to my mail domain, sendmail ignores MX records and always trying to deliver all messages for my domain locally.

Looks like it consider domain name as local if it resolves to local ip address.

This is a cut from the logs:

Feb  7 18:03:03 vds sendmail[4100]: n17I33c2004100: [email protected]... User unknown
Feb  7 18:03:03 vds sendmail[4100]: n17I33c2004100: [email protected], delay=00:00:00, mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Feb  7 18:03:03 vds sendmail[4100]: n17I33c2004100: from=root, size=36, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
+1  A: 

Ditch sendmail and get postfix. Sendmail is difficult to configure correctly, and difficult to keep secure. Postfix is easy on both counts. I have no experience with them, but I'm told that qmail and exim are equally good.

Paul Tomblin
+1  A: 

Well. Found a solution for my case.

Just add the following line to your source .mc-file and recreate sendmail.cf

define(`confDONT_PROBE_INTERFACES', `true')
Sergei Stolyarov
A: 

It solved mine too. I was having the same problem. That is, my sendmail was delivering messages locally instead of delivering them to the Google Apps mail account.

Thanks.

Rubens Gomes http://www.rubens-gomes.com/

A: 

Thank God for your comment, Rubens, "my sendmail was delivering messages locally instead of delivering them to the Google Apps mail account"! That's where all the missing emails are that my programs have been trying to send to various employees. Unfortunately I don't understand the solution "define(confDONT_PROBE_INTERFACES', true')". Is someone willing to talk to me further on this?

It depends on what mail server you are using, what OS etc. Unfortunately I'm not using freebsd anymore (thanks god!) so don't have this problem and don't remember which file should be changed. If you're using sendmail try to find file sendmail.mc, add the line ("define(bla-bla-bla") to sendmail.mc and issue command make in the directory where sendmail.mc is.
Sergei Stolyarov
A: 

While I'm looking for the solution for the same issue on my server, there is a work around for you: go to your google app email box, to settings/accounts, then create a new account to pull the emails from, as mail server specify IP of your own server and also give it username and password that was working for your previous mailing solution (before google apps).

That way you'll have google sign into your local mail server and pick up all the 'lost' emails, each 10 or so minutes.

One thing though - this workaround might work only on dedicated servers, I'm not sure what will happen with shared hosting.