Email routing if not found locally try remote

Henry Aspden

Member
Nov 2, 2015
7
2
3
Leeds, UK
cPanel Access Level
Root Administrator
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 [email protected]
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 [email protected] to [email protected]

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 [email protected]
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 [email protected] 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 [email protected]

Thanks for your time & efforts looking into this

Henry
 
Last edited by a moderator:

Henry Aspden

Member
Nov 2, 2015
7
2
3
Leeds, UK
cPanel Access Level
Root Administrator
Sorted...

Deleted the forwarder from [email protected]

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
 
Last edited by a moderator: