[Dovecot] user_query and mail_plugins in database

Timo Sirainen tss at iki.fi
Mon May 16 17:09:49 EEST 2011


On Mon, 2011-05-16 at 15:49 +0200, Ralf Zimmermann wrote:

> Every protocol uses own mail_plugin definitions. So I create the
> following user_query:
> 
> user_query = SELECT LOWER(login) AS user,home,mail,5000 AS uid,5000 AS
> gid,CONCAT('*:storage=',quota_mb,'MB') AS quota_rule,acl_groups,case
> when '%s'='lda' then 'acl quota sieve' when '%s'='lmtp' then 'acl quota
> sieve' when '%s'='doveadm' then 'acl quota' when '%s'='sieve' then 'acl
> quota' else mail_plugins end as mail_plugins FROM virtual_users WHERE (
> login='%u' OR email='%u' ) AND enabled IS true;
> 
> Now the configuration works. Can I use a simpler solution to configure
> this functionality? 

Nope. Although you could probably hide much that query into an SQL
function. If you have some ideas how to simplify this let me know. :)




More information about the dovecot mailing list