Local mail but pass through external provider - prevent local resolve with split delivery

abkarino

Registered
Feb 5, 2019
4
1
3
Egypt
cPanel Access Level
Root Administrator
Is there a way to allow the server to have local mail but when I send an email it must use MX record rather than local delivery?

More info:
I have a client who uses Microsoft Exchange for 1 email and returns the rest of the emails to the server. This config is done by using local option in Email Routing but specifying the MX record to the other mail server and the mail server directs the uncatched mails back to the server using the A record.
The problem is that when I send an email from the cpanel account, it resolve the mail server to be 127.0.0.1 rather than using MX record. If I were to choose remote in Routing then only Exchange mail works.
Any ideas on how to force the server to use MX will still allow it to receive mails?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,293
1,279
313
Houston

abkarino

Registered
Feb 5, 2019
4
1
3
Egypt
cPanel Access Level
Root Administrator
Hi @abkarino

Have you looked into the backup Mail Exchanger option? Email Routing - Version 76 Documentation - cPanel Documentation

This is for instances when the mail server with the lowest priority is pointed to an IP address not located on the server but a second MX record would.
>>>The server functions as a backup mail exchanger. The system will hold mail for this domain until a lower number mail exchanger becomes available
I think this may lead to infinite loop. The lowest priority will always be available so each time it get an email it sends it to server which in return sends it to external and ... back and forth.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,293
1,279
313
Houston
>>>The server functions as a backup mail exchanger. The system will hold mail for this domain until a lower number mail exchanger becomes available
I think this may lead to infinite loop. The lowest priority will always be available so each time it get an email it sends it to server which in return sends it to external and ... back and forth.
I don't believe so but I believe there's also a split delivery solution that is able to be utilized with exchange and google apps, where some mail is sent/received locally and some is done so on the exchange server - I believe this would also resolve your issue.

Using cPanel and Office 365 in a hybrid scenario

There are also a number of office 365 threads on this which if configured properly should allow for mail to be sent from the domain on your server (pending it's one that does not use office365) to an account using office365
 

abkarino

Registered
Feb 5, 2019
4
1
3
Egypt
cPanel Access Level
Root Administrator
I don't believe so but I believe there's also a split delivery solution that is able to be utilized with exchange and google apps, where some mail is sent/received locally and some is done so on the exchange server - I believe this would also resolve your issue.

Using cPanel and Office 365 in a hybrid scenario

There are also a number of office 365 threads on this which if configured properly should allow for mail to be sent from the domain on your server (pending it's one that does not use office365) to an account using office365
ef2fa5e8f45d9888782a30dd71dc8ec8c28d25f0d879b0a719db43140a930cad.png
As seen here backup option in router did create infinite loop.
The link you provided had a solution by using redirect to the mail using another domain which is not possible in my case.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,903
2,237
463
Hello @abkarino,

The following post is a good place to start:

Google Apps split delivery for domain

It's intended for Gmail, but the steps outside of Google itself would likely apply to your situation as well. That said, keep in mind this is an unsupported configuration so it's likely going to require assistance/investigation from a qualified system administrator if the user-submitted workaround isn't helpful. We provide a list of companies offering system administration services at:

System Administration Services | cPanel Forums

Thank you.