Changes to .contactemail files not updating within WHM

gregc

Member
May 10, 2009
8
0
51
I'm trying to update all of the contact email addresses associated with the domains on my server, so I just went through and manually updated all of the /home/USER/.contactemail files with the correct addresses, however when I go to List Accounts within WHM it still shows a lot of the old addresses.

I've tried rebooting various services as well as the entire server, in hopes that this was a caching issue and a reboot would fix it, but it didn't.

Does anyone know how to fix this?
 

gregc

Member
May 10, 2009
8
0
51
For anyone with the same issue, here's the solution...

Contrary to a lot of information out there you don't actually update the /home/USER/.contactemail files directly, instead you update the files in /var/cpanel/users. Each file has a line like [email protected], which is what you need to edit.

Within the /var/cpanel/users folder I ran the below search and replace in order to update all files.

sed -i -- 's/[email protected]/[email protected]/g' *

After updating the individual files in /var/cpanel/users you then need to run /usr/local/cpanel/scripts/updateuserdomains, which will update all of the .contactemail files with the email addresses in the /var/cpanel/users files.
 

cPanelMichael

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

I'm happy to see you were able to address the issue. You can also update the contact address for the cPanel account using WHM API 1 with a command such as:

Code:
whmapi1 modifyacct user=username [email protected]
Thank you.