[Dovecot] user_query and mail_plugins in database
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi all,
I have a problem with mail_plugins in dovecot-2.0.x. I will use mail_plugins within a database, so that I can define plugins for users in the database.
But I get errors like this.
- -----------------------------%<------------------------------------ lmtp(3933): Error: Can't load plugin imap_quota_plugin: Plugin is intended to be used only by imap binary (we're lmtp)
- -----------------------------%<-------------------------------------
Here my options from the configuration:
- -----------------------------%<------------------------------------- mail_plugins = " acl quota" protocol lmtp { mail_plugins = " acl quota sieve" } protocol lda { mail_plugins = " acl quota sieve" } protocol imap { mail_plugins = " acl quota imap_quota imap_acl autocreate" }
- -----------------------------%<--------------------------------------
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?
Ralf -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux)
iQEcBAEBAgAGBQJN0StGAAoJENVjhbwuX+/HyPQH/2hTa5k32Y1WIhVLpRtPudLr qPnk29rN4Gz+6GGwK9M6X3Shkgx1mdGEwZwzEkV/QAURgk+8k90uN+Od1gqKtLer dMhUJPJjeZbRmcxthA/fNKuAHiGCQsYSiCle0603iFq8HwG5QfWvf+IqkUuo/MzI 9bX9xBJGW40M/wAisiRLj03Y+PWe101YL3iKXbDYVuzFpMeJ3WkUoJ378ujGWyaH zjEf5sYACf9jVx6wAsthwaXheRwyxXhcQOrBldOun+rh+l809iD5ivogBrbd3o/G Uuli0LlS8b5tOXZfxIqFmVCt/1Ebo1oD/vHc9yZo1eLSqpuPZGc3qiDPP/JCMY4= =YhpJ -----END PGP SIGNATURE-----
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. :)
participants (2)
-
Ralf Zimmermann
-
Timo Sirainen