[Dovecot] quota warning issue
Hello to all, I'm using version 1.1.11 of dovecot. I set the quota using the following configuration:
in /etc/dovecot/dovecot.conf
quota = maildir:%u quota_warning = storage=75%% /root/quota-warning.sh 75 %u
in /etc/dovecot/dovecot-sql.conf
user_query = SELECT concat('/var/vmail/', maildir) as home, concat('maildir:/var/vmail/', maildir) as mail, 1000 AS uid, 12 AS gid, concat('*:storage=', ROUND(quota/1000)) AS quota_rule FROM mailbox WHERE username = '%u' AND active = '1' ## password_query = SELECT username as user, password, concat('/var/vmail/', maildir) as home, concat('maildir:/var/vmail/', maildir) as mail, 1000 AS uid, 12 AS gid, concat('*:storage=', ROUND(quota/1000)) AS quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
# 1.1.11: /etc/dovecot/dovecot.conf # OS: Linux 2.6.25-hardened-r11 x86_64 Gentoo base_dir: /var/run/dovecot/ log_path: /var/log/mail.log info_log_path: /var/log/mail.log protocols: imap imaps pop3 pop3s listen(default): *:143 listen(imap): *:143 listen(pop3): *:110 ssl_listen(default): *:993 ssl_listen(imap): *:993 ssl_listen(pop3): *:995 disable_plaintext_auth: no 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 first_valid_uid: 1000 last_valid_uid: 1000 mail_location: maildir:/var/vmail/%d/%u 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 imap_client_workarounds(default): outlook-idle delay-newmail imap_client_workarounds(imap): outlook-idle delay-newmail imap_client_workarounds(pop3): pop3_uidl_format(default): %08Xu%08Xv pop3_uidl_format(imap): %08Xu%08Xv pop3_uidl_format(pop3): %v.%u pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh auth default: user: nobody verbose: yes passdb: driver: sql args: /etc/dovecot/dovecot-sql.conf userdb: driver: sql args: /etc/dovecot/dovecot-sql.conf userdb: driver: prefetch socket: type: listen client: path: /var/spool/postfix/private/auth mode: 432 user: postfix group: mail master: path: /var/run/dovecot/auth-master mode: 384 user: vmail group: mail plugin: quota: maildir:%u quota_warning: storage=75%% /root/quota-warning.sh 75 %u sieve: /var/vmail/%d/%n/.dovecot.sieve
The warning is not delivered to users. In my logs the user quota's percentage is calculated right
dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Loading modules from directory: /usr/lib64/dovecot/imap dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Module loaded: /usr/lib64/dovecot/imap/lib10_quota_plugin.so dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Module loaded: /usr/lib64/dovecot/imap/lib11_imap_quota_plugin.so dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Effective uid=1000, gid=12, home=/var/vmail/foo.org/alex/ dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Quota root: name=alex@foo.org backend=maildir args= dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Quota rule: root=alex@foo.org mailbox=* bytes=52428800 messages=0 dovecot: Feb 15 23:42:33 Info: imap-login: Login: user=alex@foo.org, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Quota warning: bytes=39321600 (75%) messages=0 command=/root/quota-warning.sh 75 alex@foo.org
but also overcoming the space defined on quota warning, the command is not performed. The command does not contain errors because if performed by cli correctly sends the alert. Any ideas?
Regards.
Alex
permissions...
/root/quota-warning.sh
User vmail does not get access to this directory put it in /usr/local/bin chown vmail quota-warning*
On Mon, 2009-02-16 at 08:53, Alex wrote:
Hello to all, I'm using version 1.1.11 of dovecot. I set the quota using the following configuration:
in /etc/dovecot/dovecot.conf
quota = maildir:%u quota_warning = storage=75%% /root/quota-warning.sh 75 %u
in /etc/dovecot/dovecot-sql.conf
user_query = SELECT concat('/var/vmail/', maildir) as home, concat('maildir:/var/vmail/', maildir) as mail, 1000 AS uid, 12 AS gid, concat('*:storage=', ROUND(quota/1000)) AS quota_rule FROM mailbox WHERE username = '%u' AND active = '1' ## password_query = SELECT username as user, password, concat('/var/vmail/', maildir) as home, concat('maildir:/var/vmail/', maildir) as mail, 1000 AS uid, 12 AS gid, concat('*:storage=', ROUND(quota/1000)) AS quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
# 1.1.11: /etc/dovecot/dovecot.conf # OS: Linux 2.6.25-hardened-r11 x86_64 Gentoo base_dir: /var/run/dovecot/ log_path: /var/log/mail.log info_log_path: /var/log/mail.log protocols: imap imaps pop3 pop3s listen(default): *:143 listen(imap): *:143 listen(pop3): *:110 ssl_listen(default): *:993 ssl_listen(imap): *:993 ssl_listen(pop3): *:995 disable_plaintext_auth: no 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 first_valid_uid: 1000 last_valid_uid: 1000 mail_location: maildir:/var/vmail/%d/%u 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 imap_client_workarounds(default): outlook-idle delay-newmail imap_client_workarounds(imap): outlook-idle delay-newmail imap_client_workarounds(pop3): pop3_uidl_format(default): %08Xu%08Xv pop3_uidl_format(imap): %08Xu%08Xv pop3_uidl_format(pop3): %v.%u pop3_client_workarounds(default): pop3_client_workarounds(imap): pop3_client_workarounds(pop3): outlook-no-nuls oe-ns-eoh auth default: user: nobody verbose: yes passdb: driver: sql args: /etc/dovecot/dovecot-sql.conf userdb: driver: sql args: /etc/dovecot/dovecot-sql.conf userdb: driver: prefetch socket: type: listen client: path: /var/spool/postfix/private/auth mode: 432 user: postfix group: mail master: path: /var/run/dovecot/auth-master mode: 384 user: vmail group: mail plugin: quota: maildir:%u quota_warning: storage=75%% /root/quota-warning.sh 75 %u sieve: /var/vmail/%d/%n/.dovecot.sieve
The warning is not delivered to users. In my logs the user quota's percentage is calculated right
dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Loading modules from directory: /usr/lib64/dovecot/imap dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Module loaded: /usr/lib64/dovecot/imap/lib10_quota_plugin.so dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Module loaded: /usr/lib64/dovecot/imap/lib11_imap_quota_plugin.so dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Effective uid=1000, gid=12, home=/var/vmail/foo.org/alex/ dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Quota root: name=alex@foo.org backend=maildir args= dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Quota rule: root=alex@foo.org mailbox=* bytes=52428800 messages=0 dovecot: Feb 15 23:42:33 Info: imap-login: Login: user=alex@foo.org, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured dovecot: Feb 15 23:42:33 Info: IMAP(alex@foo.org): Quota warning: bytes=39321600 (75%) messages=0 command=/root/quota-warning.sh 75 alex@foo.org
but also overcoming the space defined on quota warning, the command is not performed. The command does not contain errors because if performed by cli correctly sends the alert. Any ideas?
Regards.
Alex
On Sun, 2009-02-15 at 23:53 +0100, Alex wrote:
quota: maildir:%u quota_warning: storage=75%% /root/quota-warning.sh 75 %u sieve: /var/vmail/%d/%n/.dovecot.sieve
The warning is not delivered to users.
Are you testing it correctly? Like http://wiki.dovecot.org/Quota/1.1 says:
Note that the warning is ONLY executed at the exact time when the limit is being crossed, so when you're testing it you have to do it by crossing the limit by saving a new mail. If something else besides Dovecot updates quota so that the limit is crossed, the warning is never executed.
Timo Sirainen wrote:
On Sun, 2009-02-15 at 23:53 +0100, Alex wrote:
quota: maildir:%u quota_warning: storage=75%% /root/quota-warning.sh 75 %u sieve: /var/vmail/%d/%n/.dovecot.sieve
The warning is not delivered to users.
Are you testing it correctly? Like http://wiki.dovecot.org/Quota/1.1 says:
Note that the warning is ONLY executed at the exact time when the limit is being crossed, so when you're testing it you have to do it by crossing the limit by saving a new mail. If something else besides Dovecot updates quota so that the limit is crossed, the warning is never executed.
Yes I do. I leave my mailbox quota to 70% and I sent an email with an attachment that cross my 75% limit and also moved quota-warning script from root to /usr/local/bin and give vmail ownership.
Nothing to do for me :(
Is there something wrong in my config?
Thanks.
On Mon, 2009-02-16 at 00:13 +0100, Alex wrote:
Are you testing it correctly? Like http://wiki.dovecot.org/Quota/1.1 says: .. Yes I do. I leave my mailbox quota to 70% and I sent an email with an attachment that cross my 75% limit and also moved quota-warning script from root to /usr/local/bin and give vmail ownership.
Nothing to do for me :(
Is there something wrong in my config?
Your debug output was from imap, but you're crossing the quota from deliver. What does deliver log with mail_debug=yes when crossing the quota?
Timo Sirainen wrote:
On Mon, 2009-02-16 at 00:13 +0100, Alex wrote:
Are you testing it correctly? Like http://wiki.dovecot.org/Quota/1.1 says: .. Yes I do. I leave my mailbox quota to 70% and I sent an email with an attachment that cross my 75% limit and also moved quota-warning script from root to /usr/local/bin and give vmail ownership.
Nothing to do for me :(
Is there something wrong in my config?
Your debug output was from imap, but you're crossing the quota from deliver. What does deliver log with mail_debug=yes when crossing the quota?
this from dovocot-deliver.log with mail_debug=yes:
deliver(alex@foo.org): Feb 16 00:10:31 Info: Loading modules from directory: /usr/lib64/dovecot/lda deliver(alex@foo.org): Feb 16 00:10:31 Info: Module loaded: /usr/lib64/dovecot/lda/lib10_quota_plugin.so deliver(alex@foo.org): Feb 16 00:10:31 Info: Module loaded: /usr/lib64/dovecot/lda/lib90_cmusieve_plugin.so deliver(alex@foo.org): Feb 16 00:10:31 Info: auth input: home=/var/vmail/foo.org/alex/ deliver(alex@foo.org): Feb 16 00:10:31 Info: auth input: mail=maildir:/var/vmail/foo.org/alex/ deliver(alex@foo.org): Feb 16 00:10:31 Info: auth input: uid=1000 deliver(alex@foo.org): Feb 16 00:10:31 Info: auth input: gid=12 deliver(alex@foo.org): Feb 16 00:10:31 Info: auth input: quota_rule=*:storage=9216 deliver(alex@foo.org): Feb 16 00:14:10 Info: Quota root: name=alex@foo.org backend=maildir args= deliver(alex@foo.org): Feb 16 00:14:10 Info: Quota rule: root=alex@foo.org mailbox=* bytes=9437184 messages=0 deliver(alex@foo.org): Feb 16 00:14:10 Info: Quota warning: bytes=6606028 (70%) messages=0 command=/usr/local/bin/quota-warning.sh 70 alex@foo.org deliver(alex@foo.org): Feb 16 00:14:10 Info: maildir: data=/var/vmail/foo.org/alex/ deliver(alex@foo.org): Feb 16 00:14:10 Info: maildir++: root=/var/vmail/foo.org/alex, index=, control=, inbox=/var/vmail/foo.org/alex
On Mon, 2009-02-16 at 00:24 +0100, Alex wrote:
Your debug output was from imap, but you're crossing the quota from deliver. What does deliver log with mail_debug=yes when crossing the quota?
this from dovocot-deliver.log with mail_debug=yes:
And that was all the output from a run that crossed the quota warning limit? It should have logged "quota: Executing warning: " in that case. If it didn't, the problem is that Dovecot didn't think the limit was crossed.. I guess there could be some more debug information logged here.
Timo Sirainen wrote:
On Mon, 2009-02-16 at 00:24 +0100, Alex wrote:
Your debug output was from imap, but you're crossing the quota from deliver. What does deliver log with mail_debug=yes when crossing the quota?
this from dovocot-deliver.log with mail_debug=yes:
And that was all the output from a run that crossed the quota warning limit? It should have logged "quota: Executing warning: " in that case. If it didn't, the problem is that Dovecot didn't think the limit was crossed.. I guess there could be some more debug information logged here.
Ok, my test was wrong. Now I retry to do the cross quota and in my log I found
deliver(alex@foo.org): Feb 16 10:46:20 Info: quota: Executing warning: /usr/local/bin/quota-warning.sh 75 alex@foo.org
and the message arrive with quota warning ;-)
Thanks for help.
participants (3)
-
Alex
-
Noel Butler
-
Timo Sirainen