problem Dovecot 2.2.13 does not send the information on ending the quota to user

gothic-folk at mail.ru gothic-folk at mail.ru
Mon Jan 25 15:11:15 UTC 2016



Hi.
I have Dovecot + Postfix + MySQL. 
Version of Postix: 2.11.3-1
Version of Dovecot: 2.2.13
Operations system is: Debian GNU/Linux 8.2 (jessie)

Postfix have patched (patch VDA - http://vda.sourceforge.net) for using with quota, it means that file "maildirsize" in 
mail directory already exists and changed when add/delete mail.
Quota for virtual box take in MySQL db.
##########################
Problem:
Dovecot does not send the information on ending the quota to user.
##########################
# 2.2.13: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-042stab112.15 x86_64 Debian 8.2 ext4
auth_debug = yes
auth_default_realm = mydomain.ru
auth_mechanisms = plain login
auth_realms = mydomain.ru
debug_log_path = /var/log/dovecot-debug.log
info_log_path = /var/log/dovecot.log
lda_mailbox_autocreate = yes
lda_mailbox_autosubscribe = yes
log_path = /var/log/dovecot.log
login_greeting = Welcome mydomain.ru"
mail_debug = yes
mail_gid = 1000
mail_location = maildir:/var/vmail/%n@%d
mail_plugins = " quota"
mail_uid = 1000
managesieve_notify_capability = mailto
managesieve_sieve_capability = fileinto reject envelope encoded-character vacation subaddress comparator-i;ascii- 
numeric relational regex imap4flags copy include variables body enotify environment mailbox date ihave
namespace inbox {
inbox = yes
list = yes
location =
mailbox Drafts {
auto = subscribe
special_use = \Drafts
}
mailbox Junk {
auto = subscribe
special_use = \Junk
}
mailbox Sent {
auto = subscribe
special_use = \Sent
}
mailbox Trash {
auto = subscribe
special_use = \Trash
}
prefix =
type = private
}
passdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
plugin {
quota = maildir:User quota
quota_rule = *:storage=10M
quota_rule2 = Trash:storage=+100M
quota_rule3 = SPAM:ignore
quota_warning = storage=90%% quota-warning 90 %u
quota_warning2 = storage=80%% quota-warning 80 %u
}
protocols = pop3 imap
quota_full_tempfail = yes
service auth {
unix_listener /var/spool/postfix/private/dovecot-smtp-auth {
group = postfix
mode = 0666
user = postfix
}
unix_listener auth-userdb {
group = vmail
mode = 0600
user = vmail
}
}
service imap-login {
inet_listener imap {
port = 143
}
inet_listener imaps {
port = 993
ssl = yes
}
}
service pop3-login {
inet_listener pop3 {
port = 110
}
inet_listener pop3s {
port = 995
ssl = yes
}
}
service quota-warning {
executable = script /etc/dovecot/quota.sh
unix_listener quota-warning {
user = vmail
}
user = vmail
}
ssl_cert = </etc/ssl/mydomain.ru.crt
ssl_key = </etc/ssl/mydomain.ru.key
userdb {
args = /etc/dovecot/dovecot-sql.conf.ext
driver = sql
}
protocol imap {
mail_plugins = " quota imap_quota"
}
protocol pop3 {
mail_plugins = quota
}
protocol lda {
mail_plugins = " quota"
}

#####
quota.sh
#####
#!/bin/sh
PERCENT=$1
USER=$2
cat << EOF | /usr/lib/dovecot/dovecot-lda -d $USER -o "plugin/quota=maildir:User quota:noenforcing"
From: aaa at mydomain.ru
Subject: Quota warning $PERCENT%
Your mailbox is now $PERCENT% full.
Please remove unnecessary emails to avoid new mail loosing.
EOF
#####
Script has chmod 777
#####
root at mx:~# ls -la /etc/dovecot/quota.sh
-rwxrwxrwx 1 vmail vmail 570 Jan 25 17:26 /etc/dovecot/quota.sh

Check the script this command is successful: 
# /etc/dovecot/quota.sh 82 rrr at mydomain.ru
(a letter is sent to rrr at mydomain.ru that box is filled to 82%)
 
#####
dovecot-sql.conf.ext
#####
driver = mysql
connect = host=localhost dbname=postfix user=postfix password=xxxxxxx
default_pass_scheme = MD5-CRYPT
user_query = SELECT '/var/vmail/%n@%d' as home, 'maildir:/var/vmail/%n@%d'as mail, 1000 AS uid, 1000 AS gid, concat 
('*:bytes=', quota) AS quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
password_query = SELECT username as user, password, '/var/vmail/%n@%d' as userdb_home, 'maildir:/var/vmail/%n@%d' as 
userdb_mail, 1000 as userdb_uid, 1000 as userdb_gid, concat('*:bytes=', quota) AS userdb_quota_rule FROM mailbox WHERE 
username = '%u' AND active = '1'

#####
Check that the socket has a quota-warning: 
# lsof |grep quota-warning
dovecot 28972 root 57u unix 0xffff8801861f7400 0t0 216184427 /var/run/dovecot/quota- 
warning
#####
Verify that the plugin quota is running I doing like this: 
# doveadm -D -v quota get -u rrr at mydomain.ru
Conclusion:

doveadm(root): Debug: Loading modules from directory: /usr/lib/dovecot/modules
doveadm(root): Debug: Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so
doveadm(root): Debug: Loading modules from directory: /usr/lib/dovecot/modules/doveadm
doveadm(root): Debug: Skipping module doveadm_acl_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_acl_plugin.so: undefined symbol: acl_user_module (this is usually intentional, so just ignore this message)
doveadm(root): Debug: Skipping module doveadm_expire_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_expire_plugin.so: undefined symbol: expire_set_deinit (this is usually intentional, so just ignore this message)
doveadm(root): Debug: Module loaded: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_quota_plugin.so
doveadm(root): Debug: Module loaded: /usr/lib/dovecot/modules/doveadm/lib10_doveadm_sieve_plugin.so
doveadm(root): Debug: Skipping module doveadm_fts_lucene_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib20_doveadm_fts_lucene_plugin.so: undefined symbol: lucene_index_iter_deinit (this is usually intentional, so just ignore this message)
doveadm(root): Debug: Skipping module doveadm_fts_plugin, because dlopen() failed: /usr/lib/dovecot/modules/doveadm/lib20_doveadm_fts_plugin.so: undefined symbol: fts_backend_rescan (this is usually intentional, so just ignore this message)
doveadm(asd at mydomain.ru): Debug: auth input: asd at mydomain.ru home=/var/vmail/asd at mydomain.ru mail=maildir:/var/vmail/asd at mydomain.ru uid=1000 gid=1000 quota_rule=*:bytes=5120000
doveadm(asd at mydomain.ru): Debug: Added userdb setting: mail=maildir:/var/vmail/asd at mydomain.ru
doveadm(asd at mydomain.ru): Debug: Added userdb setting: plugin/quota_rule=*:bytes=5120000
doveadm(asd at mydomain.ru): Debug: Effective uid=1000, gid=1000, home=/var/vmail/asd at mydomain.ru
doveadm(asd at mydomain.ru): Debug: Quota root: name=User quota backend=maildir args=
doveadm(asd at mydomain.ru): Debug: Quota rule: root=User quota mailbox=* bytes=5120000 messages=0
doveadm(asd at mydomain.ru): Debug: Quota rule: root=User quota mailbox=Trash bytes=+104857600 messages=0
doveadm(asd at mydomain.ru): Debug: Quota rule: root=User quota mailbox=SPAM ignored
doveadm(asd at mydomain.ru): Debug: Quota warning: bytes=4608000 (90%) messages=0 reverse=no command=quota-warning 90 asd at mydomain.ru
doveadm(asd at mydomain.ru): Debug: Quota warning: bytes=4096000 (80%) messages=0 reverse=no command=quota-warning 80 asd at mydomain.ru
doveadm(asd at mydomain.ru): Debug: Quota grace: root=User quota bytes=512000 (10%)
doveadm(asd at mydomain.ru): Debug: Namespace inbox: type=private, prefix=, sep=, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/var/vmail/asd at mydomain.ru
doveadm(asd at mydomain.ru): Debug: maildir++: root=/var/vmail/asd at mydomain.ru, index=, indexpvt=, control=, inbox=/var/vmail/asd at mydomain.ru, alt=
Quota name Type Value Limit %
User quota STORAGE 4852 5000 97
User quota MESSAGE 10 - 0
 
#####
Those plugin is successfully loaded and checked. When removing/receiving emails percent of employment, respectively 
changes.
I read in dovecot manual, that the notification send only when the quota border crossing - then I tested like this: 
Clears the box up to 60% and then send letters, which occupy about 5% more of allocated quota. And so the lead up to 
95%. But reports of ending the quota not be sent.
In what may be another problem?
Thanks.
------------------
Serg


More information about the dovecot mailing list