27 require_once(
"/usr/share/alternc/panel/class/config_nochk.php");
34 Usage: $wtfphp <email> <alias> ...
36 email: full email adress, including domain, which must exist
37 alias: one or many aliases the email should forward to, space separated
44 if (count($argv) < 2) {
48 $user = preg_split(
'/@/', $argv[1])[0];
55 $db->query(
'SELECT id,compte FROM domaines WHERE domaine=?',array(
$domain));
56 if (
$db->next_record()) {
57 $compte =
$db->f(
'compte');
58 $domain_id =
$db->f(
'id');
61 error_log(
"domain $domain not found");
73 error_log(
'password generators failed to produce 8 characters: ' . join(
"\n",
$generators));
89 quota: $default_quotas
95 error_log(
'not creating email because of $dryrun is true');
100 print "cuid: $cuid\n";
112 error_log(
'failed to create: ' .
$msg->msg_str());
123 error_log(
"failed to set password on mail $mail_id: " .
$msg->msg_str());
135 error_log(
'failed to set details: ' .
$msg->msg_str());
if(count($argv)< 2) $user
foreach($generators as $generator) if(is_null($password)) $quotas