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.

Importing Email Accounts

Discussion in 'E-mail Discussions' started by b1ackjosh, Sep 28, 2010.

  1. b1ackjosh

    b1ackjosh Registered

    Joined:
    Sep 23, 2010
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    I would like to find a way to create email accounts via SSH.
    More specifically, I get clients who want to import email accounts an their messages from one cPanel server to another. Usually this isn't possible without using a CPmove file and the restorepkg script. Is there a way to do that only using ssh?
     
  2. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    cPanel e-mail accounts have their username, password and quota information stored in files in the following directory format:

    /$HOME/$USER/etc/$DOMAIN

    where:


    • $HOME = the home directory;
    • $USER = the cPanel account user, and;
    • $DOMAIN = the domain for the e-mail account.

    Within that directory, passwd, shadow and quota are the files that need to be copied over. All three files are in plain ASCII text format, so you can copy and paste entries from them if needed. There will also be a ",v" file for each file. This is an RCS revision log, and it does not necessarily need to be copied.

    The mail data themselves are stored in the following directory structure:

    /$HOME/$USER/etc/$DOMAIN/$EMAILUSER

    where:


    • $HOME = the home directory;
    • $USER = the cPanel account user;
    • $DOMAIN = the domain for the e-mail account, and;
    • $EMAILUSER = the username portion of the e-mail address.

    $EMAILUSER is a directory, and it contains all of the mail for that particular mailbox within its subdirectories. Messages that have not been read yet are in the new subdirectory, and messages that have been read are in the cur subdirectory. There are additional subdirectories for IMAP folders that have been created. Each mail message is stored in a single text file.

    If you copy e-mail accounts manually to another server, you will want to move /$HOME/$USER/.cpanel/email_accounts.yaml and /$HOME/$USER/.cpanel/email_accounts.cache so that they will be regenerated the next time you log into cPanel as the account user. Moving the files will force cPanel to re-read the passwd and shadow file for the account and correctly populate the email_accounts.yaml file.
     
Loading...

Share This Page