SF.net SVN: postfixadmin:[824] branches/postfixadmin-2.3
Brought to you by:
christian_boltz,
gingerdog
From: <chr...@us...> - 2010-05-16 22:55:25
|
Revision: 824 http://postfixadmin.svn.sourceforge.net/postfixadmin/?rev=824&view=rev Author: christian_boltz Date: 2010-05-16 22:55:19 +0000 (Sun, 16 May 2010) Log Message: ----------- merged more fixes (between r793 and r823) from trunk to 2.3 branch - merged SVN r794, r801 (only md5crypt part), r803, r808, r810, r814, r815 (only functions.inc.php), r822 to 2.3 branch - see CHANGELOG.TXT changes for details not yet merged and/or to be discussed: - r805 - debian/* - normes or GingerDog, can you merge this part, please? I don't want to change stuff that I don't understand ;-) - display alias targets for mailboxes (r751 and r787 part b) (yes, that's still a leftover from the first merge round - and IMHO the only blocker for the 2.3.1 release) - r800, r806, r821 - Squirrelmail Plugin - r811, r812 - Squirrelmail Plugin / Zend - not sure if we really should include the whole Zend framework in the tarball, it's laaaaaarge and only useful for squirrelmail users. I'd vote for a "Requires: Zend" in the documentation. - r815: the change in users/index.php makes access to users/ too easy if someone forgot to logout (security by obscurity, but still...) - r817 - ADDITIONS/cyrus (config file path?) - r819 - maildir path hook (BTW: the example function should be moved to config.inc.php) Modified Paths: -------------- branches/postfixadmin-2.3/CHANGELOG.TXT branches/postfixadmin-2.3/DOCUMENTS/DOVECOT.txt branches/postfixadmin-2.3/INSTALL.TXT branches/postfixadmin-2.3/edit-alias.php branches/postfixadmin-2.3/functions.inc.php branches/postfixadmin-2.3/languages/nl.lang branches/postfixadmin-2.3/list-domain.php branches/postfixadmin-2.3/setup.php branches/postfixadmin-2.3/upgrade.php branches/postfixadmin-2.3/viewlog.php Modified: branches/postfixadmin-2.3/CHANGELOG.TXT =================================================================== --- branches/postfixadmin-2.3/CHANGELOG.TXT 2010-05-16 22:21:38 UTC (rev 823) +++ branches/postfixadmin-2.3/CHANGELOG.TXT 2010-05-16 22:55:19 UTC (rev 824) @@ -28,6 +28,16 @@ superadmins) - add in_array() check to avoid that superadmins can enter invalid domains - fix delete link for alias domains (when on target domain) + - fix hardcoded table names in list-domain.php + - fixed edit-alias.php not to drop alias to the mailbox if + special_alias_control = NO + - fix typo in upgrade.php that broke index creation and deletion when using + non-default table names + - fix creating 'ALL' domain (dummy for superadmins) when using non-default + table names + - check for $CONF['encrypt'] = 'dovecot:md5-crypt' (postfixadmin login not + working because dovecotpw uses a new salt each time), recommend + internal md5crypt instead Version 2.3 - 2009/10/24 - SVN r739 ----------------------------------- Modified: branches/postfixadmin-2.3/DOCUMENTS/DOVECOT.txt =================================================================== --- branches/postfixadmin-2.3/DOCUMENTS/DOVECOT.txt 2010-05-16 22:21:38 UTC (rev 823) +++ branches/postfixadmin-2.3/DOCUMENTS/DOVECOT.txt 2010-05-16 22:55:19 UTC (rev 824) @@ -65,6 +65,11 @@ user_query = SELECT maildir, 1001 AS uid, 1001 AS gid FROM mailbox WHERE username = '%u' AND active='1' +for dovecot 1.2: (for PostgreSQL, replace 'CONCAT(a, b)' with 'a || b') +user_query = SELECT CONCAT('/home/vmail/', maildir) AS home, 1001 AS uid, 1001 AS gid, + CONCAT('*:bytes=', quota) AS quota_rule FROM mailbox WHERE username = '%u' AND active='1' + + NB! The GID and UID are for postfix user and group ID, NOT MySQL user and group ID. Modified: branches/postfixadmin-2.3/INSTALL.TXT =================================================================== --- branches/postfixadmin-2.3/INSTALL.TXT 2010-05-16 22:21:38 UTC (rev 823) +++ branches/postfixadmin-2.3/INSTALL.TXT 2010-05-16 22:55:19 UTC (rev 824) @@ -117,7 +117,17 @@ This is all that is needed. Fire up your browser and go to the site that you specified to host Postfix Admin. -6. More information +6. Integration with Postfix, Dovecot etc. +----------------------------------------- + +Now that PostfixAdmin is working, you need to do some configuration in Postfix, +Dovecot etc. so that they use the domains, mailboxes and aliases you setup in +PostfixAdmin. + +The files in the DOCUMENTS/ directory explain which settings you need to +do/change. + +7. More information ------------------- As of March 2007, PostfixAdmin moved to SourceForge. For the forum posts and source updates, see: Modified: branches/postfixadmin-2.3/edit-alias.php =================================================================== --- branches/postfixadmin-2.3/edit-alias.php 2010-05-16 22:21:38 UTC (rev 823) +++ branches/postfixadmin-2.3/edit-alias.php 2010-05-16 22:55:19 UTC (rev 824) @@ -135,7 +135,7 @@ { if($CONF['alias_control_admin'] == 'NO' && !authentication_has_role('global-admin')) { // if original record had a mailbox alias, so ensure the updated one does too. - if(in_array($orig_alias_list, $fAddress)) { + if(in_array($fAddress, $orig_alias_list)) { $new_aliases[] = $fAddress; } } Modified: branches/postfixadmin-2.3/functions.inc.php =================================================================== --- branches/postfixadmin-2.3/functions.inc.php 2010-05-16 22:21:38 UTC (rev 823) +++ branches/postfixadmin-2.3/functions.inc.php 2010-05-16 22:55:19 UTC (rev 824) @@ -81,7 +81,12 @@ if(authentication_has_role($role)) { return True; } - header("Location: " . $CONF['postfix_admin_url'] . "/login.php"); + if($role === 'user') { + header("Location: " . $CONF['postfix_admin_url'] . '/users/login.php'); + } + else { + header("Location: " . $CONF['postfix_admin_url'] . "/login.php"); + } exit(0); } /** @@ -1199,6 +1204,7 @@ $split_method = preg_split ('/:/', $CONF['encrypt']); $method = strtoupper($split_method[1]); if (! preg_match("/^[A-Z0-9-]+$/", $method)) { die("invalid dovecot encryption method"); } # TODO: check against a fixed list? + if (strtolower($method) == md5-crypt) die("\$CONF[encrypt] = dovecot:md5-crypt will not work because dovecotpw generates a random salt each time. Please use \$CONF[encrypt] = md5crypt instead."); $dovecotpw = "dovecotpw"; if (!empty($CONF['dovecotpw'])) $dovecotpw = $CONF['dovecotpw']; Modified: branches/postfixadmin-2.3/languages/nl.lang =================================================================== --- branches/postfixadmin-2.3/languages/nl.lang 2010-05-16 22:21:38 UTC (rev 823) +++ branches/postfixadmin-2.3/languages/nl.lang 2010-05-16 22:55:19 UTC (rev 824) @@ -85,7 +85,7 @@ $PALANG['pOverview_get_modified'] = 'Laatst bewerkt'; $PALANG['pDelete_delete_error'] = '<span class="error_msg">Mislukt te verwijderen '; -$PALANG['pDelete_delete_success'] = '%s verwijdert.'; +$PALANG['pDelete_delete_success'] = '%s verwijderd.'; $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">Dit is niet uw domein '; @@ -191,12 +191,12 @@ $PALANG['pViewlog_action'] = 'Actie'; $PALANG['pViewlog_data'] = 'Aanpassing'; $PALANG['pViewlog_action_create_mailbox'] = 'Mailbox toegevoegd'; -$PALANG['pViewlog_action_delete_mailbox'] = 'Mailbox verwijdert'; +$PALANG['pViewlog_action_delete_mailbox'] = 'Mailbox verwijderd'; $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'] = 'maak domein alias'; -$PALANG['pViewlog_action_delete_alias'] = 'alias verwijdert'; +$PALANG['pViewlog_action_delete_alias'] = 'alias verwijderd'; $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'; @@ -331,7 +331,7 @@ $PALANG['pUsersMenu_password'] = 'Wijzig wachtwoord'; $PALANG['pUsersMain_vacation'] = 'Stel een "out of office" bericht of automatisch beantwoorden voor uw e-mail in.'; -$PALANG['pUsersMain_vacationSet'] = $PALANG['pUsersMenu_vacation'] . ' is actief, click \'' . $PALANG['pUsersMenu_vacation'] . '\' to ' . $PALANG['edit'] . '/verweideren'; +$PALANG['pUsersMain_vacationSet'] = $PALANG['pUsersMenu_vacation'] . ' is actief, click \'' . $PALANG['pUsersMenu_vacation'] . '\' to ' . $PALANG['edit'] . '/verwijderen'; $PALANG['pUsersMain_edit_alias'] = 'Wijzig uw e-mail forwarding.'; $PALANG['pUsersMain_password'] = 'Wijzig uw huidige wachtwoord.'; @@ -353,8 +353,8 @@ $PALANG['pCreate_dbLog_createmailbox'] = 'mailbox aangemaakt'; $PALANG['pCreate_dbLog_createalias'] = 'alias aangemaakt'; -$PALANG['pDelete_dbLog_deletealias'] = 'alias verwijdert'; -$PALANG['pDelete_dbLog_deletemailbox'] = 'mailbox verwijdert'; +$PALANG['pDelete_dbLog_deletealias'] = 'alias verwijderd'; +$PALANG['pDelete_dbLog_deletemailbox'] = 'mailbox verwijderd'; $PALANG['pEdit_dbLog_editactive'] = 'status verandert'; $PALANG['pEdit_dbLog_editalias'] = 'bewerk alias'; Modified: branches/postfixadmin-2.3/list-domain.php =================================================================== --- branches/postfixadmin-2.3/list-domain.php 2010-05-16 22:21:38 UTC (rev 823) +++ branches/postfixadmin-2.3/list-domain.php 2010-05-16 22:55:19 UTC (rev 824) @@ -51,24 +51,28 @@ $list_domains = list_domains_for_admin(authentication_get_username()); } +$table_domain = table_by_key('domain'); +$table_mailbox = table_by_key('mailbox'); +$table_alias = table_by_key('alias'); + if ($list_all_domains == 1) { - $where = " WHERE domain.domain != 'ALL' "; # TODO: the ALL dummy domain is annoying... + $where = " WHERE $table_domain.domain != 'ALL' "; # TODO: the ALL dummy domain is annoying... } else { $list_domains = escape_string($list_domains); - $where = " WHERE domain.domain IN ('" . join("','", $list_domains) . "') "; + $where = " WHERE $table_domain.domain IN ('" . join("','", $list_domains) . "') "; } # fetch domain data and number of mailboxes # (PgSQL requires the extensive GROUP BY statement, https://sourceforge.net/forum/message.php?msg_id=7386240) $query = " - SELECT domain.* , COUNT( DISTINCT mailbox.username ) AS mailbox_count - FROM domain - LEFT JOIN mailbox ON domain.domain = mailbox.domain + SELECT $table_domain.* , COUNT( DISTINCT $table_mailbox.username ) AS mailbox_count + FROM $table_domain + LEFT JOIN $table_mailbox ON $table_domain.domain = $table_mailbox.domain $where - GROUP BY domain.domain, domain.description, domain.aliases, domain.mailboxes, - domain.maxquota, domain.quota, domain.transport, domain.backupmx, domain.created, - domain.modified, domain.active - ORDER BY domain.domain + GROUP BY $table_domain.domain, $table_domain.description, $table_domain.aliases, $table_domain.mailboxes, + $table_domain.maxquota, $table_domain.quota, $table_domain.transport, $table_domain.backupmx, $table_domain.created, + $table_domain.modified, $table_domain.active + ORDER BY $table_domain.domain "; $result = db_query($query); @@ -80,12 +84,12 @@ # fetch number of aliases # doing this separate is much faster than doing it in one "big" query $query = " - SELECT domain.domain, COUNT( DISTINCT alias.address ) AS alias_count - FROM domain - LEFT JOIN alias ON domain.domain = alias.domain + SELECT $table_domain.domain, COUNT( DISTINCT $table_alias.address ) AS alias_count + FROM $table_domain + LEFT JOIN $table_alias ON $table_domain.domain = $table_alias.domain $where - GROUP BY domain.domain - ORDER BY domain.domain + GROUP BY $table_domain.domain + ORDER BY $table_domain.domain "; $result = db_query($query); Modified: branches/postfixadmin-2.3/setup.php =================================================================== --- branches/postfixadmin-2.3/setup.php 2010-05-16 22:21:38 UTC (rev 823) +++ branches/postfixadmin-2.3/setup.php 2010-05-16 22:55:19 UTC (rev 824) @@ -336,7 +336,7 @@ $table_domain = table_by_key('domain'); $r = db_query("SELECT * FROM $table_domain WHERE domain = 'ALL'"); if($r['rows'] == 0) { - db_insert($table_domain, array('domain' => 'ALL')); // all other fields should default through the schema. + db_insert('domain', array('domain' => 'ALL')); // all other fields should default through the schema. } list ($error, $tMessage, $pAdminCreate_admin_username_text, $pAdminCreate_admin_password_text) = create_admin($fUsername, $fPassword, $fPassword2, array('ALL'), TRUE); Modified: branches/postfixadmin-2.3/upgrade.php =================================================================== --- branches/postfixadmin-2.3/upgrade.php 2010-05-16 22:21:38 UTC (rev 823) +++ branches/postfixadmin-2.3/upgrade.php 2010-05-16 22:55:19 UTC (rev 824) @@ -217,7 +217,7 @@ function _drop_index ($table, $index) { global $CONF; - $tabe = table_by_key ($table); + $table = table_by_key ($table); if ($CONF['database_type'] == 'mysql' || $CONF['database_type'] == 'mysqli' ) { return "ALTER TABLE $table DROP INDEX $index"; @@ -231,7 +231,7 @@ function _add_index($table, $indexname, $fieldlist) { global $CONF; - $tabe = table_by_key ($table); + $table = table_by_key ($table); if ($CONF['database_type'] == 'mysql' || $CONF['database_type'] == 'mysqli' ) { return "ALTER TABLE $table ADD INDEX `$indexname` ( `$fieldlist` )"; Modified: branches/postfixadmin-2.3/viewlog.php =================================================================== --- branches/postfixadmin-2.3/viewlog.php 2010-05-16 22:21:38 UTC (rev 823) +++ branches/postfixadmin-2.3/viewlog.php 2010-05-16 22:55:19 UTC (rev 824) @@ -53,6 +53,9 @@ $tMessage = $PALANG['pViewlog_result_error']; } +// we need to initialize $tLog as an array! +$tLog = array(); + if ($error != 1) { $query = "SELECT timestamp,username,domain,action,data FROM $table_log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT 10"; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |