Email routing if not found locally try remote
I've got a weird setup with my emails that I need someones brain to look at. I've got it setup like this so that most of my emails are on one server (server1) and then 1 single account is setup on a second server hidden from the rest (server2)
Email Sent to user1@example.com
MX record for example.com = mail.example.com
A record for mail.example.com = server1 (11.11.11.11)
Email forwarding rule forwards all email sent to user1@example.com to user@2.example.com
MX record for 2.example.com = mail2.example.com
A record for mail2.example.com = server2 (22.22.22.22) a cpanel server
Email hits my server now addressed to user1@2.example.com
Domain forwarding rule forwards all email sent to @2.example.com to @example.com
This works great however my mail routing in cpanel is set to local, and therefore when sending emails out on server2 (22.22.22.22) to users@example.com they're always delivered locally first and foremost
Is there any way around this? so that outgoing mail on this domain obey's DNS records (the mx records) and delivers it firstly to server1 (11.11.11.11) as if it was being sent from any other domain, gmail etc. Perhaps if the account isn't found locally then send on out to the web? Or perhaps there is a way to setup an alias somehow to let the local account receive mail for user1@2.example.com
Thanks for your time & efforts looking into this
Henry
-
Sorted... Deleted the forwarder from user1@2.example.com Instead used a cron job to move all the mail from the cur & new folders in mail/2.domain.com/ilkley folder to the folders in mail/domain.com/ilkley Set this cron job to run every minute & then set the email routing for example.com > remote mail exchanger 2.domain.me > local mail exchanger 0 -
Hi @Henry Aspden That's an interesting solution for the issue, thanks for sharing it! I'm glad to see you were able to get it sorted on your own. Thanks! 0
Please sign in to leave a comment.
Comments
2 comments