i just wanted to add this piece here: to make an actual plugin for the Roundcubemail you only need this code below. it is the mail.php without the password protect file..
<?php
$antispam = false;
// cPanel info
$cpuser = 'maincontrol panel username'; // cPanel username
$cppass = 'control panel password here'; // cPanel password
$cpdomain = 'main hosting domain ex: domain.com'; // cPanel domain or IP
$cpskin = 'x3';
$epass = 'hispassword'; // email password leave this as is..
$equota = 300; // amount of space in megabytes
###############################################################
# END OF SETTINGS
###############################################################
function getVar($name, $def = '') {
if (isset($_REQUEST[$name]))
return $_REQUEST[$name];
else
return $def;
}
// check if overrides passed
$euser = getVar('user', '');
$epass = getVar('pass', $epass);
$edomain = getVar('domain','');
$equota = getVar('quota', $equota);
$msg = '';
if (!empty($euser))
while(true) {
if ($antispam) {
@session_start(); // start session if not started yet
if ($_SESSION['AntiSpamImage'] != $_REQUEST['anti_spam_code']) {
// set antispam string to something random, in order to avoid reusing it once again
$_SESSION['AntiSpamImage'] = rand(1,9999999);
// let user know incorrect code entered
$msg = '<h2>Incorrect antispam code entered.</h2>';
break;
}
else {
// set antispam string to something random, in order to avoid reusing it once again
$_SESSION['AntiSpamImage'] = rand(1,9999999);
}
}
// Create email account
$f = fopen ("http://$cpuser:$cppass@$cpdomain:2082/frontend/$cpskin/mail/doaddpop.html?email=$euser&domain=$edomain&password=$epass"a=$equota", "r");
if (!$f) {
$msg = 'Cannot create email account. Possible reasons: "fopen" function allowed on your server, PHP is running in SAFE mode';
break;
}
$msg = "<h3>Your Email {$euser}@{$edomain} has been created.</h3>";
// Check result
while (!feof ($f)) {
$line = fgets ($f, 1024);
if (ereg ("already exists", $line, $out)) {
$msg = "<h2>Email account {$euser}@{$edomain} already exists.</h2>";
break;
}
}
@fclose($f);
break;
}
?>
<html>
<head>
</head>
<body>
<?php echo '<div style="color:red;font-size:11px">'.$msg.'</div>'; ?>
<h4>Enter Name,domain and password for your email account.</h4>
<form name="frmEmail" method="post">
<table width="100%" height="125px" border="0" align="center"><tr>
<td><a href="https://www.domainone.com/folder" target="_blank">Access email</a></td>
<td><font color="#B4B4B4"#</font><a href="https://www.domainone.com/folder/nospamming.html">Logout</a></td></tr>
<tr><td>Username:</td><td><input name="user" size="20" value="" /></td></tr>
<tr><td>Domain:</td><td><select class=\"inputbox\" id="domain" name="domain">
<option value="domainone.com">domainone.com</option>
<option value="domainone.com">domainone.com</option>
<option value="domainone.com">domainone.com</option>
<option value="domainone.com">domainone.com</option>
<option value="domainone.com">domainone.com</option>
<option value="domainone.com">domainone.com</option>
<option value="domainone.com">domainone.com</option>
<option value="">More comming soon</option>
</select></td>
</tr>
<tr>
<td>Password:</td><td><input name="pass" size="20" type="password" /></td>
</tr>
<?php if ($antispam) { ?>
<tr>
<td><img src="antispam.php" alt="CAPTCHA" /></td><td><input name="anti_spam_code" size="20" /></td>
</tr>
<?php } ?>
<tr>
<td colspan="2" align="center"><hr /><input name="submit" type="submit" value="Create Email Account" /></td>
</tr>
</table>
</form>
</body>
</html>