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.

Possible to create new cPanel POP accounts from .csv file?

Discussion in 'General Discussion' started by spaceman, Aug 1, 2005.

  1. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Hi All,

    I've got a potential new hosting customer, He's got about 100 pop accounts he wants to setup. Obviously we/he could going into cPanel and manually create all the accounts one at a time. But we're wondering if it's possible to run a script on a text file (tab or comma delimited) that will speed up the creation of these pop account?

    The text file would simply contain:

    - username (domain would be assumed, or supplied if that makes things easier)
    - password
    - quota

    Any suggestions anyone?

    Thanks.
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Use /scripts/addpop which you can either use as a base for a script or write a wrapper for.
     
  3. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Nice one. Thanks.

    btw - we're getting closer to using your cpanel/whm config etc. services... :)
     
  4. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    update/fyi: I just ran this script from the command line:

    /scripts/addpop

    - I got asked for a pop account, which I supplied.
    - I got asked for a password, which I supplied
    - Got the response 'Created xyz@itomic.com with password 'xyz' for user [user]'

    ... then I logged into cPanel > Mail, but no sign of the new POP account there. Also, did not get asked for a quota - I assumed that, by not asking me for one, it would choose a default quota. But given that I couldn't see any evidence that the account has been created, I can't know the answer to this question.

    My opinion right now is that given how rarely we're asked to setup many POP accounts in one go, it's probably not worth our time investing programming effort to perfect this script - I think we'll just do data entry this time around. If I was being asked to setup 1000 pop accounts, then we'd definitely invest more time in this script.

    Thanks all the same!
     
  5. fwwebs

    fwwebs Well-Known Member

    Joined:
    Feb 16, 2004
    Messages:
    329
    Likes Received:
    0
    Trophy Points:
    16
    The cP Account Creator script at http://scripts.freemans-web.com has the PHP code for account creation contained in the add_email.php script. It should be a relatively quick hack to do what you need. Take a look at it.
     
  6. spaceman

    spaceman Well-Known Member

    Joined:
    Mar 25, 2002
    Messages:
    481
    Likes Received:
    0
    Trophy Points:
    16
    Thanks. Might use it for next time (client has already started manually entering email addresses via cPanel).
     
  7. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    /usr/local/cpanel/cpanel-email
    <ctrl+d>

    that should give you help on how to use it.
     
  8. brianoz

    brianoz Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,146
    Likes Received:
    6
    Trophy Points:
    38
    Location:
    Melbourne, Australia
    cPanel Access Level:
    Root Administrator
    What's the best way to create forwarders? I notice cpanel-email doesn't provide a hook for that.

    Just asking to see if there's an approved way of doing this. It's probably not hard to add them in at the start of /etc/valiases/domainname.
     
Loading...

Share This Page