Jul 14, 2021
8
2
3
Danmark
cPanel Access Level
DataCenter Provider
When a domain i transferred to cpanel, typically first step is that a new user and the domain is configured in cpanel. Then a welcome message with account information is sent by email to the new user. If the user has registered a contact email address belonging to the domain that is about to be transferred, then the email does not reach the user as it is delivered to the new local cpanel account.
The problem originates from the fact that cpanel immediately marks new domains as local, even before the public MX records are changed. Is there any way to overcome this problem, e.g. by forcing exim to deliver emails based on current public MX records?
 

sparek-3

Well-Known Member
Aug 10, 2002
2,154
269
388
cPanel Access Level
Root Administrator
Best solution ... always send your email out from another server not the same server that you are hosting clients on.

The localdomains list is used so that Exim knows exactly what domain names are "local" to itself. If you take a domain out of this list and then the domain's mail starts to be handled by your server, and you don't add the domain back to the localdomains list - then you're going to run into the same problem. When a message is sent to the domain, the MX records will point to your server, but your server won't know what to do with it because the domain won't be interpreted as a localdomain.

If the MX records for a domain are pointing to an external or "remote" server, then you can remove the domain from /etc/localdomains and add it to /etc/remotedomains - but again, you'll have to remove it from /etc/remotedomains and add it back to /etc/localdomains when the domain starts to resolve to your server - and how long will that take? ... that's the question that nobody will be able to answer, because people change their nameservers at various different rates.

So there's not a way for cPanel to fix this. You could potentially write something on your own to do this, but if the customer changes their nameservers before you add the domain back to /etc/localdomains, then that customers mail will not work properly.
 
  • Like
Reactions: cPRex
Jul 14, 2021
8
2
3
Danmark
cPanel Access Level
DataCenter Provider
Thank you for the answer. It could be a solution to use an external SMTP-server, but my concern would be that it would introduce another problem:
When a new domain is registered on cpanel, typically the registration lasts from hours to days until the registration is settled. Meanwhile, welcome message with account information is sent by email to the new user. If the user has registered a contact email address belonging to the new domain that is about to be registered, then the email does not reach the user as it is delivered by an external SMTP not knowing the new domain.