[Dovecot] Dovecot LDA and quota
Hi List,
I recently upgraded to Dovecot 1.1.3 on FreeBSD and got into trouble over the quotas. We implemented per-user quotas using
plugin { quota = maildir }
and
protocol lda { mail_plugins = quota }
We use a passwd-file userdb with extra fields, which used to be
quota=maildir:storage:<bytes>
which I changed to
quota_rule=*:bytes:<bytes>
What happens now is that deliver (the Dovecot LDA) only picks up the quotas set in the maildirsize file in the user's homedir. It doesn't pick up the quota set in the userdb.
Also, when I delete the maildirsize file, I doesn't get recreated by the LDA and quotas don't get checked at all.
Any ideas? I'd be very grateful for any pointers.
Cheers,
Jonas
On Tue, 2008-09-16 at 17:54 +0200, Jonas Christian wrote:
which I changed to
quota_rule=*:bytes:<bytes>
I guess you really have bytes=, not bytes:? Otherwise it should have logged an error.
What happens now is that deliver (the Dovecot LDA) only picks up the quotas set in the maildirsize file in the user's homedir. It doesn't pick up the quota set in the userdb.
Also, when I delete the maildirsize file, I doesn't get recreated by the LDA and quotas don't get checked at all.
Any ideas? I'd be very grateful for any pointers.
Set mail_debug=yes. What does it log when logging in?
Timo Sirainen schrieb:
On Tue, 2008-09-16 at 17:54 +0200, Jonas Christian wrote:
which I changed to
quota_rule=*:bytes:<bytes>
I guess you really have bytes=, not bytes:? Otherwise it should have logged an error.
Yeah, I put it correctly, sorry. Should have copied it straight from the file into the mail.
What happens now is that deliver (the Dovecot LDA) only picks up the quotas set in the maildirsize file in the user's homedir. It doesn't pick up the quota set in the userdb.
Also, when I delete the maildirsize file, I doesn't get recreated by the LDA and quotas don't get checked at all.
Any ideas? I'd be very grateful for any pointers.
Set mail_debug=yes. What does it log when logging in?
Ok, here are some logs. The first one is an IMAP login, the second and third are delivery attempts by the Dovecot LDA (deliver):
Sep 15 00:24:52 mailserver dovecot: auth(default): client in: AUTH 1 CRAM-MD5 service=imap secured lip=10.1.1.1 rip=212.0.138.106 lport=143 rport=60658 Sep 15 00:24:52 mailserver dovecot: auth(default): client out: CONT 1 PDQ2NDIxNzQ3Mzc3NDAwNTQuMTIyMTQ zMTA5MkB0ZG8tbWFpbDAyLmRtejExLmlzYy50b2RvLmRlPg== Sep 15 00:24:52 mailserver dovecot: auth(default): client in: CONT 1 a2FyaW4uemVpbGluZ2VyQGRibC5kZSA wZmM4OGViYzY4YzU5ZWY0MDhlMTZkMTZjMzA5ZmE5NA== Sep 15 00:24:52 mailserver dovecot: auth(default): passwd-file(spam@xxx.com,212.0.138.106): lookup: user=spam@xxx.com file=/var/vmail/config/passdb Sep 15 00:24:52 mailserver dovecot: auth(default): password(spam@xxx.com,212.0.138.106): Credential s: 23dfff7d8ebf062c839cc16a0cdded45785a804e988fdde376cd8608b8f72bfe Sep 15 00:24:52 mailserver dovecot: auth(default): client out: OK 1 user=spam@xxx.com Sep 15 00:24:52 mailserver dovecot: auth(default): master in: REQUEST 380864 15886 1 Sep 15 00:24:52 mailserver dovecot: auth(default): passwd-file(spam@xxx.com,212.0.138.106): lookup: user=spam@xxx.com file=/var/vmail/config/passdb Sep 15 00:24:52 mailserver dovecot: auth(default): master out: USER 380864 spam@xxx.com uid=100 5 gid=1005 home=/var/vmail/mailboxes/xxx.com/spam quota=maildir:bytes=20480000 Sep 15 00:24:52 mailserver dovecot: imap-login: Login: user=spam@xxx.com, method=CRAM-MD5, rip=212. 0.138.106, lip=10.1.1.1, TLS Sep 15 00:24:52 mailserver dovecot: IMAP(spam@xxx.com): Disconnected: Logged out bytes=34/330
Sep 15 00:13:47 mailserver dovecot: auth(default): master in: USER 1 spam@xxx.com service=deliver Sep 15 00:13:47 mailserver dovecot: auth(default): passwd-file(spam@xxx.com): lookup: user=spam@xxx.com file=/var/vmail/config/passdb Sep 15 00:13:47 mailserver dovecot: auth(default): master out: USER 1 spam@xxx.com uid=1005 gid=1005 home=/var/vmail/mailboxes/xxx.com/spam quota=maildir:bytes=20480000 Sep 15 00:13:47 mailserver deliver(spam@xxx.com): msgid=63883.dion@simon: save failed to INBOX: Quota exceeded Sep 15 00:13:47 mailserver deliver(spam@xxx.com): msgid=63883.dion@simon: rejected: Quota exceeded Sep 15 00:13:47 mailserver postfix/pickup[13790]: 77971A6C6C: uid=1005 from=<> Sep 15 00:13:47 mailserver postfix/pipe[13842]: 4BD7BA6C65: to=spam@xxx.com, relay=dovecot, delay=0.19, delays=0.12/0.01/0/0.06, dsn=2.0.0, status=sent (delivered via dovecot service)
Sep 16 15:13:17 mailserver deliver(spam@xxx.com): Loading modules from directory: /usr/local/lib/dovecot/lda Sep 16 15:13:17 mailserver deliver(spam@xxx.com): Module loaded: /usr/local/lib/dovecot/lda/lib10_quota_plugin.so Sep 16 15:13:17 mailserver deliver(spam@xxx.com): Module loaded: /usr/local/lib/dovecot/lda/lib90_cmusieve_plugin.so Sep 16 15:13:17 mailserver deliver(spam@xxx.com): auth input: spam@xxx.com Sep 16 15:13:17 mailserver deliver(spam@xxx.com): auth input: uid=1005 Sep 16 15:13:17 mailserver deliver(spam@xxx.com): auth input: gid=1005 Sep 16 15:13:17 mailserver deliver(spam@xxx.com): auth input: home=/var/vmail/mailboxes/xxx.com/spam Sep 16 15:13:17 mailserver deliver(spam@xxx.com): Quota root: name= backend=maildir args= Sep 16 15:13:17 mailserver deliver(spam@xxx.com): Namespace: type=private, prefix=INBOX., sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes Sep 16 15:13:17 mailserver deliver(spam@xxx.com): maildir: data=/var/vmail/mailboxes/xxx.com/spam Sep 16 15:13:17 mailserver deliver(spam@xxx.com): maildir++: root=/var/vmail/mailboxes/xxx.com/spam, index=, control=, inbox=/var/vmail/mailboxes/xxx.com/spam Sep 16 15:13:17 mailserver deliver(spam@xxx.com): cmusieve: /var/vmail/mailboxes/xxx.com/spam/.dovecot.sieve doesn't exist Sep 16 15:13:17 mailserver deliver(spam@xxx.com): msgid=000901c917fd$04f1263c$3690c4a2@hbjyxab: saved mail to INBOX
Thanks for your feedback.
Jonas
On Sep 23, 2008, at 1:07 PM, Jonas Christian wrote:
quota_rule=*:bytes:<bytes> ..
Sep 15 00:24:52 mailserver dovecot: auth(default): master out:
USER 380864 spam@xxx.com uid=100 5 gid=1005 home=/var/vmail/mailboxes/xxx.com/ spam quota=maildir:bytes=20480000
Says quota=maildir:bytes=20480000 here, no quota_rule..
Timo Sirainen schrieb:
On Sep 23, 2008, at 1:07 PM, Jonas Christian wrote:
quota_rule=*:bytes:<bytes> ..
Sep 15 00:24:52 mailserver dovecot: auth(default): master out: USER 380864 spam@xxx.com uid=100 5 gid=1005 home=/var/vmail/mailboxes/xxx.com/spam
quota=maildir:bytes=20480000Says quota=maildir:bytes=20480000 here, no quota_rule..
I'm sorry about that. I was sending the logs from last week when I was messing around with the configs quite a bit. This is the actual config from now:
spam@xxx.com:{PLAIN}<password>:1005:1005::/var/vmail/mailboxes/xxx.com/spam::quota_rule=*:bytes=20971520
There is no file named "maildirsize" in the mail directory. Now, logging in by IMAP I get:
Sep 23 12:18:24 mailserver dovecot: auth(default): client in: AUTH 1 CRAM-MD5 service=imap lip=<private ip> rip=<public ip> lport=143 rport=34763 Sep 23 12:18:24 mailserver dovecot: auth(default): client out: CONT 1 PDYzOTE1OTM5OTczNDY4NjAuMTIyMjE 2NTEwNEB0ZG8tbWFpbDAyLmRtejExLmlzYy50b2RvLmRlPg== Sep 23 12:18:25 mailserver dovecot: auth(default): client in: CONT<hidden> Sep 23 12:18:25 mailserver dovecot: auth(default): passwd-file(spam@xxx.com,<public ip>): lookup: user=spam@xxx.com file=/var/vmail/config/passdb Sep 23 12:18:25 mailserver dovecot: auth(default): client out: OK 1 user=spam@xxx.com quota_rule=*:bytes=20971520 Sep 23 12:18:25 mailserver dovecot: auth(default): master in: REQUEST 29 8740 1 Sep 23 12:18:25 mailserver dovecot: auth(default): passwd-file(spam@xxx.com,<public ip>): lookup: user=spam@xxx.com file=/var/vmail/config/passdb Sep 23 12:18:25 mailserver dovecot: auth(default): master out: USER 29 spam@xxx.com uid=1005 gid=1005 home=/var/vmail/mailboxes/xxx.com/spam Sep 23 12:18:25 mailserver dovecot: imap-login: Login: user=spam@xxx.com, method=CRAM-MD5, rip=<public ip>, lip=<private ip> Sep 23 12:18:25 mailserver dovecot: IMAP(spam@xxx.com): Loading modules from directory: /usr/local/lib/dovecot/imap Sep 23 12:18:25 mailserver dovecot: IMAP(spam@xxx.com): Module loaded: /usr/local/lib/dovecot/imap/lib10_quota_plugin.so Sep 23 12:18:25 mailserver dovecot: IMAP(spam@xxx.com): Module loaded: /usr/local/lib/dovecot/imap/lib11_imap_quota_plugin.so Sep 23 12:18:25 mailserver dovecot: IMAP(spam@xxx.com): Effective uid=1005, gid=1005, home=/var/vmail/mailboxes/xxx.com/spam Sep 23 12:18:25 mailserver dovecot: IMAP(spam@xxx.com): Quota root: name= backend=maildir args= Sep 23 12:18:25 mailserver dovecot: IMAP(spam@xxx.com): Namespace: type=private, prefix=INBOX., sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes Sep 23 12:18:25 mailserver dovecot: IMAP(spam@xxx.com): maildir: data=/var/vmail/mailboxes/xxx.com/spam Sep 23 12:18:25 mailserver dovecot: IMAP(spam@xxx.com): maildir++: root=/var/vmail/mailboxes/xxx.com/spam, index=, control=, inbox=/var/vmail/mailboxes/xxx.com/spam
-------- delivering a mail results in this ---------------- Sep 23 12:21:28 mailserver deliver(spam@xxx.com): Loading modules from directory: /usr/local/lib/dovecot/lda Sep 23 12:21:28 mailserver deliver(spam@xxx.com): Module loaded: /usr/local/lib/dovecot/lda/lib10_quota_plugin.so Sep 23 12:21:28 mailserver deliver(spam@xxx.com): Module loaded: /usr/local/lib/dovecot/lda/lib90_cmusieve_plugin.so Sep 23 12:21:28 mailserver dovecot: auth(default): master in: USER 1 spam@xxx.com service=deliver Sep 23 12:21:28 mailserver dovecot: auth(default): passwd-file(spam@xxx.com): lookup: user=spam@xxx.com file=/var/vmail/config/passdb Sep 23 12:21:28 mailserver deliver(spam@xxx.com): auth input: spam@xxx.com Sep 23 12:21:28 mailserver dovecot: auth(default): master out: USER 1 spam@xxx.com uid=1005 gid=1005 home=/var/vmail/mailboxes/xxx.com/spam Sep 23 12:21:28 mailserver deliver(spam@xxx.com): auth input: uid=1005 Sep 23 12:21:28 mailserver deliver(spam@xxx.com): auth input: gid=1005 Sep 23 12:21:28 mailserver deliver(spam@xxx.com): auth input: home=/var/vmail/mailboxes/xxx.com/spam Sep 23 12:21:28 mailserver deliver(spam@xxx.com): Quota root: name= backend=maildir args= Sep 23 12:21:28 mailserver deliver(spam@xxx.com): Namespace: type=private, prefix=INBOX., sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes Sep 23 12:21:28 mailserver deliver(spam@xxx.com): maildir: data=/var/vmail/mailboxes/xxx.com/spam Sep 23 12:21:28 mailserver deliver(spam@xxx.com): maildir++: root=/var/vmail/mailboxes/xxx.com/spam, index=, control=, inbox=/var/vmail/mailboxes/xxx.com/spam Sep 23 12:21:28 mailserver deliver(spam@xxx.com): cmusieve: /var/vmail/mailboxes/xxx.com/spam/.dovecot.sieve doesn't exist Sep 23 12:21:28 mailserver deliver(spam@xxx.com): msgid=20080923102128.1CC91A70FB@mailserver.isc.todo.de: saved mail to INBOX
Interestingly, I can see nothing about the quota rule in the deliver log although it appears in the IMAP log. I haven't the slightest idea why not.
Jonas
Timo Sirainen schrieb:
On Sep 23, 2008, at 1:28 PM, Jonas Christian wrote:
spam@xxx.com:{PLAIN}<password>:1005:1005::/var/vmail/mailboxes/xxx.com/spam::quota_rule=*:bytes=20971520
oh, right, userdb_quota_rule. Otherwise it's treated as a passdb field and sent to imap-login.
Wicked, that solved it! Do you mind if I add this to the Wiki?
Cheers,
Jonas
participants (3)
-
Charles Marcus
-
Jonas Christian
-
Timo Sirainen