The mail server could not deliver mail to root
Looking at the WHM Mail Delivery Reports, I was met with the following error:
The mail server could not deliver mail to root@server.hostname.com. The account or domain may not exist, they may be blacklisted, or missing the proper dns entries.
I researched the issue and despite having an email address setup in Server Contacts -> Edit System Mail Preferences which is the typical suggestion, I was still receiving the error. I finally ran across a blog that pointed to a fix for this situation that did indeed work. I'm posting this to hopefully get some SEO going to help others.
1) First thing to check are the settings in:
Server Contacts -> Edit System Mail Preferences
Make sure the setting: The system currently forwards mail for "root" is set to a valid email address.
The other two sections, Forward mail for "cpanel" to: and Forward mail for "nobody" to: can either be set to "root" or a valid email address. If you're the only person maintaining the server, it would make the most sense to just point it to root. (It's perfectly fine to enter an email address too if you want)
2) Second thing to check if you're getting the "The mail server could not deliver mail to root" error, is to look in:
/etc/localdomains
Look specifically for your servers host name. If it doesn't exist, add it.
In my case, my hosting company was bought out by another company and the cPanel instance was transferred to the new companies servers. When I checked /etc/localdomains, the very first host name was the OLD hostname for the old hosting provider. Once I removed the old line and updated this with the new host name, the emails sent to root@server.hostname.com began working properly.
---
While researching this issue, others who had a similar error had issues with their DNS and MX entries. If this post doesn't help, chances are it could be related to your DNS, rDNS, MX records or all of the above.
-
Hi @philsward, Thank you for taking the time to create this post to help those facing the same issue. We generally see this issue when the hostname is manually changed on the server from the command line with the "hostname" command. An entry for the hostname is automatically added to the /etc/localdomains file during the initial setup phase of the cPanel installation, and any time the hostname is changed through the "WHM >> Change Hostname" feature. Thanks! 0 -
thanks you! I was having this problem and it was resolved 0 -
Amazing! My old server hard drive started to fail and had to transfer to a new server. Some of the data didn't transfer because of the i/o failure on the old hard drive. Email wasn't working for some of my domains and it was driving me crazy, this hit the nail on the head.. Thanks Bud! @philsward You're a hero! 0
Please sign in to leave a comment.
Comments
3 comments