The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Changes to .contactemail files not updating within WHM

Discussion in 'General Discussion' started by gregc, Aug 10, 2016.

Tags:
  1. gregc

    gregc Member

    Joined:
    May 10, 2009
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  2. gregc

    gregc Member

    Joined:
    May 10, 2009
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    650
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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 contactemail=user@domain
    Thank you.
     
Loading...

Share This Page