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.

Migrating email with different account name format

Discussion in 'E-mail Discussions' started by troy.gerrie, Feb 11, 2013.

  1. troy.gerrie

    troy.gerrie Member

    Joined:
    Jan 23, 2013
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello,

    We are currently in the final stage of preparing our own in-house hosting service to move ~200 websites and ~400 mailboxes currently hosted with another provider in a custom made hosting services into our cPanel installation.
    We plan on migrating the mail with minimal interruption to the end users, we don't want have to reconfigure 400 mail clients remotely, this would be an enormous task.

    The mail itself and passwords I am able to migrate just fine, the issue resides in the fact their current login usernames are setup as <username>_xx e.g. customer_01. Whereas cPanel uses different usernames to accomplish the same task. Does anyone have a solution for this?
     
  2. ruzbehraja

    ruzbehraja Well-Known Member

    Joined:
    May 19, 2011
    Messages:
    383
    Likes Received:
    7
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    What other service is being used currently on the old server?

    What format are the mails stored in?
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,482
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    How's that?

    cPanel doesn't use different usernames, if I understand you correctly. customer_01 could be used, his login username is customer_01@yourdomain.com. He must use the full email address for his login.
     
  4. troy.gerrie

    troy.gerrie Member

    Joined:
    Jan 23, 2013
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Its currently using Courier and Maildir.

    Sorry if I wasn't clear on that. The customers clients are already setup to login with usernames like "customer_01" which just isn't going to work with cPanel and I don't want to have to reconfigure all their clients.

    I modified Dovecot's configuration file to also reference the old shadowfile entries for passdb and the old passwd entries for userdb. I used a symlink to point to an existing mailbox. The client appears to login but gives the error: "-ERR [IN USE] Internal login failure. Refer to server log for more information"

    I don't need a solution that allows cPanel to set these mailbox names, I need a HACK in place that will let legacy users log in with their old credentials and still access their mail, I think I am getting closer.
     
  5. troy.gerrie

    troy.gerrie Member

    Joined:
    Jan 23, 2013
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Thank you, I have resolved this.

    I had to insert these into dovecot.conf
    Code:
        passdb passwd-file {
            args = /etc/legacy.passwd
        }
    
        userdb passwd-file {
            args = /etc/legacy.passwd
        }
    The /etc/legacy.passwd file looks like so:
    Code:
    spunerace01:$1$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:510:510::::userdb_mail=maildir:/home/spunerac/mail/spunerace.com/administrator/
    Note that the user above has the same uid/gid as the user I have setup in cPanel for permissions reasons, the hash has been taken directly from the legacy shadowfile.

    This allows me to script an import to scrape the shadow file and generate a passwd file which will direct inboxes to the appropriate mail folder as setup in cPanel.
     
    #5 troy.gerrie, Feb 11, 2013
    Last edited: Feb 11, 2013
Loading...

Share This Page