[Dovecot] Quota Override
Hi People
I use the dovecot version 1.0.10 , in my config I have set a global quota value = 10 MB but I want to override for some users this value , getting from my ldap other value like = 30 MB.
Dovecot obtain this value from ldap:
(((((Feb 1 12:12:26 gandalf dovecot: auth(default): client out: OK 1
user=michel@home.com quota= maildir:storage=30240)))))
Feb 1 12:12:26 gandalf dovecot: auth(default):
ldap(michel@home.com,127.0.0.1): result: mail(user)=michel@home.com
quota(quota= maildir:storage)=30240
Feb 1 12:12:26 gandalf dovecot: auth(default):
ldap(michel@home.com,127.0.0.1): bind: dn=CN=Usuario
Michel,OU=Computacion,OU=Home,DC=home,DC=com
Feb 1 12:12:26 gandalf dovecot: auth(default): client out: OK 1
user=michel@home.com quota= maildir:storage=30240
Feb 1 12:12:26 gandalf dovecot: auth(default): master in: REQUEST 1
27697 1
Feb 1 12:12:26 gandalf dovecot: pop3-login: Login: user=<michel@home.com>,
method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
Feb 1 12:12:26 gandalf dovecot: auth(default): master out: USER 1
michel@home.com uid=503 gid=503 home=/var/storage/virtualmail/home.com/
Feb 1 12:12:26 gandalf dovecot: POP3(michel@home.com): Loading modules from
directory: /usr/lib64/dovecot/pop3
Feb 1 12:12:26 gandalf dovecot: POP3(michel@home.com): Module
loaded: /usr/lib64/dovecot/pop3/lib10_quota_plugin.so
Feb 1 12:12:26 gandalf dovecot: POP3(michel@home.com): Effective uid=503,
gid=503
Feb 1 12:12:26 gandalf dovecot: POP3(michel@home.com): maildir:
data=/var/storage/virtualmail/home.com/michel
Feb 1 12:12:26 gandalf dovecot: POP3(michel@home.com): maildir:
root=/var/storage/virtualmail/home.com/michel,
index=/var/storage/virtualmail/home.com/michel, control=, inbox=
but not override the global quota set in dovecot.conf = 10 MB
my dovecot.conf # 1.0.10: /etc/dovecot.conf listen: * login_dir: /var/run/dovecot/login login_executable(default): /usr/libexec/dovecot/imap-login login_executable(imap): /usr/libexec/dovecot/imap-login login_executable(pop3): /usr/libexec/dovecot/pop3-login mail_location: maildir:/var/storage/virtualmail/%d/%n mail_debug: yes mail_executable(default): /usr/libexec/dovecot/imap mail_executable(imap): /usr/libexec/dovecot/imap mail_executable(pop3): /usr/libexec/dovecot/pop3 mail_plugins(default): quota imap_quota mail_plugins(imap): quota imap_quota mail_plugins(pop3): quota mail_plugin_dir(default): /usr/lib64/dovecot/imap mail_plugin_dir(imap): /usr/lib64/dovecot/imap mail_plugin_dir(pop3): /usr/lib64/dovecot/pop3 auth default: verbose: yes debug: yes passdb: driver: ldap args: /etc/dovecot-ldap.conf userdb: driver: static args: uid=virtualmail gid=virtualmail home=/var/storage/virtualmail/%d/ userdb: driver: ldap args: /etc/dovecot-ldap.conf userdb: driver: prefetch socket: type: listen master: path: /var/run/dovecot/auth-master mode: 384 user: virtualmail plugin: quota: maildir:storage=10240
dovecot-ldap.conf user_attrs = mail=user,MailQuota=quota= maildir:storage
Suggestions?
Thanks
Or actually..
On Fri, 2008-02-01 at 13:40 -0500, Michel Bulgado wrote:
ldap(michel@home.com,127.0.0.1): result: mail(user)=michel@home.com quota(quota= maildir:storage)=30240
This is a reply to passdb lookup. quota shouldn't be in here, it just gets ignored.
Feb 1 12:12:26 gandalf dovecot: auth(default): master out: USER 1
michel@home.com uid=503 gid=503 home=/var/storage/virtualmail/home.com/
This is a userdb lookup. Here's where the quota should be in.
passdb: driver: ldap args: /etc/dovecot-ldap.conf userdb: driver: static args: uid=virtualmail gid=virtualmail home=/var/storage/virtualmail/%d/
You can't use static userdb, because you want a per-user quota. First try to get it working by removing it and letting Dovecot use userdb ldap.
userdb: driver: ldap args: /etc/dovecot-ldap.conf userdb: driver: prefetch
Once it works, move this prefetch before userdb ldap so it actually gets used, and set all userdb_* fields properly in pass_attrs so it works.
Timo
I have solved the problem thanks to your help
Thanks again
Or actually..
On Fri, 2008-02-01 at 13:40 -0500, Michel Bulgado wrote:
ldap(michel@home.com,127.0.0.1): result: mail(user)=michel@home.com quota(quota= maildir:storage)=30240
This is a reply to passdb lookup. quota shouldn't be in here, it just gets ignored.
Feb 1 12:12:26 gandalf dovecot: auth(default): master out: USER 1 michel@home.com uid=503 gid=503
home=/var/storage/virtualmail/home.com/This is a userdb lookup. Here's where the quota should be in.
passdb: driver: ldap args: /etc/dovecot-ldap.conf userdb: driver: static args: uid=virtualmail gid=virtualmail home=/var/storage/virtualmail/%d/
You can't use static userdb, because you want a per-user quota. First try to get it working by removing it and letting Dovecot use userdb ldap.
userdb: driver: ldap args: /etc/dovecot-ldap.conf userdb: driver: prefetch
Once it works, move this prefetch before userdb ldap so it actually gets used, and set all userdb_* fields properly in pass_attrs so it works.
This message was sent using IMP, the Internet Messaging Program.
participants (2)
-
Michel Bulgado
-
Timo Sirainen