Email Routing simple explained

markus909

Active Member
Feb 18, 2023
34
8
8
Austria
cPanel Access Level
Reseller Owner
I thought I understood it already months ago, and now I am again confronted with the topic of Email Routing in cPanel and forgot even the basics about it, e.g. what is it actually for - outgoing emails from the server vs incoming emails? Why is it even anyway relevant when the MX record is external and has nothing to do with cPanel. Somehow I am not able to understand that topic.


Can someone explain this in layman's terms when I use Local Mail Exchanger vs. Remote Mail Exchanger

My situation:
  • Reseller Account only for my clients as a web designer
  • My cPanel Hosting Provider also has Mailchannels included (but that should be only for outgoing email filtering)
  • Domain and DNS → always external, so the zone file can be completely ignored at cPanel. However, I probably must add the provided DNS records (SPF, DKIM, DMARC) to the external DNS records
  • Mailboxes and MX → almost always external (I only have one or two exceptions where I use cPanel Email)
  • WordPress Website sends emails
    • a) either directly from the server via phpmail from WordPress or
    • b) from an SMTP Mailbox I get from the client e.g. [email protected] via Office 365 or
    • c) via Postmark or some other Email Service Provider

Has cPanel Email Routing anything to do with actual mailboxes of my clients or is it only about how WordPress (the server) can send emails?

Why would it work when I send an email form within WordPress to [email protected] but it won't work when I send it to [email protected] (clientdomain.com is registered externally, DNS is managed externally, but cPanel account exists for hosting)

Can I say as a rule of thumb, I always need to set it to Remote, unless I use Mailboxes for the client that comes included via cPanel (instead of O365, Google, etc.)?


I am trying to further research and understand this, but perhaps someone can put it in more simple terms to finally see through this

Thanks in advance
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,183
2,413
363
cPanel Access Level
Root Administrator
Hey there! The Email Routing option for the domain determines how email sent from the server is handled. It doesn't affect DNS, or external email, or incoming email from outside the server.

By default, cPanel and Exim will try to deliver email to a local account if it detects the domain exists on the server, so this gives you a way to stop that from happening if necessary.

Let me know if that helps!
 
  • Like
Reactions: markus909

markus909

Active Member
Feb 18, 2023
34
8
8
Austria
cPanel Access Level
Reseller Owner
Hey there! The Email Routing option for the domain determines how email sent from the server is handled. It doesn't affect DNS, or external email, or incoming email from outside the server.

By default, cPanel and Exim will try to deliver email to a local account if it detects the domain exists on the server, so this gives you a way to stop that from happening if necessary.

Let me know if that helps!
So on the one hand it is about "how email sent from the server is handled" (outgoing) on the other hand it's about "deliver email to a local account" (incoming). I just don't know how to untie that in my mind. I tried so many times, but it's always confusing again. So maybe instead of understanding, I should just try to find a rule to memorize, e.g. always set it to Remote, unless personal mailboxes are managed within the same cPanel account instead of O365 or Google. Could that be valid?


If it is about sending emails from the server, why would it work when I send a test email from within WordPress to my private gmail account, but won't send to the email from the domain. Domain and DNS is not managed within cPanel.

What if I use Postmark, Sendgrid, etc to send the emails from WordPress. Has this some impact whatsoever in that case?
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
15,183
2,413
363
cPanel Access Level
Root Administrator
When I say "deliver email to a local account" I mean one of the following:

-domain.com is sending from [email protected] to [email protected]
or
domain.com is sending to otherdomain.com, both hosted on the same server.

I would need to know what error message you get from the WordPress test message in order to answer that one.

If you used a remote tool or smarthost, then no, this wouldn't matter.
 

markus909

Active Member
Feb 18, 2023
34
8
8
Austria
cPanel Access Level
Reseller Owner
From the WordPress Email log e.g. Fluent SMTP, it looks like the email is sent just fine.
Within cPanel though I get the following message. When I change from Local to Remote, it'll work. I just never understood it why and try hard to memorize/understand.
No Such User Here

That could mean it's like this:
WordPress sends via separate external SMTP mailbox or Email Service Provider (Postmark, Elastic Mail, Sendinblue, Sendgrid) then this setting does not matter at all.

WordPress sends via phpmail from it's own server. If it sends to some external email e.g. [email protected] this setting does not matter at all.

WordPress sends via phpmail from it's own server. If it sends to it's own domain (e.g. contact form notification) then it must be set to Local when the mailbox is managed within cPanel or to Remote when the mailbox is managed externally. As my clients usually have their own email and don't require cPanel email (most at least) that means I can always set it to Remote.

Of course the notification emails can be sent to external addresses (e.g. order confirmation at a shop goes to the buyer) and internal addresses (e.g. new order to shop owner). It must work for both.

There could be the rare occassion when the domain [email protected] is on the very same server without me knowing it. Not every reseller account get's it's own managed server. That means, those emails won't be delivered if I set the setting to Remote.

I feel it depends on the target address whether I need to set it to Local or to Remote ... sorry, I am again in the loop
 

markus909

Active Member
Feb 18, 2023
34
8
8
Austria
cPanel Access Level
Reseller Owner
I am trying again with a fresh mind to see through and break it down.

Do you think the following statement is correct:
When MX Record point to the own domain, then set it to Local. When MX Record points somewhere external, set it to Remote.
 

markus909

Active Member
Feb 18, 2023
34
8
8
Austria
cPanel Access Level
Reseller Owner
I am not sure if it makes much sense to upload the file I created for testing. It's not finished yet, however, it helped me analyzing and testing everything around that setting that I obviously struggle much to understand "Email routing in cPanel".

Unfortunately, it won't fit at all anymore to the thread title "Email Routing simple explained"
Perhaps I'll be able to simplify it later, should I ever get some feedback on it and post it as it's separate post. Could help others, could confuse others.


I tested a lot. I tried to understand a lot. Not everything got clear. The simply rule applies in the end from what I have seen.

MX Record external → set it to REMOTE
MX Record to own server where cPanel runs → set it to LOCAL

However, there are quite a lot of different scenarios, I tried to picture as follows



cPanel Email Routing Analyzed and Tested-opt.jpg