Changes to .contactemail files not updating within WHM
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?
-
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 CONTACTEMAIL=email@example.com, 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/CONTACTEMAIL=oldaddress@example.com/CONTACTEMAIL=newaddress@example.com/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. 0 -
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: whmapi1 modifyacct user=username contactemail=user@domain
Thank you.0
Please sign in to leave a comment.
Comments
2 comments