From ae8cd4efdf1f47c9d39b56566440f3fd5077a1fd Mon Sep 17 00:00:00 2001 From: Joshua Tauberer Date: Sun, 24 Apr 2016 18:46:37 -0400 Subject: [PATCH] support 'dovecot -A' iteration of all users --- setup/mail-users.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup/mail-users.sh b/setup/mail-users.sh index e312983e..f9cbdbe5 100755 --- a/setup/mail-users.sh +++ b/setup/mail-users.sh @@ -38,17 +38,19 @@ passdb { args = /etc/dovecot/dovecot-sql.conf.ext } userdb { - driver = static - args = uid=mail gid=mail home=$STORAGE_ROOT/mail/mailboxes/%d/%n + driver = sql + args = /etc/dovecot/dovecot-sql.conf.ext } EOF -# Configure the SQL to query for a user's password. +# Configure the SQL to query for a user's metadata and password. cat > /etc/dovecot/dovecot-sql.conf.ext << EOF; driver = sqlite connect = $db_path default_pass_scheme = SHA512-CRYPT password_query = SELECT email as user, password FROM users WHERE email='%u'; +user_query = SELECT email AS user, "mail" as uid, "mail" as gid, "$STORAGE_ROOT/mail/mailboxes/%d/%n" as home FROM users; +iterate_query = SELECT email AS user FROM users; EOF chmod 0600 /etc/dovecot/dovecot-sql.conf.ext # per Dovecot instructions