I want to change the e-mail address format used by the company I work for.
Currently the format is firstname@domain.co
m and I would like to change that to firstname.lastname@domain.com
.
I have read on the cPanel forums that the recommended method for doing this is to create a new e-mail account and then use the cp
command with flags -Rp
to copy the contents of the mail account's /cur/
and /new/
directories into the equivalent /cur/
and /new/
folders in the new mail account's directory.
This works for the inbox folders, but does not copy the contents of other folders. This includes a 'sent' folder, which every account has, but also folders set up individually by each user (I for example have an 'Internal' and an 'External' folder for mail that is from within and without the company respectively).
As the number of custom folders in each mail account ranges from zero to unlimited, I am concerned that checking through each e-mail account's directory and manually creating those folders before copying the directory will be both tedious and complicated, increasing the likelihood of errors.
What is the best way to approach this problem?
I have thought to try simply renaming the old mail account's directory to that of the new account, before creating that account in cPanel.
To demonstrate, I have renamed the directory /home/$account/mail/$domain.com/firstname
to /home/$account/mail/$domain.com/firstname.lastname
before creating the e-mail account firstname.lastname@doamin.com
in cPanel.
It appears to work, but I am concerned that this is an unorthodox and 'hacky' way of achieving my desired result, and so am reluctant to try this on a real, working mail account.