How To Mass Create Email Addresses In cPanel
Creating a lot of email address in cPanel can be a real pain the neck considering that there is no way to create multiple email addresses at once. However, this task can be accomplished with iMacros, a macro plugin for Firefox, and a bit of php.
If you don’t have iMacros installed, get it here. Once you get that installed, here are the steps.
Create your iMacros Script
Here is where you need some php skills. You’ll need a list of your email addresses (username only), and passwords. These should be in a comma separated list like this:
jamese,sup3rs3cr3t
maxp,sh0p3rs7ar
jeremys,madsk1llz
Read on to get the php script…

Comment by Tim
on 06 Mar 2008 at 2:59 am #
Nice post!
I think you can do all this without even using PHP. iMacros can read from CSV files directly. So in your macro just use
CMDLINE !DATASOURCE Address.csv
‘Number of columns in the CSV file. This must be accurate!
SET !DATASOURCE_COLUMNS 1
‘Start at line 2 to skip the header in the file
SET !LOOP 2
And then use {{!COL1}} for your emails:
TAG POS=1 TYPE=… CONTENT={{!COL1}}
I got this idea from http://wiki.imacros.net/Demo-Loop-Csv-2-Web
Comment by David Grega
on 06 Mar 2008 at 11:52 am #
You can avoid the possibility of the code being obsoleted by a new GUI by accessing the APIs directly. You can use our XML-API to call the appropriate API1/API2 functions that handle the actual creation of mail accounts. If you have root access, all you have to do is analyze the code of the X3 theme to see what APIs it calls and use those calls yourself.
The X3 theme is located at /usr/local/cpanel/base/frontend/x3
The paths for individual screens is fairly simple as it is merely a series of special web pages. For example, frontend/x3/mail/pops.html would be located at /usr/local/cpanel/base/frontend/x3/mail/pops.html - though all that particular page does is pass parameters to another page to be processed. The code is fairly simple and easy to sort though.
We are currently working on comprehensive API documentation so you wont need to look at the X3 source code to determine which API calls you need to use. However, you can find our current documentation on our website at:
http://www.cPanel.net/plugins/devel
Comment by James Ehly
on 06 Mar 2008 at 3:36 pm #
Awesome comments Guys! Thanks for your response and for the ideas!