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(a...@foo.org): Loading modules from directory: /usr/lib64/dovecot/imap dovecot: Feb 15 23:42:33 Info: IMAP(a...@foo.org): Module loaded: /usr/lib64/dovecot/imap/lib10_quota_plugin.so dovecot: Feb 15 23:42:33 Info: IMAP(a...@foo.org): Module loaded: /usr/lib64/dovecot/imap/lib11_imap_quota_plugin.so dovecot: Feb 15 23:42:33 Info: IMAP(a...@foo.org): Effective uid=1000, gid=12, home=/var/vmail/foo.org/alex/ dovecot: Feb 15 23:42:33 Info: IMAP(a...@foo.org): Quota root: name=a...@foo.org backend=maildir args= dovecot: Feb 15 23:42:33 Info: IMAP(a...@foo.org): Quota rule: root=a...@foo.org mailbox=* bytes=52428800 messages=0 dovecot: Feb 15 23:42:33 Info: imap-login: Login: user=<a...@foo.org>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured dovecot: Feb 15 23:42:33 Info: IMAP(a...@foo.org): Quota warning: bytes=39321600 (75%) messages=0 command=/root/quota-warning.sh 75 a...@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

Reply via email to