Weird E-mail Issue where internal mail using domainname will not send mail externally to domain with same domainanme

slimpixel

Registered
Dec 28, 2019
1
0
1
Ohio
cPanel Access Level
Root Administrator
Our hosting server send's all mail using the dns name cpanel.example.com

All e-mails sent to anyone @example.com are handled thru gsuites however all other mail is recieved and sent from the cpanel server itself aka cpanel.example.com

The problem is if anyone sends an email from cpanel.example.com to any address @example.com the server routes it internally thinking that the mailboxes are locally on the server.

For the life of me I cannot figure out what is going on.

Please help.... Thank You
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
9,904
1,545
313
cPanel Access Level
Root Administrator
Hey there! If your email should all be external for the domain you'll just need to tell cPanel this. You can do that from the cPanel >> Email Routing interface. Just choose the domain from the dropdown list and make sure it is set to the "Remote Mail Exchanger" option. Can you try that and let us know if that improves the behavior?
 

swbrains

Well-Known Member
Sep 13, 2006
262
37
178
Hey there! If your email should all be external for the domain you'll just need to tell cPanel this. You can do that from the cPanel >> Email Routing interface. Just choose the domain from the dropdown list and make sure it is set to the "Remote Mail Exchanger" option. Can you try that and let us know if that improves the behavior?
I have a similar situation where a customer has the hosted domain's nameservers pointing to the registrar (not our server) and they will set up their own MX records there to use external mail servers for their domain. But what should my server's local DNS copy of the MX records look like in this situation? Do they need to point to the external mail server(s) or is cPanel going to figure that out by looking up the nameservers at the registrar and using the MX records there to determine where to send email for this domain?
 

swbrains

Well-Known Member
Sep 13, 2006
262
37
178
Hi,

I want to get some additional clarification on this topic for a couple of different cases where in all cases, mail for the domain should be handled by an external mail server.

When you said earlier, "If the local machine doesn't control the DNS, the local records don't matter at all", does "control the dns" mean "the domain's local NS records point to our own server's nameservers? if so, does that mean that if the local NS records for the domain point externally (not our nameservers) that ALL other local DNS records for the domain (A, MX, TXT, etc.) are ignored by all servers, including our own server, even when sending mail from our own server to an address @ the domain?

I'm trying to clarify how mail sent to a domain parked on our server will react in a couple of different cases:

1) The local copy of the DNS's nameservers point to OUR server (our nameservers) and the local MX records for the domain point to an external mail server.
2) The local copy of the DNS's nameservers point to EXTERNAL nameservers (not ours), the local MX records for the domain point to an external mail server.

In each of these cases, which server will end up processing mail sent to an address @ the domain for messages sent from a server like gmail or yahoo vs. messages sent from our own server.

Finally, what should the "Email Routing" setting for the domain (auto, local, remote) be using in each of these cases?

Sorry for my confusion, and thanks for any clarification you can provide. :)
 

cPanelAnthony

Administrator
Staff member
Oct 18, 2021
1,046
111
118
Houston, TX
cPanel Access Level
Root Administrator
@swbrains Hello! "control the DNS" would refer to your domain using nameservers with IP addresses that resolve to the local cPanel server.

If you have a domain using nameservers that resolve to an external host, none of the DNS records on the cPanel server will be used for this domain. Those DNS records will also be ignored for local mail sending. The server will rely on "local" domains being set to the "local" mail exchanger so it can deliver them properly.

For email routing, there's a good rule of thumb.

  1. If email for a domain is supposed to route through the local cPanel server set it to local.
  2. If email for a domain is supposed to route through an external mail server (Office 365, GSuite, etc) set it to remote.