Send email from server to Google Apps email address (same domains)

Orlando asked:

Possible Duplicate:
Outgoing mail from linux not being delivered

I’m sending email from a server, let’s say

I also have Google Apps email set up for hosted email, same domain,

If I get mail sent to me from anywhere else, I receive things just fine. However, if the email originates from my server, it just ends up in /var/mail/root as a delivery error saying the user is unknown.

I created a user on the server for the name which is having trouble, [email protected] Retried sending and it sends, but not to my hosted email at Google Apps. I just receive it at /var/mail/webmaster now.

I’m using sendmail. I messed around with /etc/aliases but adding webmaster: [email protected] looked useless (and I was right.)

Any help?

My answer:

It sounds like your server thinks it is and is therefore trying to deliver the mail locally rather than sending it out to the Internet.

The easiest solution is to rename the server. But this won’t cover the case of getting local mail to be delivered remotely. In that case, move on to:

Next easiest is to configure the mail server to send all mail to a smarthost (in this case Google). How you do this depends on which MTA the machine is running (sendmail, postfix, etc.) but instructions can be found easily enough by searching the Internet.

View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.