How do I configure exim4 to route all emails via a third-party SMTP server when the sender's domain, recipient's domain, and server hostname all match?
I followed this great answer and have exim4 sending emails to addresses at other domains tested and working from an Ubuntu server. My only issue is that emails where both the sender and recipient share the same domain as the server hostname, they never leave the server (and this is the expected behavior).
For example, sending from
[email protected] --
[email protected] works fine, but sending from
[email protected] --
[email protected] just routes the mail locally to /var/mail/account2, without passing through the third-party SMTP server.
I'm using Google Apps at my own domain and want to send emails from
[email protected] to
[email protected] from a machine with the hostname example.com.
I want to route them through Google's SMTP server so I see them in my other email clients. Is this possible?
Very similar questions (but for postfix) here and here.