[Dovecot] expire plugin + --exec-mail in 1.2.6 version
Nikita Koshikov
koshikov at gmail.com
Wed Oct 28 10:30:33 EET 2009
Hello list,
After upgrade to dovecot version 1.2.6 I have noticed some quota malfunctions(users become often overquota). Looking at logs closely I have found that quota value resets to general dovecot-config(
quota = maildir:Mailbox quota
quota_rule = *:storage=500M
quota_rule2 = Trash:storage=10%%
), after dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool.sh command. The problem that some users have their own quotas stored in ldap.
For example, user sr at domain.com have maildirsize before running expire-tool(1G value from ldap):
# head -2 /data/mail/domain.com/sr/data/maildirsize
10485760000S
836423205 8285
Then I run expire-tool with mail_debug enabled:
# /usr/sbin/dovecot --exec-mail ext /usr/libexec/dovecot/expire-tool.sh
Info: Loading modules from directory: /usr/lib/dovecot/imap
Info: Module loaded: /usr/lib/dovecot/imap/lib10_quota_plugin.so
Info: Module loaded: /usr/lib/dovecot/imap/lib11_trash_plugin.so
Info: Module loaded: /usr/lib/dovecot/imap/lib20_autocreate_plugin.so
Info: Module loaded: /usr/lib/dovecot/imap/lib20_expire_plugin.so
Info: Module loaded: /usr/lib/dovecot/imap/lib20_virtual_plugin.so
Info: Module loaded: /usr/lib/dovecot/imap/lib20_zlib_plugin.so
Info: Quota root: name=Mailbox quota backend=maildir args=
Info: Quota rule: root=Mailbox quota mailbox=* bytes=524288000 messages=0
Info: Quota rule: root=Mailbox quota mailbox=Trash bytes=52428800 (10%) messages=0
Info: Quota warning: bytes=471859200 (90%) messages=0 command=/etc/dovecot/plugins/quota_warning.sh 90
Info: expire: pattern=Trash type=expunge secs=2592000
Info: expire: pattern=Spam type=expunge secs=2592000
Info: auth input: uid=8
Info: auth input: gid=12
Info: auth input: home=/data/mail/domain.com/koshikov.n
Info: auth input: mail=maildir:~/data
Info: Namespace: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes
Info: maildir: data=~/data
Info: maildir++: root=/data/mail/domain.com/koshikov.n/data, index=, control=, inbox=/data/mail/domain.com/koshikov.n/data
Info: Namespace: type=private, prefix=Agromat/, sep=/, inbox=no, hidden=no, list=yes, subscriptions=no
Info: virtual: data=/var/mail/virtual:INDEX=MEMORY:LAYOUT=maildir++
Info: maildir++: root=/var/mail/virtual, index=, control=, inbox=
Info: Namespace : Using permissions from /data/mail/domain.com/koshikov.n/data: mode=0700 gid=-1
Info: trash plugin: Added 'Trash' with priority 1
Info: trash plugin: Added 'Spam' with priority 2
Info: koshikov.n at domain.com/Spam: seq=1 uid=1869: Expunge
Info: koshikov.n at domain.com/Spam: seq=2 uid=1870: Expunge
Info: koshikov.n at domain.com/Spam: seq=3 uid=1871: Expunge
Info: koshikov.n at domain.com/Spam: seq=4 uid=1872: Expunge
Info: koshikov.n at domain.com/Spam: seq=5 uid=1873: Expunge
Info: koshikov.n at domain.com/Spam: seq=6 uid=1874: Expunge
Info: koshikov.n at domain.com/Spam: seq=7 uid=1875: Expunge
Info: koshikov.n at domain.com/Spam: seq=8 uid=1876: Expunge
Info: koshikov.n at domain.com/Spam: seq=9 uid=1877: Expunge
Info: koshikov.n at domain.com/Spam: seq=10 uid=1878: Expunge
Info: koshikov.n at domain.com/Spam: seq=11 uid=1879: Expunge
Info: koshikov.n at domain.com/Spam: seq=12 uid=1880: Expunge
Info: koshikov.n at domain.com/Spam: timestamp 1256618680 (Tue Oct 27 06:44:40 2009) -> 1256716674 (Wed Oct 28 09:57:54 2009)
Info: auth input: uid=8
Info: auth input: gid=12
Info: auth input: home=/data/mail/domain.com/fsb
Info: auth input: mail=maildir:~/data
Info: Namespace: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes
Info: maildir: data=~/data
Info: maildir++: root=/data/mail/domain.com/fsb/data, index=, control=, inbox=/data/mail/domain.com/fsb/data
Info: Namespace: type=private, prefix=Agromat/, sep=/, inbox=no, hidden=no, list=yes, subscriptions=no
Info: virtual: data=/var/mail/virtual:INDEX=MEMORY:LAYOUT=maildir++
Info: maildir++: root=/var/mail/virtual, index=, control=, inbox=
Info: Namespace : Using permissions from /data/mail/domain.com/fsb/data: mode=0700 gid=-1
Info: trash plugin: Added 'Trash' with priority 1
Info: trash plugin: Added 'Spam' with priority 2
Info: fsb at domain.com/Trash: seq=1 uid=578: Expunge
Info: fsb at domain.com/Trash: seq=2 uid=579: Expunge
Info: fsb at domain.com/Trash: seq=3 uid=580: Expunge
Info: fsb at domain.com/Trash: seq=4 uid=581: Expunge
Info: fsb at domain.com/Trash: seq=5 uid=582: Expunge
Info: fsb at domain.com/Trash: seq=6 uid=583: Expunge
Info: fsb at domain.com/Trash: seq=7 uid=584: Expunge
Info: fsb at domain.com/Trash: seq=8 uid=585: Expunge
Info: fsb at domain.com/Trash: seq=9 uid=586: Expunge
Info: fsb at domain.com/Trash: seq=10 uid=587: Expunge
Info: fsb at domain.com/Trash: seq=11 uid=588: Expunge
Info: fsb at domain.com/Trash: seq=12 uid=589: Expunge
Info: fsb at domain.com/Trash: seq=13 uid=590: Expunge
Info: fsb at domain.com/Trash: timestamp 1256627284 (Tue Oct 27 09:08:04 2009) -> 1256732991 (Wed Oct 28 14:29:51 2009)
Info: auth input: uid=8
Info: auth input: gid=12
Info: auth input: home=/data/mail/domain.com/arsen
Info: auth input: mail=maildir:~/data
Info: Namespace: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes
Info: maildir: data=~/data
Info: maildir++: root=/data/mail/domain.com/arsen/data, index=, control=, inbox=/data/mail/domain.com/arsen/data
Info: Namespace: type=private, prefix=Agromat/, sep=/, inbox=no, hidden=no, list=yes, subscriptions=no
Info: virtual: data=/var/mail/virtual:INDEX=MEMORY:LAYOUT=maildir++
Info: maildir++: root=/var/mail/virtual, index=, control=, inbox=
Info: Namespace : Using permissions from /data/mail/domain.com/arsen/data: mode=0700 gid=-1
Info: trash plugin: Added 'Trash' with priority 1
Info: trash plugin: Added 'Spam' with priority 2
Info: arsen at domain.com/Trash: seq=1 uid=14: Expunge
Info: arsen at domain.com/Trash: seq=2 uid=15: Expunge
Info: arsen at domain.com/Trash: seq=3 uid=16: Expunge
Info: arsen at domain.com/Trash: seq=4 uid=17: Expunge
Info: arsen at domain.com/Trash: seq=5 uid=18: Expunge
Info: arsen at domain.com/Trash: seq=6 uid=19: Expunge
Info: arsen at domain.com/Trash: seq=7 uid=20: Expunge
Info: arsen at domain.com/Trash: seq=8 uid=21: Expunge
Info: arsen at domain.com/Trash: seq=9 uid=22: Expunge
Info: arsen at domain.com/Trash: seq=10 uid=23: Expunge
Info: arsen at domain.com/Trash: seq=11 uid=24: Expunge
Info: arsen at domain.com/Trash: timestamp 1256630371 (Tue Oct 27 09:59:31 2009) -> 1256733711 (Wed Oct 28 14:41:51 2009)
Info: auth input: uid=8
Info: auth input: gid=12
Info: auth input: home=/data/mail/domain.com/koshikov.n
Info: auth input: mail=maildir:~/data
Info: Namespace: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes
Info: maildir: data=~/data
Info: maildir++: root=/data/mail/domain.com/koshikov.n/data, index=, control=, inbox=/data/mail/domain.com/koshikov.n/data
Info: Namespace: type=private, prefix=Agromat/, sep=/, inbox=no, hidden=no, list=yes, subscriptions=no
Info: virtual: data=/var/mail/virtual:INDEX=MEMORY:LAYOUT=maildir++
Info: maildir++: root=/var/mail/virtual, index=, control=, inbox=
Info: Namespace : Using permissions from /data/mail/domain.com/koshikov.n/data: mode=0700 gid=-1
Info: trash plugin: Added 'Trash' with priority 1
Info: trash plugin: Added 'Spam' with priority 2
Info: koshikov.n at domain.com/Trash: seq=1 uid=2561: Expunge
Info: koshikov.n at domain.com/Trash: timestamp 1256709279 (Wed Oct 28 07:54:39 2009) -> 1256795118 (Thu Oct 29 07:45:18 2009)
Info: auth input: quota_rule=*:bytes=10485760000
Info: auth input: uid=8
Info: auth input: gid=12
Info: auth input: home=/data/mail/domain.com/sr
Info: auth input: mail=maildir:~/data
Info: Namespace: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes
Info: maildir: data=~/data
Info: maildir++: root=/data/mail/domain.com/sr/data, index=, control=, inbox=/data/mail/domain.com/sr/data
Info: Namespace: type=private, prefix=Agromat/, sep=/, inbox=no, hidden=no, list=yes, subscriptions=no
Info: virtual: data=/var/mail/virtual:INDEX=MEMORY:LAYOUT=maildir++
Info: maildir++: root=/var/mail/virtual, index=, control=, inbox=
Info: Namespace : Using permissions from /data/mail/domain.com/sr/data: mode=0700 gid=-1
Info: trash plugin: Added 'Trash' with priority 1
Info: trash plugin: Added 'Spam' with priority 2
Info: sr at domain.com/Spam: seq=1 uid=405: Expunge
Info: sr at domain.com/Spam: seq=2 uid=406: Expunge
Info: sr at domain.com/Spam: seq=3 uid=407: Expunge
Info: sr at domain.com/Spam: timestamp 1256710764 (Wed Oct 28 08:19:24 2009) -> 1256980000 (Sat Oct 31 11:06:40 2009)
Info: kolotilo.m at domain.com/Trash: stop, expire time in future: Wed Oct 28 10:27:41 2009
And after expire-tool ends it's stuff, user sr at domain.com have(512M from dovecot-config):
524288000SS
836423205 8285
As you can see - quota reset to default value.
In changes to version 1.2.6 I see
- dovecot --exec-mail was broken.
Is fixes to 1.2.6 touch userdb lookups from --exec-mail ? With 1.2.4 expire-tool works correct and I have no config changes to dovecot setup.
If dovecot -n output is needed, please let me know.
Thanks.
More information about the dovecot
mailing list