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 at foo.org): Loading modules from
directory: /usr/lib64/dovecot/imap
dovecot: Feb 15 23:42:33 Info: IMAP(alex at foo.org): Module loaded:
/usr/lib64/dovecot/imap/lib10_quota_plugin.so
dovecot: Feb 15 23:42:33 Info: IMAP(alex at foo.org): Module loaded:
/usr/lib64/dovecot/imap/lib11_imap_quota_plugin.so
dovecot: Feb 15 23:42:33 Info: IMAP(alex at foo.org): Effective uid=1000,
gid=12, home=/var/vmail/foo.org/alex/
dovecot: Feb 15 23:42:33 Info: IMAP(alex at foo.org): Quota root:
name=alex at foo.org backend=maildir argsdovecot: Feb 15 23:42:33 Info:
IMAP(alex at foo.org): Quota rule:
root=alex at foo.org mailbox=* bytes=52428800 messages=0
dovecot: Feb 15 23:42:33 Info: imap-login: Login: user=<alex at foo.org>,
method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured
dovecot: Feb 15 23:42:33 Info: IMAP(alex at foo.org): Quota warning:
bytes=39321600 (75%) messages=0 command=/root/quota-warning.sh 75
alex at 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 at foo.org): Loading modules from > directory: /usr/lib64/dovecot/imap > dovecot: Feb 15 23:42:33 Info: IMAP(alex at foo.org): Module loaded: > /usr/lib64/dovecot/imap/lib10_quota_plugin.so > dovecot: Feb 15 23:42:33 Info: IMAP(alex at foo.org): Module loaded: > /usr/lib64/dovecot/imap/lib11_imap_quota_plugin.so > dovecot: Feb 15 23:42:33 Info: IMAP(alex at foo.org): Effective uid=1000, > gid=12, home=/var/vmail/foo.org/alex/ > dovecot: Feb 15 23:42:33 Info: IMAP(alex at foo.org): Quota root: > name=alex at foo.org backend=maildir args> dovecot: Feb 15 23:42:33 Info: IMAP(alex at foo.org): Quota rule: > root=alex at foo.org mailbox=* bytes=52428800 messages=0 > dovecot: Feb 15 23:42:33 Info: imap-login: Login: user=<alex at foo.org>, > method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured > dovecot: Feb 15 23:42:33 Info: IMAP(alex at foo.org): Quota warning: > bytes=39321600 (75%) messages=0 command=/root/quota-warning.sh 75 > alex at 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. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20090216/2d608aa7/attachment-0002.bin>
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.