问题原文
原帖链接 · 568ml · CC BY-SA 4.0
I want to change the e-mail address format used by the company I work for.
Currently the format is [email omitted] and I would like to change that to [email omitted].
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 [email omitted] 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.
已采纳解答
原帖链接 · Alex R · CC BY-SA 3.0
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.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
