SF.net SVN: postfixadmin: [384] branches/postfixadmin-2.2.1
Brought to you by:
christian_boltz,
gingerdog
From: <Gin...@us...> - 2008-06-17 21:02:03
|
Revision: 384 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=384&view=rev Author: GingerDog Date: 2008-06-17 14:02:06 -0700 (Tue, 17 Jun 2008) Log Message: ----------- merge of r371:379 from trunk Modified Paths: -------------- branches/postfixadmin-2.2.1/DOCUMENTS/DOVECOT.txt branches/postfixadmin-2.2.1/config.inc.php branches/postfixadmin-2.2.1/create-mailbox.php branches/postfixadmin-2.2.1/edit-mailbox.php branches/postfixadmin-2.2.1/functions.inc.php branches/postfixadmin-2.2.1/languages/nl.lang branches/postfixadmin-2.2.1/setup.php branches/postfixadmin-2.2.1/templates/create-alias.php branches/postfixadmin-2.2.1/templates/create-mailbox.php branches/postfixadmin-2.2.1/upgrade.php Modified: branches/postfixadmin-2.2.1/DOCUMENTS/DOVECOT.txt =================================================================== --- branches/postfixadmin-2.2.1/DOCUMENTS/DOVECOT.txt 2008-06-17 20:56:56 UTC (rev 383) +++ branches/postfixadmin-2.2.1/DOCUMENTS/DOVECOT.txt 2008-06-17 21:02:06 UTC (rev 384) @@ -38,9 +38,12 @@ db_client_flags = 0 # Default password scheme. +# depends on your $CONF['encrypt'] setting: +# md5crypt -> MD5-CRYPT +# md5 -> PLAIN-MD5 +# cleartext -> PLAIN +default_pass_scheme = MD5-CRYPT -default_pass_scheme = PLAIN-MD5 - # Query to retrieve password. password_query = SELECT password FROM mailbox WHERE username = '%u' Modified: branches/postfixadmin-2.2.1/config.inc.php =================================================================== --- branches/postfixadmin-2.2.1/config.inc.php 2008-06-17 20:56:56 UTC (rev 383) +++ branches/postfixadmin-2.2.1/config.inc.php 2008-06-17 21:02:06 UTC (rev 384) @@ -238,7 +238,7 @@ 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'; @@ -282,6 +282,13 @@ // $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 // operating system features (such as SELinux) or limitations Modified: branches/postfixadmin-2.2.1/create-mailbox.php =================================================================== --- branches/postfixadmin-2.2.1/create-mailbox.php 2008-06-17 20:56:56 UTC (rev 383) +++ branches/postfixadmin-2.2.1/create-mailbox.php 2008-06-17 21:02:06 UTC (rev 384) @@ -263,7 +263,7 @@ */ $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'] . "<br />($fUsername)<br />"; Modified: branches/postfixadmin-2.2.1/edit-mailbox.php =================================================================== --- branches/postfixadmin-2.2.1/edit-mailbox.php 2008-06-17 20:56:56 UTC (rev 383) +++ branches/postfixadmin-2.2.1/edit-mailbox.php 2008-06-17 21:02:06 UTC (rev 384) @@ -153,7 +153,7 @@ $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 { Modified: branches/postfixadmin-2.2.1/functions.inc.php =================================================================== --- branches/postfixadmin-2.2.1/functions.inc.php 2008-06-17 20:56:56 UTC (rev 383) +++ branches/postfixadmin-2.2.1/functions.inc.php 2008-06-17 21:02:06 UTC (rev 384) @@ -1709,7 +1709,7 @@ 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 @@ $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=''; @@ -1741,6 +1743,44 @@ } /* + 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 '<p>WARNING: Problems running mailbox postedit script!</p>'; + return FALSE; + } + + return TRUE; +} + + +/* Called after a mailbox has been deleted in the DBMS. Returns: boolean. */ Modified: branches/postfixadmin-2.2.1/languages/nl.lang =================================================================== --- branches/postfixadmin-2.2.1/languages/nl.lang 2008-06-17 20:56:56 UTC (rev 383) +++ branches/postfixadmin-2.2.1/languages/nl.lang 2008-06-17 21:02:06 UTC (rev 384) @@ -30,7 +30,7 @@ $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_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_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_success'] = '%s verwijdert.'; $PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Niet in staat mailbox te verwijderen '; $PALANG['pDelete_domain_error'] = '<span class="error_msg">Dit is niet uw domein '; -$PALANG['pDelete_domain_alias_error'] = '<span class="error_msg">This domain is not yours '; # XXX +$PALANG['pDelete_domain_alias_error'] = '<span class="error_msg">Dit is niet uw domein '; $PALANG['pDelete_alias_error'] = '<span class="error_msg">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'] = '<br /><span class="error_msg">De ALIAS is niet geldig!</span>'; +$PALANG['pCreate_alias_address_text_error1'] = '<br /><span class="error_msg">De Alias is niet geldig!</span>'; $PALANG['pCreate_alias_address_text_error2'] = '<br /><span class="error_msg">Dit e-mail aders bestaat al, kies aub een andere.</span>'; $PALANG['pCreate_alias_address_text_error3'] = '<br /><span class="error_msg">U bezit het maximum aantal aliassen.</span>'; $PALANG['pCreate_alias_goto'] = 'Naar'; @@ -125,7 +125,7 @@ $PALANG['pEdit_alias_goto_text_error1'] = '<span class="error_msg">U heeft geen Naar opgegeven.</span>'; $PALANG['pEdit_alias_goto_text_error2'] = '<span class="error_msg">Het e-mail adres wat u opgaf is niet geldig: '; $PALANG['pEdit_alias_domain_error'] = '<span class="error_msg">Dit domein is niet van u: '; -$PALANG['pEdit_alias_domain_result_error'] = '<span class="error_msg">Unable to modify the alias domain!</span>'; # XXX +$PALANG['pEdit_alias_domain_result_error'] = '<span class="error_msg">Niet in staat de domein alias te bewerken!</span>'; $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_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_text'] = 'Welkom'; $PALANG['pSendmail_body'] = 'Inhoud'; $PALANG['pSendmail_button'] = 'Verstuur bericht'; -$PALANG['pSendmail_result_error'] = '<span class="error_msg">Mislukt om mailbox te maken!</span>'; # XXX text change - new: <span class="error_msg">Unable to send email!</span> -$PALANG['pSendmail_result_success'] = 'De mailbox is aangemaakt.'; # XXX text change - new: Email sent! +$PALANG['pSendmail_result_error'] = '<span class="error_msg">Mislukt om mail te versturen!</span>'; +$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_result_error'] = '<span class="error_msg">Mislukt om het domein toe te voegen.</span>'; $PALANG['pAdminCreate_domain_result_success'] = 'Domein is toegevoegd!'; $PALANG['pAdminDelete_domain_error'] = '<span class="error_msg">Niet in staat domein te verwijderen!</span>'; -$PALANG['pAdminDelete_alias_domain_error'] = '<span class="error_msg">Unable to remove domain alias!</span>'; # XXX +$PALANG['pAdminDelete_alias_domain_error'] = '<span class="error_msg">Niet in staat domein alias te verwijderen!</span>'; $PALANG['pAdminEdit_domain_welcome'] = 'Bewerk een domein'; $PALANG['pAdminEdit_domain_domain'] = 'Domein'; @@ -367,8 +367,8 @@ $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 '; Modified: branches/postfixadmin-2.2.1/setup.php =================================================================== --- branches/postfixadmin-2.2.1/setup.php 2008-06-17 20:56:56 UTC (rev 383) +++ branches/postfixadmin-2.2.1/setup.php 2008-06-17 21:02:06 UTC (rev 384) @@ -52,6 +52,7 @@ $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 @@ $error =+ 1; } + +// +// Imap functions +// +if ( $f_imap_open == 1) +{ + print "<li>Depends on: IMAP functions - OK</li>\n"; +} +else +{ + print "<li><b>Warning: Depends on: IMAP functions - NOT FOUND</b><br />\n"; + print "To install IMAP support, install php$phpversion-imap<br />\n"; + print "Without IMAP support, you won't be able to create subfolders when creating mailboxes.</li>\n"; +# $error =+ 1; +} + + + + + + print "</ul>"; if ($error != 0) Modified: branches/postfixadmin-2.2.1/templates/create-alias.php =================================================================== --- branches/postfixadmin-2.2.1/templates/create-alias.php 2008-06-17 20:56:56 UTC (rev 383) +++ branches/postfixadmin-2.2.1/templates/create-alias.php 2008-06-17 21:02:06 UTC (rev 384) @@ -8,7 +8,7 @@ <tr> <td><?php print $PALANG['pCreate_alias_address']; ?></td> <td><input class="flat" type="text" name="fAddress" value="<?php print $tAddress; ?>" /></td> - <td> + <td>@ <select class="flat" name="fDomain"> <?php for ($i = 0; $i < sizeof ($list_domains); $i++) Modified: branches/postfixadmin-2.2.1/templates/create-mailbox.php =================================================================== --- branches/postfixadmin-2.2.1/templates/create-mailbox.php 2008-06-17 20:56:56 UTC (rev 383) +++ branches/postfixadmin-2.2.1/templates/create-mailbox.php 2008-06-17 21:02:06 UTC (rev 384) @@ -8,7 +8,7 @@ <tr> <td><?php print $PALANG['pCreate_mailbox_username'] . ":"; ?></td> <td><input class="flat" type="text" name="fUsername" value="<?php print $tUsername; ?>" autocomplete="off"/></td> - <td> + <td>@ <select name="fDomain"> <?php for ($i = 0; $i < sizeof ($list_domains); $i++) Modified: branches/postfixadmin-2.2.1/upgrade.php =================================================================== --- branches/postfixadmin-2.2.1/upgrade.php 2008-06-17 20:56:56 UTC (rev 383) +++ branches/postfixadmin-2.2.1/upgrade.php 2008-06-17 21:02:06 UTC (rev 384) @@ -1,5 +1,7 @@ <?php -require_once('common.php'); +if(!defined('POSTFIXADMIN')) { + require_once('common.php'); +} // vim ts=4:sw=4:et # Note: run with upgrade.php?debug=1 to see all SQL error messages @@ -864,3 +866,20 @@ } } + +/** + * Change description fields to UTF-8 + */ +function upgrade_373_mysql() { # MySQL only + $table_domain = table_by_key ('domain'); + $table_mailbox = table_by_key('mailbox'); + + $all_sql = split("\n", trim(" + ALTER TABLE `$table_domain` CHANGE `description` `description` VARCHAR( 255 ) {UTF-8} NOT NULL + ALTER TABLE `$table_mailbox` CHANGE `name` `name` VARCHAR( 255 ) {UTF-8} NOT NULL + ")); + + foreach ($all_sql as $sql) { + $result = db_query_parsed($sql); + } +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |