The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

How to change email username

Discussion in 'E-mail Discussions' started by democreations, Apr 13, 2010.

  1. democreations

    democreations Member

    May 31, 2008
    Likes Received:
    Trophy Points:
    Ok I searched it and I couldnt find it.. hmm
    How can I change some email account username ??

    (I need to keep current emails in the inbox, I know I can just delete and create another one, but I need to change the username from one to another)
    Is this possible trough cpanel ?
  2. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Feb 25, 2010
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Create new mailbox, then copy the mail

    Since you want to save the existing messages, the easiest way to do this is to create a new account with the desired username using cPanel, copy the mail between the accounts using the shell, and then delete the old account using cPanel.

    Mail on a cPanel server is stored in the following format:



    $HOME = the account's home directory;
    $USER = the account's cPanel username;
    $DOMAIN = the domain assigned to the account, and;
    $MAILBOX = the actual e-mail address defined in the account's cPanel.

    Mail is stored in two directories within this directory, new and cur. new is for mail that has not yet been read, and cur is for mail that has already been read at least once.

    So if you have an e-mail address,, and you want to change its name to, you can create the new address, in cPanel, then, from the shell, copy the mail using these commands:

    # cp -Rp /home/mytestdo/mail/* /home/mytestdo/mail/
    # cp -Rp /home/mytestdo/mail/* /home/mytestdo/mail/
    # /scripts/mailperm
    This assumes that the account for is mytestdo, and that its home directory is /home. Also, while the -p switch to the cp command specifies that permissions and ownerships be preserved, it is a good idea to run mailperm after manipulating mail-related files.

Share This Page