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

spaceman

Well-Known Member
Mar 25, 2002
518
12
318
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.
 

spaceman

Well-Known Member
Mar 25, 2002
518
12
318
chirpy said:
Use /scripts/addpop which you can either use as a base for a script or write a wrapper for.
Nice one. Thanks.

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

spaceman

Well-Known Member
Mar 25, 2002
518
12
318
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 [email protected] 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!
 

spaceman

Well-Known Member
Mar 25, 2002
518
12
318
fwwebs said:
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.
Thanks. Might use it for next time (client has already started manually entering email addresses via cPanel).
 

brianoz

Well-Known Member
Mar 13, 2004
1,146
7
168
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.