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.

Moving multiple email accounts to cpanel

Discussion in 'E-mail Discussions' started by cisnet, Mar 1, 2008.

  1. cisnet

    cisnet Member

    Joined:
    Nov 30, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    I think cpanel could really use a page that let you paste in a username/password list and then let you supply an ip address to let you run fetchmail against. But, since it doesn't.....

    Is there a script to do this some where. I poked around the net for about 1/2 hour. I can't even find any help in adding an email account from the command line. Is there something in /scripts that I could use, just pass it the parameters in a shell script?

    Thanks.
     
  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    For scripting the creation of email addresses, you may wish to call the API function the X3 theme calls to create this account. You can call that function from the XML-API.

    To see the API function in use, view /usr/local/cpanel/base/frontend/x3/mail/doaddpopinclude.html

    For documentation on the XML-API and how to call API1 and API2 functions from the XML-API, please visit:

    http://www.cPanel.net/plugins/devel

    You can use an API2 function to list all accounts:

    http://www.cpanel.net/plugins/api2/Cpanel::Email::listpopswithdisk.pod.html

    However, that function will not return the password of each account.
     
  3. cisnet

    cisnet Member

    Joined:
    Nov 30, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Well, this works.

    while read NAME PASSWORD
    do
    echo "$NAME, $PASSWORD" #probably not needed. In for testing
    /scripts/addpop $NAME $PASSWORD
    done < mailadd.test


    mailadd.test was a file with emailaddress password.

    mailadd.test was a file with the emailadress/password combos. All were successfully created using the bash shell.
    I haven't added a fetchmail line yet, but that shouldn't be too hard.
     
    #3 cisnet, Mar 3, 2008
    Last edited: Mar 5, 2008
Loading...

Share This Page