I have a server with hostname and DNS
example.com. I also have a google apps account for
email@example.com. I have my MX records setup correctly and I can send and receive emails to and from
firstname.lastname@example.org with my personal email.
example.com, I have some code sending email using sendmail to
email@example.com. I don't have any smtp configured with sendmail. I can send mail from server
firstname.lastname@example.org, but when I try to send an email from server
email@example.com I get the following error in
... while talking to [127.0.0.1]: >>> DATA <<< 550 5.1.1 <firstname.lastname@example.org>... User unknown 550 5.1.1 <email@example.com>... User unknown <<< 503 5.0.0 Need RCPT (recipient)
I imagine this is because sendmail is receiving the email to
firstname.lastname@example.org, and going "ah-ha! I'm example.com! I just need to send it to the user on this server." rather than looking at the MX records and seeing it needs to forward them to the gmail servers.
How can I tell sendmail to forward all messages off to the gmail servers irrespective of the domain?
Note: domains changed to
example.com to protect the innocent.