Need to bulk change email adresses on WHM


Jan 29, 2013
cPanel Access Level
Reseller Owner
I have the same problem as this guy :

1) That thread is almost 2 years old. Has WHM evolved to let us bulk edit accounts properly yet?

If not, a person on that thread posted some commands to edit the files automaticly :
Cpanel stores contact email address for each account name in /home/<username>/.contactemail

Just edit the file, and change the email address there. If you wish to change the contact email address for all your accounts, you can try executing: :cool:

[email protected][~]$ for i in `cut -f2 -d' ' /etc/trueuserdomains|sort`
> do
> echo '[email protected]' > /home/${i}/.contactemail 2> /dev/null
> chown ${i}.${i} /home/${i}/.contactemail
> done
Is that safe to run? I have no knowledge in that language.

Also i'd appreciate it if someone explained a bit more about what the parameters do. Since i don't know the specifics i can't know which parameters i need to customize.