Mobile app version of vmapp.org
Login or Join
Jamie184

: Changing cPanel Mail Directories I want to change the e-mail address format used by the company I work for. Currently the format is firstname@domain.com and I would like to change that to firstname.lastname@domain.com.

@Jamie184

Posted in: #Cpanel #Email

I want to change the e-mail address format used by the company I work for.

Currently the format is firstname@domain.com 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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Jamie184

1 Comments

Sorted by latest first Latest Oldest Best

 

@Pope3001725

The recommended and best method is to backup your email folders, re-create the new email account and copy over the content folders from the other email account. Some folders such as the 'sent' folder appears as a "hidden" folder prefixed with a dot.

For example, here are the standard folders for a simple email (Courier Format) account:


cur/
.Drafts/
.Junk/
maildirsize
new/
.Sent/
tmp/
.Trash/


You should move each folder separately, after backing up all the data. Creating a backup of your email data is key because while simply renaming the email account could work, if it is an active account, you should expect problems due to the inherit file structure. Webmail will most certainly misbehave.

It is better to backup, recreate and move the folders individually.

Simply renaming the addresses opens up possible unknown conflicts with future software updates and/or permissions, especially on a shared hosting server.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme