diff --git a/DOCUMENTS/DOVECOT.txt b/DOCUMENTS/DOVECOT.txt
index 151a44bb..4ac1bf11 100644
--- a/DOCUMENTS/DOVECOT.txt
+++ b/DOCUMENTS/DOVECOT.txt
@@ -38,8 +38,11 @@ db_passwd = postfix
db_client_flags = 0
# Default password scheme.
-
-default_pass_scheme = PLAIN-MD5
+# depends on your $CONF['encrypt'] setting:
+# md5crypt -> MD5-CRYPT
+# md5 -> PLAIN-MD5
+# cleartext -> PLAIN
+default_pass_scheme = MD5-CRYPT
# Query to retrieve password.
diff --git a/config.inc.php b/config.inc.php
index 3f2a5610..4bc4217a 100644
--- a/config.inc.php
+++ b/config.inc.php
@@ -238,7 +238,7 @@ Hi,
Welcome to your new account.
EOM;
-// When creating mailboxes, check that the domain-part of the
+// When creating mailboxes or aliases, check that the domain-part of the
// address is legal by performing a name server look-up.
$CONF['emailcheck_resolve_domain']='YES';
@@ -281,6 +281,13 @@ $CONF['show_custom_colors']=array("lightgreen","lightblue");
// prevent the web-server from executing external scripts.
// $CONF['mailbox_postcreation_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postcreation.sh';
+// Optional:
+// Script to run after alteration of mailboxes.
+// Note that this may fail if PHP is run in "safe mode", or if
+// operating system features (such as SELinux) or limitations
+// prevent the web-server from executing external scripts.
+// $CONF['mailbox_postedit_script']='sudo -u courier /usr/local/bin/postfixadmin-mailbox-postedit.sh';
+
// Optional:
// Script to run after deletion of mailboxes.
// Note that this may fail if PHP is run in "safe mode", or if
diff --git a/create-mailbox.php b/create-mailbox.php
index cc22cca4..cb25ec43 100644
--- a/create-mailbox.php
+++ b/create-mailbox.php
@@ -263,7 +263,7 @@ TODO: this is the start of /create-mailbox code segment that was originally used
*/
$result = db_query ("INSERT INTO $table_mailbox (username,password,name,maildir,quota,domain,created,modified,active) VALUES ('$fUsername','$password','$fName','$maildir','$quota','$fDomain',NOW(),NOW(),'$sqlActive')");
- if ($result['rows'] != 1 || !mailbox_postcreation($fUsername,$fDomain,$maildir))
+ if ($result['rows'] != 1 || !mailbox_postcreation($fUsername,$fDomain,$maildir, $quota))
{
$tDomain = $fDomain;
$tMessage .= $PALANG['pCreate_mailbox_result_error'] . "
($fUsername)
";
diff --git a/edit-mailbox.php b/edit-mailbox.php
index 3138c9cb..a22642e7 100644
--- a/edit-mailbox.php
+++ b/edit-mailbox.php
@@ -153,7 +153,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$formvars['active']=$sqlActive;
$result = db_update ('mailbox', "username='$fUsername' AND domain='$fDomain'", $formvars, array('modified'));
- if ($result != 1) {
+ if ($result != 1 || !mailbox_postedit($fUsername,$fDomain,$maildir, $quota)) {
$tMessage = $PALANG['pEdit_mailbox_result_error'];
}
else {
diff --git a/functions.inc.php b/functions.inc.php
index d1fe69f2..8bca265a 100644
--- a/functions.inc.php
+++ b/functions.inc.php
@@ -1709,7 +1709,7 @@ function table_by_pos ($pos)
Called after a mailbox has been created in the DBMS.
Returns: boolean.
*/
-function mailbox_postcreation($username,$domain,$maildir)
+function mailbox_postcreation($username,$domain,$maildir,$quota)
{
if (empty($username) || empty($domain) || empty($maildir))
{
@@ -1725,7 +1725,9 @@ function mailbox_postcreation($username,$domain,$maildir)
$cmdarg1=escapeshellarg($username);
$cmdarg2=escapeshellarg($domain);
$cmdarg3=escapeshellarg($maildir);
- $command=$CONF[$confpar]." $cmdarg1 $cmdarg2 $cmdarg3";
+ if ($quota <= 0) $quota = 0;
+ $cmdarg4=escapeshellarg($quota);
+ $command=$CONF[$confpar]." $cmdarg1 $cmdarg2 $cmdarg3 $cmdarg4";
$retval=0;
$output=array();
$firstline='';
@@ -1740,6 +1742,44 @@ function mailbox_postcreation($username,$domain,$maildir)
return TRUE;
}
+/*
+ Called after a mailbox has been altered in the DBMS.
+ Returns: boolean.
+ */
+function mailbox_postedit($username,$domain,$maildir,$quota)
+{
+ if (empty($username) || empty($domain) || empty($maildir))
+ {
+ trigger_error('In '.__FUNCTION__.': empty username, domain and/or maildir parameter',E_USER_ERROR);
+ return FALSE;
+ }
+
+ global $CONF;
+ $confpar='mailbox_postedit_script';
+
+ if (!isset($CONF[$confpar]) || empty($CONF[$confpar])) return TRUE;
+
+ $cmdarg1=escapeshellarg($username);
+ $cmdarg2=escapeshellarg($domain);
+ $cmdarg3=escapeshellarg($maildir);
+ if ($quota <= 0) $quota = 0;
+ $cmdarg4=escapeshellarg($quota);
+ $command=$CONF[$confpar]." $cmdarg1 $cmdarg2 $cmdarg3 $cmdarg4";
+ $retval=0;
+ $output=array();
+ $firstline='';
+ $firstline=exec($command,$output,$retval);
+ if (0!=$retval)
+ {
+ error_log("Running $command yielded return value=$retval, first line of output=$firstline");
+ print '
WARNING: Problems running mailbox postedit script!
'; + return FALSE; + } + + return TRUE; +} + + /* Called after a mailbox has been deleted in the DBMS. Returns: boolean. diff --git a/languages/nl.lang b/languages/nl.lang index 744262bb..ff0ffdcb 100644 --- a/languages/nl.lang +++ b/languages/nl.lang @@ -30,7 +30,7 @@ $PALANG['pLogin_login_users'] = 'Gebruikers klik hier om in te loggen.'; $PALANG['pMenu_main'] = 'Start'; $PALANG['pMenu_overview'] = 'Overzicht'; $PALANG['pMenu_create_alias'] = 'Alias toevoegen'; -$PALANG['pMenu_create_alias_domain'] = 'Add Alias Domain'; # XXX +$PALANG['pMenu_create_alias_domain'] = 'Domein alias toevoegen'; $PALANG['pMenu_create_mailbox'] = 'Mailbox toevoegen'; $PALANG['pMenu_fetchmail'] = 'Externe email ophalen'; $PALANG['pMenu_sendmail'] = 'Verstuur E-mail'; @@ -53,21 +53,21 @@ $PALANG['pOverview_title'] = ':: Gedefinieerde domeinen'; $PALANG['pOverview_up_arrow'] = 'Naar Boven'; $PALANG['pOverview_right_arrow'] = 'Volgende Pagina'; $PALANG['pOverview_left_arrow'] = 'Vorige Pagina'; -$PALANG['pOverview_alias_domain_title'] = ':: Domain Aliases'; # XXX +$PALANG['pOverview_alias_domain_title'] = ':: Domein aliasen'; $PALANG['pOverview_alias_title'] = ':: Alias'; -$PALANG['pOverview_mailbox_title'] = ':: Mailboxes'; +$PALANG['pOverview_mailbox_title'] = ':: Mailboxen'; $PALANG['pOverview_button'] = 'Ga'; $PALANG['pOverview_welcome'] = 'Overzicht voor '; -$PALANG['pOverview_alias_domain_aliases'] = 'Alias Domains'; # XXX -$PALANG['pOverview_alias_domain_target'] = '%s is an Alias Domain for:'; # XXX +$PALANG['pOverview_alias_domain_aliases'] = 'Alias domeinen'; +$PALANG['pOverview_alias_domain_target'] = '%s is een alias voor domein:'; $PALANG['pOverview_alias_alias_count'] = 'Aliasen'; $PALANG['pOverview_alias_mailbox_count'] = 'Mailboxes'; $PALANG['pOverview_alias_address'] = 'Van'; $PALANG['pOverview_alias_goto'] = 'Naar'; $PALANG['pOverview_alias_modified'] = 'Laatst Bewerkt'; -$PALANG['pOverview_alias_domain_modified'] = 'Last Modified'; # XXX +$PALANG['pOverview_alias_domain_modified'] = 'Laatst Bewerkt'; $PALANG['pOverview_alias_active'] = 'Actief'; -$PALANG['pOverview_alias_domain_active'] = 'Active'; # XXX +$PALANG['pOverview_alias_domain_active'] = 'Actief'; $PALANG['pOverview_alias_edit'] = 'Alias'; $PALANG['and_x_more'] = '[en %s meer...]'; $PALANG['pOverview_mailbox_username'] = 'e-mail'; @@ -80,8 +80,8 @@ $PALANG['pOverview_vacation_option'] = 'Activeer automatisch beantwoorden'; $PALANG['pOverview_get_domain'] = 'Domein'; $PALANG['pOverview_get_aliases'] = 'Aliassen'; -$PALANG['pOverview_get_alias_domains'] = 'Domain Aliases'; # XXX -$PALANG['pOverview_get_mailboxes'] = 'Mailboxes'; +$PALANG['pOverview_get_alias_domains'] = 'Domein aliasen'; +$PALANG['pOverview_get_mailboxes'] = 'Mailboxen'; $PALANG['pOverview_get_quota'] = 'Mailbox Quota (MB)'; $PALANG['pOverview_get_modified'] = 'Laatst bewerkt'; @@ -89,23 +89,23 @@ $PALANG['pDelete_delete_error'] = 'Mislukt te verwijdere $PALANG['pDelete_delete_success'] = '%s verwijdert.'; $PALANG['pDelete_postdelete_error'] = 'Niet in staat mailbox te verwijderen '; $PALANG['pDelete_domain_error'] = 'Dit is niet uw domein '; -$PALANG['pDelete_domain_alias_error'] = 'This domain is not yours '; # XXX +$PALANG['pDelete_domain_alias_error'] = 'Dit is niet uw domein '; $PALANG['pDelete_alias_error'] = 'Niet in staat alias te verwijderen '; -$PALANG['pCreate_alias_domain_welcome'] = 'Mirror addresses of one of your domains to another.'; # XXX -$PALANG['pCreate_alias_domain_alias'] = 'Alias Domain'; # XXX -$PALANG['pCreate_alias_domain_alias_text'] = 'The domain that mails come in for.'; # XXX -$PALANG['pCreate_alias_domain_target'] = 'Target Domain'; # XXX -$PALANG['pCreate_alias_domain_target_text'] = 'The domain where mails should go to.'; # XXX -$PALANG['pCreate_alias_domain_active'] = 'Active'; # XXX -$PALANG['pCreate_alias_domain_button'] = 'Add Alias Domain'; # XXX -$PALANG['pCreate_alias_domain_error1'] = 'You are not allowed to create the chosen configuration.'; # XXX -$PALANG['pCreate_alias_domain_error2'] = 'The chosen configuration is invalid, please choose a different one!'; # XXX -$PALANG['pCreate_alias_domain_error3'] = 'Database insert failed.'; # XXX -$PALANG['pCreate_alias_domain_success'] = 'The domain alias has been added to the alias domain table!'; # XXX +$PALANG['pCreate_alias_domain_welcome'] = 'Spiegel een van uw domeinen naar een ander domein.'; +$PALANG['pCreate_alias_domain_alias'] = 'Alias domein'; +$PALANG['pCreate_alias_domain_alias_text'] = 'Het domein waar mail voor binnen komt.'; +$PALANG['pCreate_alias_domain_target'] = 'Doel domein'; +$PALANG['pCreate_alias_domain_target_text'] = 'Domein waar de mail naar toe moet.'; +$PALANG['pCreate_alias_domain_active'] = 'Actief'; +$PALANG['pCreate_alias_domain_button'] = 'Voeg alias domein toe'; +$PALANG['pCreate_alias_domain_error1'] = 'U heeft niet genoeg rechten om de huidige configuratie te maken.'; +$PALANG['pCreate_alias_domain_error2'] = 'De huidige configuratie is ongeldig, slecteer een andere!'; +$PALANG['pCreate_alias_domain_error3'] = 'Fout bij vullen database.'; +$PALANG['pCreate_alias_domain_success'] = 'De domein alias is toegevoegd aan de alias domein tabel!'; $PALANG['pCreate_alias_welcome'] = 'Maak een nieuw alias aan voor uw domein.'; $PALANG['pCreate_alias_address'] = 'Alias'; -$PALANG['pCreate_alias_address_text_error1'] = '