Re: [Dovecot] Can not Create Maildir using userdb sql
I dont think mail_location:/home/vmail/%d/%n/Maildir should be terminated with an / Because I've try to use the mail_location with userdb static, dovecot still able to create the directory anyway. OK, below are my dovecot-sql.conf
driver = mysql
connect = host=127.0.0.1 dbname=email user=xxxx password=xxxx
default_pass_scheme = PLAIN-MD5
password_query = SELECT email AS user, password, CONCAT('/home/vmail/%d/%n/', maildir) AS userdb_home, CONCAT('maildir:/home/vmail/%d/%n/', maildir) AS userdb_mail, 5000 AS userdb_uid, 5000 AS userdb_gid FROM view_users WHERE email = '%u';
user_query = SELECT '/home/vmail/%d/%n' AS home, '/home/vmail/%d/%n/Maildir' AS mail, 5000 AS uid, 5000 AS gid, CONCAT('maildir:storage=', ROUND(quota/1024)) AS quota FROM view_users WHERE email = '%u';
Kind Regards,
Henry Yonathan
"All successful communication is Hypnosis" - Milton H. Erickson
Belanja buku lewat internet, GRATIS ONGKOS KIRIM ke seluruh Indonesia. Kunjungi website http://www.bookoopedia.com.
Hipokuku.com - Cara Baru Isi Pulsa Lewat Internet. Kunjungi website http://www.hipokuku.com untuk informasi selengkapnya.
On Jan 12, 2009, at 8:38 PM, Henry Yonathan wrote:
password_query = SELECT email AS user, password, CONCAT('/home/vmail/ %d/%n/', maildir) AS userdb_home, CONCAT('maildir:/home/vmail/%d/ %n/', maildir) AS userdb_mail, 5000 AS userdb_uid, 5000 AS
userdb_gid FROM view_users WHERE email = '%u';
Here you're trying to use prefetch userdb by returning userdb_*
fields. But they're different than here:
user_query = SELECT '/home/vmail/%d/%n' AS home, '/home/vmail/%d/%n/ Maildir' AS mail, 5000 AS uid, 5000 AS gid,
CONCAT('maildir:storage=', ROUND(quota/1024)) AS quota FROM
view_users WHERE email = '%u';
They should contain the exact same values. Here userdb_mail isn't
prefixed with "maildir:", which is your main problem. Also here you're
specifying "quota" field but in password_query you're not specifying
userdb_quota at all.
passdb: driver: sql args: /etc/dovecot-sql.conf userdb: driver: sql args: /etc/dovecot-sql.conf
And finally you're not currently even using prefetch userdb so Dovecot
ignores all the userdb_* fields you're returning in password_query.
For enabling prefetch see http://wiki.dovecot.org/UserDatabase/Prefetch
participants (2)
-
Henry Yonathan
-
Timo Sirainen