Is there a way to import new email accounts into cPanel, in mass? I have about 2000 email accounts, and entering them by hand is not an option. Thanks in advance.
-Shane
Is there a way to import new email accounts into cPanel, in mass? I have about 2000 email accounts, and entering them by hand is not an option. Thanks in advance.
-Shane
I'm looking for the exact same feature. We are currently in the process of designing and maintaining a school website. They have about 500 students, and each student is required to have an email address. We also need to be able to mass delete at the end of each school year. We have been looking at Hive Mail but are unsure of the database structure. Anyways any help would be greatly appreciated. Sorry for hijacking your thread.
Chris
If you're using cpanel/exim to manage the accounts, a php script along the line of this should do the trick... to delete the accounts, you would replace doaddpop with dodelpop
fopen wrappers would have to be enabled because of the file() calling a url.
This has not been tested. PM me if you need me to implement this for your server.
PHP Code:<?
$cpanel_username = "accountname";
$cpanel_password = "mypass123";
$cpanel_theme = "x";
$cpanel_url = "http://$cpanel_username:$cpanel_password@$cpanel_domain/frontend/$cpanel_theme/mail/doaddpop.html";
$email_domain = "thisschool.com"
$email_quota = 10; // quota in MB
// associative array: keys are email addresses, values are passwords
$emails = array("john.smith"=>"1234", "jane.smith" => "abcd");
foreach($emails as $email_address => $email_pass){
$url = "$cpanel_url?email=$email_address&domain=$email_domain&password=$email_pass"a=$email_quota";
if(file($url))
echo "$url <br>\n";
else
echo "ERROR : $url <br>\n";
}
?>
supposedly /usr/local/cpanel/cpanel-email can interface to creating or deleting email addresses .... I have yet to find a help file or anything associated. I want to script the creation of email accounts and forwards as well as removal.
Does anyone know anything about /usr/local/cpanel/cpanel-email ?
I know this is an old post, but does anyone know if it works? I need to setup a few hundred email addresses, which I have in an excel spreadsheet with the passwords. Any help would be appreciated. Thank you
- cPanel :: Fantastico :: RVSkin :: WHM :: ModernBill
- Reseller Hosting :: SSL Certificates :: Domain Registrations :: Affiliate Program
- Blog Hosting :: CMS Hosting :: Forum Hosting :: E-Commerce Hosting
SoftDux- The Leaders in Software
Use the coupon: cpanel-06 to get 20% off our packages
/scripts/addpop <email> <pass>
I think that still works, i have not tested it so give it a try first... if it works it should be very easy for you to take a CSV file and loop it into that script.
Shaun Reitan
NDCHost.com - cPlicensing.net - ProVPS.com
Contact us for your cPanel Licensing needs! We Price Match, We provide Support, We take care of our customers!
Well how do you call this in PHP? I tried sudo and so many options, it gives unknown error in php, and then I tried also writing perl script but looks like cpanel's custom tag does not let Text::CSV load.
Php API is not very useful because it requires "x" theme also everything has been upgraded up to x3 and we cant use old theme and moreover even basic authentication is not supported so php xml api is not working.
/scripts/addpop is right way but only if someone can show in php how to exactly use it.
system("/scripts/addpop arg1 arg2 arg3");
php will need to be running as the user root.
Shaun Reitan
NDCHost.com - cPlicensing.net - ProVPS.com
Contact us for your cPanel Licensing needs! We Price Match, We provide Support, We take care of our customers!