merge of r371:379 from trunk

git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/branches/postfixadmin-2.2.1@384 a1433add-5e2c-0410-b055-b7f2511e0802
David Goodwin 18 years ago
parent 9b2f6f1bea
commit 850a72f86d

@ -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.

@ -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

@ -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'] . "<br />($fUsername)<br />";

@ -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 {

@ -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 '<p>WARNING: Problems running mailbox postedit script!</p>';
return FALSE;
}
return TRUE;
}
/*
Called after a mailbox has been deleted in the DBMS.
Returns: boolean.

@ -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'] = '<span class="error_msg">Mislukt te verwijdere
$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_active'] = 'Actief';
$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_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'] = '<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_button'] = 'Voeg Domein toe';
$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_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 ';

@ -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 "<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)

@ -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++)

@ -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++)

@ -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 @@ function upgrade_344_pgsql() {
}
}
/**
* 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);
}
}

Loading…
Cancel
Save