大网数据广告活动
网站运营与故障问答

Changing cPanel Mail Directories

· 52CE 我爱测

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 …

问题原文

原帖链接 · 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2015-01-26)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0 / CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。