Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    4

    Default Importing Email Accounts

    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. #2
    cPanel Staff cPanelJared's Avatar
    Join Date
    Feb 2010
    Location
    Houston, TX
    Posts
    1,066

    Default

    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.
    For hands-on assistance, please reference our new support information page: Where should I go for support?
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists(Alt) - Documentation


    -- Jared Ryan, Technical Analyst, cPanel Technical Support

Similar Threads & Tags
Similar threads

  1. Any advice in importing multiple email accounts?
    By Jonathan More in forum E-mail Discussions
    Replies: 1
    Last Post: 04-29-2011, 01:09 PM
  2. Importing email accounts in mass?
    By shaniac in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 02-08-2008, 03:20 PM
  3. importing email accounts
    By GoTTi in forum E-mail Discussions
    Replies: 7
    Last Post: 02-14-2005, 09:33 PM
  4. importing email accounts for cobalt xtr
    By esarakaitis in forum E-mail Discussions
    Replies: 0
    Last Post: 08-18-2004, 11:34 AM
  5. Importing email accounts in mass.
    By shaniac in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 08-17-2004, 06:04 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube