Cannot receive email on specific domain

sepisepsep

Member
Jan 30, 2019
10
0
1
Philippines
cPanel Access Level
Root Administrator
Before, the email messages of my cPanel's primary domain is hosted on another server. I migrated the email hosting to my cPanel server yesterday to which I can confirm that the DNS records have already finished propagating.

I am able to send email messages but am unable to receive email only on that specific domain. Even system messages are failing. For example, I created a new email account and even the system is unable to send email to that new account with the below error:
Code:
Event:    failure error
User:    root
Domain:    -system-
From Address:    [email protected]
Sender:    root
Sent Time:    Feb 19, 2019, 8:35:08 AM
Sender Host:    localhost.localdomain
Sender IP:    127.0.0.1
Authentication:    identify_local_connection
Spam Score:   
Recipient:    [email protected]
Delivery User:    domain
Delivery Domain:    domain.com
Delivered To:   
Router:    fail_remote_domains
Transport:    fail
Out Time:    Feb 19, 2019, 8:35:08 AM
ID:    1gvtNv-0017pw-Kf
Delivery Host:   
Delivery IP:   
Size:    53.56 KB
Result:    The mail server could not deliver mail to [email protected] The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.
Log from /var/log/exim_mainlog:
Code:
2019-02-19 08:35:43 SMTP connection from [127.0.0.1]:60234 (TCP/IP connection count = 1)
2019-02-19 08:35:43 SMTP connection identification H=localhost A=127.0.0.1 P=60234 U=root ID=0 S=root B=identify_local_connection
2019-02-19 08:35:43 1gvtNv-0017pw-Kf <= [email protected] H=(localhost.localdomain) [127.0.0.1]:60234 P=esmtp S=54846 [email protected] T="[domain.com] Email configuration settings for \342\200\[email protected]\342\200\235." for [email protected]
2019-02-19 08:35:43 SMTP connection from (localhost.localdomain) [127.0.0.1]:60234 lost D=0s
2019-02-19 08:35:43 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1gvtNv-0017pw-Kf
2019-02-19 08:35:43 1gvtNv-0017pw-Kf SMTP connection identification H=localhost A=127.0.0.1 P=60234 M=1gvtNv-0017pw-Kf U=root ID=0 S=root B=authenticated_local_user
2019-02-19 08:35:43 1gvtNv-0017pw-Kf Sender identification U=root D=-system- S=root
2019-02-19 08:35:43 1gvtNv-0017pw-Kf ** [email protected] R=fail_remote_domains: The mail server could not deliver mail to [email protected]  The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.
2019-02-19 08:35:43 cwd=/var/spool/exim 7 args: /usr/sbin/exim -t -oem -oi -f <> -E1gvtNv-0017pw-Kf
2019-02-19 08:35:43 1gvtNv-0017q0-OK <= <> R=1gvtNv-0017pw-Kf U=mailnull P=local S=56228 T="Mail delivery failed: returning message to sender" for [email protected]
2019-02-19 08:35:43 1gvtNv-0017pw-Kf Completed
2019-02-19 08:35:43 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1gvtNv-0017q0-OK
2019-02-19 08:35:43 1gvtNv-0017q0-OK Sender identification U=mailnull D=-system- S=mailnull
2019-02-19 08:35:43 1gvtNv-0017q0-OK ** [email protected] R=fail_remote_domains: The mail server could not deliver mail to [email protected]  The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.
2019-02-19 08:35:43 1gvtNv-0017q0-OK Frozen (delivery error message)
This is the same error for all failed incoming messages. I'm not using CSF or any firewall aside from iptables.

Other domains that are hosted on my cPanel server currently does not have any problems with the email service.

Please help on this. Thank you.
 

quanin

Well-Known Member
Aug 18, 2011
127
7
68
cPanel Access Level
Root Administrator
That definitely sounds like a DNS issue. Can you do two things, right quick?
From the server: ping -c4 domain.com

From your local machine: ping domain.com

Somebody somewhere isn't getting the message that your domain exists. This will rule out the possibility of it being a wider issue than your server.
 

sepisepsep

Member
Jan 30, 2019
10
0
1
Philippines
cPanel Access Level
Root Administrator
That definitely sounds like a DNS issue. Can you do two things, right quick?
From the server: ping -c4 domain.com

From your local machine: ping domain.com

Somebody somewhere isn't getting the message that your domain exists. This will rule out the possibility of it being a wider issue than your server.
yes no issues there. The server itself is hosting the domain.com. Even system email messages are failing.
 

quanin

Well-Known Member
Aug 18, 2011
127
7
68
cPanel Access Level
Root Administrator
Understood. I was attempting to verify if it's only exim that's failing to resolve that particular domain, as that would be a slightly easier issue to fix than if it was a larger issue. Are you saying you can ping that domain from both server and local machine?
 

sepisepsep

Member
Jan 30, 2019
10
0
1
Philippines
cPanel Access Level
Root Administrator
Understood. I was attempting to verify if it's only exim that's failing to resolve that particular domain, as that would be a slightly easier issue to fix than if it was a larger issue. Are you saying you can ping that domain from both server and local machine?
Yes, I can ping it on from both. Not really seeing any connectivity issues.
 

sepisepsep

Member
Jan 30, 2019
10
0
1
Philippines
cPanel Access Level
Root Administrator
It may be then that you need to rebuild /etc/localdomains. As root, do:
/scripts/checkalldomainsmxs –yes
Was already able to fix it. Issue was even after updating DNS records through cPanel account, the domain was still listed on /etc/remotedomains and NOT on the /etc/localdomains . I think this might be a bug as I suppose it should've been automatic once I've pointed the MX record to the server's domain.

I resolved the issue by simply entering the Edit DNS Zone section through WHM and saving the config just to initialize the script to update. And true enough, after saving it, the domain has been transferred to /etc/localdomains.

Markers that helped me to identify issue are below.

Error message on tracking email delivery:
Code:
Router:    fail_remote_domains
Exim log:
Code:
2019-02-19 08:35:43 1gvtNv-0017q0-OK ** [email protected] R=fail_remote_domains: The mail server could not deliver mail to [email protected]  The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.
The fail_remote_domains apparently mentioned that it's seeing the domain to be remote and NOT local.

Thanks for your helpful inputs, quanin.
 

quanin

Well-Known Member
Aug 18, 2011
127
7
68
cPanel Access Level
Root Administrator
Any time. I think editing the DNS zone runs the above script just for that domain anyway, so you essentially just did the same thing.

You may want to open a support ticket and reference this thread, in the event your theory's correct and it's a bug. The devs may be interested in taking a closer look.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello @sepisepsep,

The following case was implemented in cPanel & WHM version 76 to ensure the automatic detection feature works when changes are made to the DNS Zone through cPanel:

Fixed case CPANEL-20346: Email Routing: Make autodetect setting honor MX entries.

Can you verify if your system uses cPanel & WHM version 76 or newer?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Yes, I am using v76.0.20 with CloudLinux 7.6. Kindly note that I made the DNS changes on cPanel and not on WHM.
I've been unable to reproduce this behavior on a test environment (I tested using cPanel >> Zone Editor). It's possible the issue relates to how your system is resolving the domain names entered as part of the MX records. Can you open a support ticket so we can take a closer look at your system to see what's happening? You can post the ticket number here and we'll link this thread to it.

Thank you.