WHM email notifications sent to [email protected]

rfc001

Member
Jan 13, 2018
17
0
76
Indiana
cPanel Access Level
Root Administrator
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!
This is exactly what is causing this issue for me. I changed the hostname through WHM >> Change Hostname. That explanation doesn't explain why WHM is ignoring the following settings:

  1. Home »Server Configuration »Basic WebHost Manager® Setup »Contact Information:
    • Enter one or more email addresses to contact in case a problem arises with this server.
    • Enter one or more cellular phone or pager email addresses to message via email in case a problem arises with this server.
  2. Home »Server Contacts »Contact Manager
    • Email
    • Short Message Service (SMS)
Both of these are populated with valid emails/SMS yet the only WHM alert notifications are being sent to [email protected]

Secondly, even in the event email is sent to root it should be forwarded per the following WHM settings:
Home »Server Contacts »Edit System Mail Preferences:
- Forward mail for “cpanel” to:
- Forward mail for “nobody” to:
- Forward mail for “root” to:

All of which are set to valid email, yet none of which actually forward email for the renamed host. There is a flaw in the slaw with rename host. It should update everything automatically. In the meantime, please provide the manual workaround.
 

rfc001

Member
Jan 13, 2018
17
0
76
Indiana
cPanel Access Level
Root Administrator
Solution is here:
SOLVED - The mail server could not deliver mail to root

Needed to add hostname to /etc/localdomains

Why doesn't cPanel do this automatically when you rename host? Seems like it should. Also you have to repair mailbox permissions (Home »Email »Repair Mailbox Permissions) and re-add any forwarders on all cPanel accounts after renaming host. Seems like renaming host functionality needs some work cPanel. Thanks.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,254
313
Houston
Hi @rfc001

It should automatically do this for you when you change the hostname through the proper channel. The proper way to change the hostname is by going to WHM>>Networking Setup>>Change Hostname in the UI or
Code:
/usr/local/cpanel/bin/set_hostname <hostname>

When run as root, this program changes this servers hostname, updating it in all of the relevant locations on your system.

Options:
    --help: this help
Thanks!