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'] = '
De ALIAS is niet geldig!'; +$PALANG['pCreate_alias_address_text_error1'] = '
De Alias is niet geldig!'; $PALANG['pCreate_alias_address_text_error2'] = '
Dit e-mail aders bestaat al, kies aub een andere.'; $PALANG['pCreate_alias_address_text_error3'] = '
U bezit het maximum aantal aliassen.'; $PALANG['pCreate_alias_goto'] = 'Naar'; @@ -125,7 +125,7 @@ $PALANG['pEdit_alias_active'] = 'Actief'; $PALANG['pEdit_alias_goto_text_error1'] = 'U heeft geen Naar opgegeven.'; $PALANG['pEdit_alias_goto_text_error2'] = 'Het e-mail adres wat u opgaf is niet geldig: '; $PALANG['pEdit_alias_domain_error'] = 'Dit domein is niet van u: '; -$PALANG['pEdit_alias_domain_result_error'] = 'Unable to modify the alias domain!'; # XXX +$PALANG['pEdit_alias_domain_result_error'] = 'Niet in staat de domein alias te bewerken!'; $PALANG['pEdit_alias_forward_and_store'] = 'Lever af op de lokale mailbox.'; $PALANG['pEdit_alias_forward_only'] = 'Alleen op opgegeven email adres afleveren.'; $PALANG['pEdit_alias_button'] = 'Bewerk Alias'; @@ -195,12 +195,12 @@ $PALANG['pViewlog_action_delete_mailbox'] = 'Mailbox verwijdert'; $PALANG['pViewlog_action_edit_mailbox'] = 'Mailbox bewerkt'; $PALANG['pViewlog_action_edit_mailbox_state'] = 'status actieve mailbox bewerkt'; $PALANG['pViewlog_action_create_alias'] = 'alias toegevoegd'; -$PALANG['pViewlog_action_create_alias_domain'] = 'create alias domain'; # XXX +$PALANG['pViewlog_action_create_alias_domain'] = 'maak domein alias'; $PALANG['pViewlog_action_delete_alias'] = 'alias verwijdert'; -$PALANG['pViewlog_action_delete_alias_domain'] = 'delete alias domain'; # XXX +$PALANG['pViewlog_action_delete_alias_domain'] = 'verwijder alias domein'; $PALANG['pViewlog_action_edit_alias'] = 'alias bewerkt'; $PALANG['pViewlog_action_edit_alias_state'] = 'status actieve alias bewerkt'; -$PALANG['pViewlog_action_edit_alias_domain_state'] = 'edit alias domain active'; # XXX +$PALANG['pViewlog_action_edit_alias_domain_state'] = 'status actieve domein alias bewerkt'; $PALANG['pViewlog_action_edit_password'] = 'wachtwoord aangepast'; $PALANG['pViewlog_button'] = 'Ga'; @@ -214,8 +214,8 @@ $PALANG['pSendmail_subject'] = 'Onderwerp'; $PALANG['pSendmail_subject_text'] = 'Welkom'; $PALANG['pSendmail_body'] = 'Inhoud'; $PALANG['pSendmail_button'] = 'Verstuur bericht'; -$PALANG['pSendmail_result_error'] = 'Mislukt om mailbox te maken!'; # XXX text change - new: Unable to send email! -$PALANG['pSendmail_result_success'] = 'De mailbox is aangemaakt.'; # XXX text change - new: Email sent! +$PALANG['pSendmail_result_error'] = 'Mislukt om mail te versturen!'; +$PALANG['pSendmail_result_success'] = 'E-mail verstuurd!'; $PALANG['pAdminMenu_list_admin'] = 'Beheerders overzicht'; $PALANG['pAdminMenu_list_domain'] = 'Domein overzicht'; @@ -277,7 +277,7 @@ $PALANG['pAdminCreate_domain_button'] = 'Voeg Domein toe'; $PALANG['pAdminCreate_domain_result_error'] = 'Mislukt om het domein toe te voegen.'; $PALANG['pAdminCreate_domain_result_success'] = 'Domein is toegevoegd!'; $PALANG['pAdminDelete_domain_error'] = 'Niet in staat domein te verwijderen!'; -$PALANG['pAdminDelete_alias_domain_error'] = 'Unable to remove domain alias!'; # XXX +$PALANG['pAdminDelete_alias_domain_error'] = 'Niet in staat domein alias te verwijderen!'; $PALANG['pAdminEdit_domain_welcome'] = 'Bewerk een domein'; $PALANG['pAdminEdit_domain_domain'] = 'Domein'; @@ -367,8 +367,8 @@ $PALANG['pBroadcast_name'] = 'Uw naam'; $PALANG['pBroadcast_subject'] = 'Onderwerp'; $PALANG['pBroadcast_message'] = 'Bericht'; $PALANG['pBroadcast_send'] = 'Verzend bericht'; -$PALANG['pBroadcast_success'] = 'Uw broadcast bericht is verzonden.'; -$PALANG['pAdminMenu_broadcast_message'] = 'Broadcast bericht'; # XXX partly translated +$PALANG['pBroadcast_success'] = 'Uw algemene bericht is verzonden.'; +$PALANG['pAdminMenu_broadcast_message'] = 'Algemeen bericht'; $PALANG['pBroadcast_error_empty'] = 'De velden Naam, Onderwerp en Bericht mogen niet leeg zijn !'; $PALANG['pStatus_undeliverable'] = 'Misschien niet af te leveren '; $PALANG['pStatus_custom'] = 'Bezorgen op '; diff --git a/setup.php b/setup.php index fa499d66..844aafef 100644 --- a/setup.php +++ b/setup.php @@ -52,6 +52,7 @@ $f_pg_connect = function_exists ("pg_connect"); $f_session_start = function_exists ("session_start"); $f_preg_match = function_exists ("preg_match"); $f_mb_encode_mimeheader = function_exists ("mb_encode_mimeheader"); +$f_imap_open = function_exists ("imap_open"); $file_config = file_exists (realpath ("./config.inc.php")); @@ -263,6 +264,27 @@ else $error =+ 1; } + +// +// Imap functions +// +if ( $f_imap_open == 1) +{ + print "
  • Depends on: IMAP functions - OK
  • \n"; +} +else +{ + print "
  • Warning: Depends on: IMAP functions - NOT FOUND
    \n"; + print "To install IMAP support, install php$phpversion-imap
    \n"; + print "Without IMAP support, you won't be able to create subfolders when creating mailboxes.
  • \n"; +# $error =+ 1; +} + + + + + + print ""; if ($error != 0) diff --git a/templates/create-alias.php b/templates/create-alias.php index 0f29d9e9..f4dee2f2 100644 --- a/templates/create-alias.php +++ b/templates/create-alias.php @@ -8,7 +8,7 @@ - + @ - + @