支持 Red Hat Enterprise Linux, CentOS, Scientific Linux, Debian, Ubuntu, FreeBSD, OpenBSD
您尚未登陆。 请选择登陆或是注册一个新账号。
iRedMail 开源邮件服务解决方案 » iRedMail 技术支持 » 关于 dovecot 的expire plugins
OK.
在 dovecot.conf 中启用 'mail_debug = yes' 参数,并设置 quota_warning 如下(为了方便测试,我设置了多个 quota_warning):
plugin {
quota_warning = storage=95%% /usr/bin/quota-warning.sh 95
quota_warning2 = storage=80%% /usr/bin/quota-warning.sh 80
quota_warning3 = storage=60%% /usr/bin/quota-warning.sh 60
quota_warning4 = storage=40%% /usr/bin/quota-warning.sh 40
}
重启启动 dovecot 服务,立刻可以在屏幕上看到以下内容:
IQuota warning: bytes=9961472 (95%) messages=0 (0%) command=/usr/bin/quota-warning.sh 95
IQuota warning: bytes=8388608 (80%) messages=0 (0%) command=/usr/bin/quota-warning.sh 80
IQuota warning: bytes=6291456 (60%) messages=0 (0%) command=/usr/bin/quota-warning.sh 60
IQuota warning: bytes=4194304 (40%) messages=0 (0%) command=/usr/bin/quota-warning.sh 40
这时候往用户的邮箱里发邮件,达到任意一个之后,sieve 的投递日志里会出现类似的记录:
deliver(www@a.cn): Oct 28 19:30:49 Info: Loading modules from directory: /usr/lib64/dovecot/lda
deliver(www@a.cn): Oct 28 19:30:49 Info: Module loaded: /usr/lib64/dovecot/lda/lib10_quota_plugin.so
deliver(www@a.cn): Oct 28 19:30:49 Info: Module loaded: /usr/lib64/dovecot/lda/lib20_expire_plugin.so
deliver(www@a.cn): Oct 28 19:30:49 Info: Module loaded: /usr/lib64/dovecot/lda/lib90_cmusieve_plugin.so
deliver(www@a.cn): Oct 28 19:30:49 Info: auth input: www@a.cn
deliver(www@a.cn): Oct 28 19:30:49 Info: auth input: home=/home/vmail
deliver(www@a.cn): Oct 28 19:30:49 Info: auth input: sieve_dir=/var/www/sieve/a.cn/www/
deliver(www@a.cn): Oct 28 19:30:49 Info: auth input: quota_rule=*:bytes=10485760
deliver(www@a.cn): Oct 28 19:30:49 Info: auth input: maildir=a.cn/www/
deliver(www@a.cn): Oct 28 19:30:49 Info: Quota root: name= backend=maildir args=
deliver(www@a.cn): Oct 28 19:30:49 Info: Quota rule: root= mailbox=* bytes=10485760 (0%) messages=0 (0%)
deliver(www@a.cn): Oct 28 19:30:49 Info: Quota warning: bytes=9961472 (95%) messages=0 (0%) command=/usr/bin/quota-warning.sh 95
deliver(www@a.cn): Oct 28 19:30:49 Info: Quota warning: bytes=8388608 (80%) messages=0 (0%) command=/usr/bin/quota-warning.sh 80
deliver(www@a.cn): Oct 28 19:30:49 Info: Quota warning: bytes=6291456 (60%) messages=0 (0%) command=/usr/bin/quota-warning.sh 60
deliver(www@a.cn): Oct 28 19:30:49 Info: Quota warning: bytes=4194304 (40%) messages=0 (0%) command=/usr/bin/quota-warning.sh 40
deliver(www@a.cn): Oct 28 19:30:49 Info: maildir: data=//home/vmail/a.cn/www/:INDEX=//home/vmail/a.cn/www/
deliver(www@a.cn): Oct 28 19:30:49 Info: maildir++: root=//home/vmail/a.cn/www, index=, control=, inbox=//home/vmail/a.cn/www
deliver(www@a.cn): Oct 28 19:30:49 Info: cmusieve: /var/www/sieve/a.cn/www/.dovecot.sieve doesn't exist
deliver(www@a.cn): Oct 28 19:30:49 Info: cmusieve: Using sieve path: /home/vmail/.dovecot.sieve
deliver(www@a.cn): Oct 28 19:30:49 Info: cmusieve: Script not found: /home/vmail/.dovecot.sieve
deliver(www@a.cn): Oct 28 19:30:49 Info: msgid=: saved mail to INBOX
deliver(www@a.cn): Oct 28 19:30:49 Info: msgid=<92147a1047ac6d99f9bc0cdb5467421b@127.0.0.1>: saved mail to INBOX
在 /var/log/dovecot.log 里的日志如下:
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Disconnected: Logged out bytes=365/1806
dovecot: Oct 28 19:31:08 Info: imap-login: Login: user=<www@a.cn>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Loading modules from directory: /usr/lib64/dovecot/imap
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Module loaded: /usr/lib64/dovecot/imap/lib10_quota_plugin.so
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Module loaded: /usr/lib64/dovecot/imap/lib11_imap_quota_plugin.so
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Module loaded: /usr/lib64/dovecot/imap/lib20_expire_plugin.so
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Module loaded: /usr/lib64/dovecot/imap/lib20_zlib_plugin.so
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Effective uid=2000, gid=2000, home=/home/vmail
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Quota root: name= backend=maildir args=
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Quota rule: root= mailbox=* bytes=10485760 (0%) messages=0 (0%)
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Quota warning: bytes=9961472 (95%) messages=0 (0%) command=/usr/bin/quota-warning.sh 95
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Quota warning: bytes=8388608 (80%) messages=0 (0%) command=/usr/bin/quota-warning.sh 80
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Quota warning: bytes=6291456 (60%) messages=0 (0%) command=/usr/bin/quota-warning.sh 60
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Quota warning: bytes=4194304 (40%) messages=0 (0%) command=/usr/bin/quota-warning.sh 40
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): maildir: data=//home/vmail/a.cn/www/:INDEX=//home/vmail/a.cn/www/
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): maildir++: root=//home/vmail/a.cn/www, index=, control=, inbox=//home/vmail/a.cn/www
dovecot: Oct 28 19:31:08 Info: IMAP(www@a.cn): Disconnected: Logged out bytes=23/104
已经触发,并且发送了邮件出去了。
在上面贴的 sieve.log 的日志里,倒数第二行就是:
deliver(www@a.cn): Oct 28 19:30:49 Info: msgid=: saved mail to INBOX
msgid 为空,是因为它不经过 Postfix,直接有 deliver 程序生成。
最直接的证明就是用户已经收到 quota_warning 发送的邮件通知了。
汗,昨晚为了测试 LDAP backend,重装了系统 :L
你先试试用 bdb 测试以下,不用 mysql。:)
:lol
生效了就好
iRedMail 开源邮件服务解决方案 » iRedMail 技术支持 » 关于 dovecot 的expire plugins
Powered by PunBB, supported by Informer Technologies, Inc.
Currently installed 3 official extensions. Copyright © 2003–2010 PunBB.
页面生成时间 0.018 秒, 共执行查询 59 条