Dear all,

I'm migrating from Dovecot 2.3 to 2.4 on Debian 13, only one issue remains:
How can i override global mail_driver, mail_path, mail_index_path parameters
with a SQL userdb?

I have these lines in dovecot.conf to use maildir format mailbox by default, 
also
userdb and passdb with mariadb backend. We store mailbox format (e.g.
"maildir", "mdbox", case insensitive) in SQL column `mailboxformat`, and
mailbox folder name in `mailboxfolder` (e.g. "Maildir", "mdbox", case 
sensitive).

I tried returning `mail_driver` + `mail_path`, or `userdb_mail_driver` +
`userdb_mail_path`, neither works.

So the question is, what should i return in userdb sql query to override global 
setting?

Thanks for helping. :)

# -------------------------------
mail_driver = maildir
mail_path = ~/Maildir
mail_index_path = ~/Maildir

sql_driver = mysql
mysql 127.0.0.1 {
    port = 3306
    dbname = ...
    user = ...
    password = ...
}

userdb sql {
    iterate_query = ...
    query = SELECT \
            LOWER('%{user | lower}') AS master_user, \
            LOWER(CONCAT(mailbox.storagebasedirectory, '/', 
mailbox.storagenode, '/', mailbox.maildir)) AS home, \
            LOWER(mailbox.mailboxformat) AS mail_driver, \
            CONCAT("~/", mailbox.mailboxfolder) AS mail_path, \
            CONCAT(LOWER(mailbox.mailboxformat), ":~/", mailbox.mailboxfolder) 
AS mail, \
            CONCAT('*:bytes=', mailbox.quota*1048576) AS quota_rule \
        FROM mailbox,domain \
       WHERE ...
}

passdb sql {
    query = SELECT ...
}
# -------------------------------



_______________________________________________
dovecot mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to