From c7f0b83c0da6f807f5859d5d666c1dfd009019b9 Mon Sep 17 00:00:00 2001
From: tbrehm <t.brehm@ispconfig.org>
Date: Tue, 06 Nov 2012 10:11:11 -0500
Subject: [PATCH] Implemented: FS#2437 - iterate_query in dovecot-sql.conf is missing The query is added for reference and is commented out by default as it is not compatible with dovecot 1.2 and not required by ispconfig.

---
 install/tpl/opensuse_dovecot-sql.conf.master |    4 ++++
 install/tpl/debian6_dovecot-sql.conf.master  |    5 ++++-
 install/tpl/debian_dovecot-sql.conf.master   |    4 +++-
 install/tpl/fedora_dovecot-sql.conf.master   |    5 ++++-
 4 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/install/tpl/debian6_dovecot-sql.conf.master b/install/tpl/debian6_dovecot-sql.conf.master
index 30cb0fe..7d209fa 100644
--- a/install/tpl/debian6_dovecot-sql.conf.master
+++ b/install/tpl/debian6_dovecot-sql.conf.master
@@ -14,5 +14,8 @@
 default_pass_scheme = CRYPT
 
 password_query = SELECT password FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
-# user_query = SELECT email AS user, maildir AS home, CONCAT('*:storage=', quota , 'B') AS quota_rule FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
 user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n'
+
+# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
+# Do not enable it on Dovecot 1.x servers
+# iterate_query = SELECT email as user FROM mail_user
diff --git a/install/tpl/debian_dovecot-sql.conf.master b/install/tpl/debian_dovecot-sql.conf.master
index f8b103c..81874a7 100644
--- a/install/tpl/debian_dovecot-sql.conf.master
+++ b/install/tpl/debian_dovecot-sql.conf.master
@@ -121,7 +121,9 @@
 default_pass_scheme = CRYPT
 
 password_query = SELECT password FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
-# user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
 user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n'
 
+# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
+# Do not enable it on Dovecot 1.x servers
+# iterate_query = SELECT email as user FROM mail_user
 
diff --git a/install/tpl/fedora_dovecot-sql.conf.master b/install/tpl/fedora_dovecot-sql.conf.master
index fdfba48..7a5f491 100644
--- a/install/tpl/fedora_dovecot-sql.conf.master
+++ b/install/tpl/fedora_dovecot-sql.conf.master
@@ -134,5 +134,8 @@
 default_pass_scheme = CRYPT
 
 password_query = SELECT password FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
-# user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('maildir:storage=', floor(quota/1024)) AS quota, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
 user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n'
+
+# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
+# Do not enable it on Dovecot 1.x servers
+# iterate_query = SELECT email as user FROM mail_user
\ No newline at end of file
diff --git a/install/tpl/opensuse_dovecot-sql.conf.master b/install/tpl/opensuse_dovecot-sql.conf.master
index 159b94a..26615fe 100644
--- a/install/tpl/opensuse_dovecot-sql.conf.master
+++ b/install/tpl/opensuse_dovecot-sql.conf.master
@@ -135,3 +135,7 @@
 
 password_query = SELECT password FROM mail_user WHERE login = '%u' AND disable%Ls = 'n'
 user_query = SELECT email as user, maildir as home, CONCAT('maildir:', maildir, '/Maildir') as mail, uid, gid, CONCAT('*:storage=', quota, 'B') AS quota_rule, CONCAT(maildir, '/.sieve') as sieve FROM mail_user WHERE (login = '%u' OR email = '%u') AND disable%Ls = 'n'
+
+# The iterate_query is required for the doveadm command only and works only on dovecot 2 servers.
+# Do not enable it on Dovecot 1.x servers
+# iterate_query = SELECT email as user FROM mail_user

--
Gitblit v1.9.1