From 7bf5b74a470b5a357ea7ffece80174a68ef4c61d Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Wed, 7 Jan 2015 21:25:20 +0000 Subject: [PATCH 1/4] MailboxHandler, AliasHandler: - initStruct: set "display in list" to 1 to allow searching for domain with list.php (nevertheless, the domain won't be displayed because it doesn't have a column label set) git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1735 a1433add-5e2c-0410-b055-b7f2511e0802 --- model/AliasHandler.php | 2 +- model/MailboxHandler.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/AliasHandler.php b/model/AliasHandler.php index ec71127f..8bc65001 100644 --- a/model/AliasHandler.php +++ b/model/AliasHandler.php @@ -30,7 +30,7 @@ class AliasHandler extends PFAHandler { 'localpart' => pacol( $this->new, 0, 0, 'text', 'alias' , 'pCreate_alias_catchall_text' , '', /*options*/ '', /*not_in_db*/ 1 ), - 'domain' => pacol( $this->new, 0, 0, 'enum', '' , '' , '', + 'domain' => pacol( $this->new, 0, 1, 'enum', '' , '' , '', /*options*/ $this->allowed_domains ), 'goto' => pacol( 1, 1, 1, 'txtl', 'to' , 'pEdit_alias_help' , array() ), 'is_mailbox' => pacol( 0, 0, 1, 'int', '' , '' , 0 , diff --git a/model/MailboxHandler.php b/model/MailboxHandler.php index 2cce7521..740b6b2b 100644 --- a/model/MailboxHandler.php +++ b/model/MailboxHandler.php @@ -17,7 +17,7 @@ class MailboxHandler extends PFAHandler { # editing? form list 'username' => pacol( $this->new, 1, 1, 'mail', 'pEdit_mailbox_username' , '' , '' ), 'local_part' => pacol( $this->new, 0, 0, 'text', 'pEdit_mailbox_username' , '' , '' ), - 'domain' => pacol( $this->new, 0, 0, 'enum', '' , '' , '', + 'domain' => pacol( $this->new, 0, 1, 'enum', '' , '' , '', /*options*/ $this->allowed_domains ), # TODO: maildir: display in list is needed to include maildir in SQL result (for post_edit hook) # TODO: (not a perfect solution, but works for now - maybe we need a separate "include in SELECT query" field?) From 087dc34b017905eeb50b0cb51de5c436401caaa8 Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Mon, 12 Jan 2015 17:12:07 +0000 Subject: [PATCH 2/4] MailboxHandler: - check_quota(): deny creating an unlimited mailbox if domain quota is set (reported by idaho7 in IRC) git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1736 a1433add-5e2c-0410-b055-b7f2511e0802 --- model/MailboxHandler.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/model/MailboxHandler.php b/model/MailboxHandler.php index 740b6b2b..f9080e9a 100644 --- a/model/MailboxHandler.php +++ b/model/MailboxHandler.php @@ -463,6 +463,8 @@ class MailboxHandler extends PFAHandler { return true; # enforcing domain_quota is disabled - just allow it } elseif ($limit['quota'] <= 0) { # TODO: CHECK - 0 (unlimited) is fine, not sure about <= -1 (disabled)... $rval = true; + } elseif ($quota == 0) { # trying to create an unlimited mailbox, but domain quota is set + return false; } else { $table_mailbox = table_by_key('mailbox'); $query = "SELECT SUM(quota) FROM $table_mailbox WHERE domain = '" . escape_string($domain) . "'"; From 5706f146d627912a76a7ff85d183035ce95ee9eb Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Sat, 24 Jan 2015 14:00:35 +0000 Subject: [PATCH 3/4] MailboxHandler: - storemore(): store maildir in the correct variable to fix running mailbox_postedit script Fix by bit-jockey @SF, https://sourceforge.net/p/postfixadmin/bugs/342/ git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1737 a1433add-5e2c-0410-b055-b7f2511e0802 --- model/MailboxHandler.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model/MailboxHandler.php b/model/MailboxHandler.php index f9080e9a..7d3b5708 100644 --- a/model/MailboxHandler.php +++ b/model/MailboxHandler.php @@ -265,7 +265,8 @@ class MailboxHandler extends PFAHandler { } else { $oldvalues = $old_mh->result(); - $maildir = $oldvalues['maildir']; + $this->values['maildir'] = $oldvalues['maildir']; + if (isset($this->values['quota'])) { $quota = $this->values['quota']; } else { From 75861f40eb88367922f658c2b4faebfef20db943 Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Wed, 28 Jan 2015 17:34:08 +0000 Subject: [PATCH 4/4] debian/control - change to depend on php5-mysql | php5-mysqlnd | php5-pgsql git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1738 a1433add-5e2c-0410-b055-b7f2511e0802 --- debian/control | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/control b/debian/control index 18547db3..be54f515 100644 --- a/debian/control +++ b/debian/control @@ -10,7 +10,7 @@ Homepage: http://postfixadmin.sourceforge.net Package: postfixadmin Architecture: all -Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common, apache2 | lighttpd | httpd, libapache2-mod-php5 | php5-cgi | php5, php5-cli, php5-imap, php5-mysql | php5-pgsql, mysql-client | postgresql-client, ${misc:Depends} +Depends: debconf (>= 0.5), dbconfig-common, wwwconfig-common, apache2 | lighttpd | httpd, libapache2-mod-php5 | php5-cgi | php5, php5-cli, php5-imap, php5-mysql | php5-mysqlnd | php5-pgsql, mysql-client | postgresql-client, ${misc:Depends} Recommends: postfix-mysql | postfix-pgsql, mysql-server | postgresql-server Suggests: dovecot-common | courier-authlib-mysql | courier-authlib-postgresql Description: Virtual mail hosting interface for Postfix