In Progress [CPANEL-26018] MX routing for domains without MX records will not accept email

bellwood

Well-Known Member
PartnerNOC
Sep 25, 2012
120
55
153
New York
cPanel Access Level
DataCenter Provider
By default MX Routing on accounts chooses "Automatic" and goes based off the MX record of the domain.

If said domain has no MX record RFC 5321 Section 5.1 states:

...
If an empty list of MXs is returned,
the address is treated as if it was associated with an implicit MX
RR, with a preference of 0, pointing to that host.
...


In this case, none of the four options in MX routing are toggled and mail simply fails to be accepted:

550-The mail server could not deliver mail to [email protected]. The
550-account or domain may not exist, they may be blacklisted, or missing the
550-proper dns entries.

MX Routing should fall back to making its' routing decision based on A/AAAA if no MX RR are available.

This is on cPanel version 78.0.18

P.S I know theres some opinions on whether or not "fallback" to non MX should be in place "today" but we should adhere to RFC's as much as possible.

EDIT: Workaround is to manually set the MX routing, at which point mail will work properly either locally or externally.
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello @bellwood,

I believe we may already have an internal case open to address this issue, but I want to be sure the reproduction steps are the same. Can you confirm if the DNS for the affected domain is handled locally on the cPanel server, or if the domain is assigned remote name servers at the registrar?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Remote nameservers / non-local DNS
Hello @bellwood,

Also, just to clarify, does the local DNS zone (e.g. /var/named/$domain.tld.db) for this domain exist on the cPanel & WHM server with the default MX records? For instance, even though the DNS is handled remotely, did you happen to remove the local DNS zone from the cPanel server?

Thank you.
 

bellwood

Well-Known Member
PartnerNOC
Sep 25, 2012
120
55
153
New York
cPanel Access Level
DataCenter Provider
The zone exists locally and there is no MX record.

Zones are replicated out to an authoritative cluster.

In this case either the EU removed the MX post-migration or it didn't exist pre-migration.

The only time this domain ever receives email is to validate SSL requests for the domain.

Perhaps the routine check that updates the MX routing didn't know what todo when it encountered this, exited with a non-zero and as a result no option was chosen?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello @bellwood,

Thanks for providing the additional information. I can confirm the issue occurs when the local zone on the cPanel server is missing the MX records. Internal case CPANEL-22390 is open to report the issue where the available email routing options in the cPanel UI are not presented properly in this scenario. An additional case, CPANEL-26018, is open to report the issue where emails are not properly routed (e.g. the domain is not moved to the /etc/remotedomains file) in this scenario.

I'll monitor each case and update this thread with more information as it becomes available.

Thank you.
 

Hedloff

Well-Known Member
Jun 7, 2004
189
13
168
Up north!
cPanel Access Level
DataCenter Provider
Why is there not any subdomain DNS zone templates in WHM?

I have some issues with "Email Routing" for subdomains. It's not possible to set routing as long as there are none MX records for the subdomain. I guess it's just a bug that will be fixed in newer versions, but still should be possible to set.
Using version v78.0.20 of cPanel now.

I tried creating a new subdomain, but there are no MX records created.
Here is my root_standardvirtualftp aswell:


Code:
; cPanel %cpversion%
; Zone file for %domain%
$TTL %ttl%
@      %nsttl%  IN      SOA     %nameserver%. %rpemail%. (
                %serial%        ; serial, todays date+todays
                3600            ; refresh, seconds
                7200            ; retry, seconds
                1209600         ; expire, seconds
                86400 )         ; minimum, seconds

%domain%. %nsttl% IN NS %nameserver%.
%domain%. %nsttl% IN NS %nameserver2%.
%domain%. %nsttl% IN NS %nameserver3%.
%domain%. %nsttl% IN NS %nameserver4%.

%nameserverentry%. IN A %nameservera%
%nameserverentry2%. IN A %nameservera2%
%nameserverentry3%. IN A %nameservera3%
%nameserverentry4%. IN A %nameservera4%

%domain%. IN A %ip%
%domain%. IN AAAA %ipv6%

%domain%. IN MX 0 mail.%domain%.

mail IN A %ip%
www IN CNAME %domain%.
ftp IN A %ip%
cpanel IN A %ip%
webmail IN A %ip%
autoconfig IN A %ip%
autodiscover IN A %ip%