[Dovecot] Per user mail quota via LDAP
Hello all.
Ok im now trying to make per user quota via LDAP. In LDAP im have attr: mailQuotaSize=210
Default dovecot quota=201M
I edit my static db to this(from wiki): userdb static { args = uid=1002 gid=1002 home=/var/spool/dovecot/domains/%d/%n mailQuotaSize=quota_rule=*:storage=%$M }
But in logs I see this:
Info: auth(default): master out: USER 5 sysadmin@domain.off uid=1002 gid=1002 home=/var/spool/dovecot/domains/domain.off/sysadmin mailQuotaSize=quota_rule=*:storage=M
And personal quota not work.
What I do wrong?
-- Best regards, Proskurin Kirill
On Mon, 2008-10-20 at 19:42 +0400, Proskurin Kirill wrote:
Hello all.
Ok im now trying to make per user quota via LDAP.
OK.
In LDAP im have attr: mailQuotaSize=210
Default dovecot quota=201M
I edit my static db to this(from wiki):
You need to use userdb ldap then.
Timo Sirainen wrote:
I edit my static db to this(from wiki): You need to use userdb ldap then.
I actual use it and it work well.
# LDAP database
# grep -v # /usr/local/etc/dovecot-ldap.conf | egrep -v '^$' hosts = 127.0.0.1 dn = cn=root,dc=CAS dnpass = secret tls = no auth_bind = no ldap_version = 3 base = dc=CAS deref = never scope = subtree user_filter = (&(objectClass=mailUser)(mail=%u)) pass_attrs = userPassword=password pass_filter = (&(objectClass=mailUser)(mail=%u)) default_pass_scheme = CRYPT
You mean what i must edit dovecot-ldap.conf user db?
I try to add this in dovecot-ldap.conf: user_attrs = mailQuotaSize=quota_rule=*:storage=%$M
But with with same result.
-- Best regards, Proskurin Kirill
On Oct 20, 2008, at 7:27 PM, Proskurin Kirill wrote:
Timo Sirainen wrote:
I edit my static db to this(from wiki): You need to use userdb ldap then.
I actual use it and it work well.
But do you now have both static and ldap userdb? You can only use one
(for one user). If you've static userdb defined before ldap userdb,
it's used always and ldap userdb is ignored.
I try to add this in dovecot-ldap.conf: user_attrs = mailQuotaSize=quota_rule=*:storage=%$M
That looks correct. You'll also need to put the other stuff in your
current static userdb elsewhere (mail_uid, mail_gid, mail_location for
uid/gid/mail and for home you could user ldap attribute templates, see http://wiki.dovecot.org/AuthDatabase/LDAP)
.
Timo Sirainen wrote:
On Oct 20, 2008, at 7:27 PM, Proskurin Kirill wrote:
Timo Sirainen wrote:
I edit my static db to this(from wiki): You need to use userdb ldap then.
I actual use it and it work well.
But do you now have both static and ldap userdb? You can only use one (for one user). If you've static userdb defined before ldap userdb, it's used always and ldap userdb is ignored.
I try to add this in dovecot-ldap.conf: user_attrs = mailQuotaSize=quota_rule=*:storage=%$M
That looks correct. You'll also need to put the other stuff in your current static userdb elsewhere (mail_uid, mail_gid, mail_location for uid/gid/mail and for home you could user ldap attribute templates, see http://wiki.dovecot.org/AuthDatabase/LDAP).
Understand. Sad. I don`y really need to add same uid\gid to all LDAP account but I need personal LDAP quota.
No way to avoid this?..
-- Best regards, Proskurin Kirill
On Oct 20, 2008, at 7:37 PM, Proskurin Kirill wrote:
Timo Sirainen wrote:
On Oct 20, 2008, at 7:27 PM, Proskurin Kirill wrote:
Timo Sirainen wrote:
I edit my static db to this(from wiki): You need to use userdb ldap then.
I actual use it and it work well. But do you now have both static and ldap userdb? You can only use
one (for one user). If you've static userdb defined before ldap
userdb, it's used always and ldap userdb is ignored. I try to add this in dovecot-ldap.conf: user_attrs = mailQuotaSize=quota_rule=*:storage=%$M That looks correct. You'll also need to put the other stuff in your
current static userdb elsewhere (mail_uid, mail_gid, mail_location
for uid/gid/mail and for home you could user ldap attribute
templates, see http://wiki.dovecot.org/AuthDatabase/LDAP).Understand. Sad. I don`y really need to add same uid\gid to all LDAP
account but I need personal LDAP quota.No way to avoid this?..
By mail_uid, mail_gid and mail_location I meant the settings in
dovecot.conf. And by "attribute templates" I also didn't mean adding a
new field but kind of kludging around with the user_attrs syntax. So
you don't need to add any more fields to LDAP.
Timo Sirainen wrote:
By mail_uid, mail_gid and mail_location I meant the settings in dovecot.conf. And by "attribute templates" I also didn't mean adding a new field but kind of kludging around with the user_attrs syntax. So you don't need to add any more fields to LDAP.
Oh - then i last time read http://wiki.dovecot.org/AuthDatabase/LDAP I don`t see this example of mixing static and dynamic LDAP. I edit user_attrs to this:
user_attrs = mailQuotaSize=quota_rule=*:storage=%$M ,=uid=1002,=gid=1002,=home=/var/spool/dovecot/domains/%d/%n
And it is work! Thank you Timo. Ans sorry for wasting your time.
Could you answer last one question about quotas.I ask it in http://www.dovecot.org/list/dovecot/2008-October/034431.html
If make it short:
I don`t understand how quota warning script is work. In examples i see this:
#!/bin/bash PERCENT=$1 echo "Your mailbox is now $PERCENT% full." | /usr/sbin/sendmail "$USER"
Its work - but mail have "mail from" header of my dovecot system user. I want send this from "postmaster" for example. How can i do this? What $USER mean? As I understand it is a system env what mean current loged user. As I understand right - dovecot put were a overquoted user?
I try to edit it to this:
/usr/bin/mail -s test "$USER" -f postmaster@domain.off
But it is still have "mail from" of my system dovecot user.
-- Best regards, Proskurin Kirill
participants (2)
-
Proskurin Kirill
-
Timo Sirainen