Darek M
2011-Apr-26 17:34 UTC
[Dovecot] Why is my quota warning script not getting executed?
Storing my users and quota in MySQL,running Dovecot 1.2.16, and followed the page at http://wiki1.dovecot.org/Quota/Dict ?I'm burning my eyes trying to find any syntax issues but can't. I'm including output of dovecot -n and the quota2 table schema below. dovecot.conf: =========dict { ?quotadict = mysql:/usr/local/etc/postfix/dovecot-dict-sql.conf } plugin { ?quota = dict:emailaccount::proxy::quotadict ?quota_warning95 = storage=95%% /usr/local/bin/dovecot-quota-warning.sh 95 ?quota_warning90 = storage=90%% /usr/local/bin/dovecot-quota-warning.sh 90 ?quota_warning80 = storage=80%% /usr/local/bin/dovecot-quota-warning.sh 80 } /usr/local/etc/postfix/dovecot-dict-sql.conf: ==============================# v1.2+ only: connect = host=/tmp/mysql.sock dbname=postfix user=postfix password=**** map { ?pattern = priv/quota/storage ?table = quota2 ?username_field = username ?value_field = bytes } map { ?pattern = priv/quota/messages ?table = quota2 ?username_field = username ?value_field = messages } A log of 90% being passed: # vuserinfo darek at domain.com ? ? ? ?Email: darek at domain.com ? ? ? ?Name: Darek ? ? ? ?Maildir: domain.com/darek/ ? ? ? ?Created: 2011-04-11 18:08:05 ? ? ? ?Modified: 2011-04-25 17:30:26 ? ? ? ?Quota: 25,000K (24.41M) ? ? ? ?Used: ?21,380.29K (20.88M) ? ? ? ?Usage: 85.52% Apr 26 11:57:53 deliver(darek at domain.com): Info: Loading modules from directory: /usr/local/lib/dovecot/lda Apr 26 11:57:53 deliver(darek at domain.com): Info: Module loaded: /usr/local/lib/dovecot/lda/lib10_quota_plugin.so Apr 26 11:57:53 deliver(darek at domain.com): Info: Module loaded: /usr/local/lib/dovecot/lda/lib90_sieve_plugin.so Apr 26 11:57:53 deliver(darek at domain.com): Info: auth input: home=/home/vmail/domain.com/darek/ Apr 26 11:57:53 deliver(darek at domain.com): Info: auth input: mail=maildir:/home/vmail/domain.com/darek/ Apr 26 11:57:53 deliver(darek at domain.com): Info: auth input: uid=5000 Apr 26 11:57:53 deliver(darek at domain.com): Info: auth input: gid=5000 Apr 26 11:57:53 deliver(darek at domain.com): Info: auth input: quota_rule=*:bytes=25600000 Apr 26 11:57:53 deliver(darek at domain.com): Info: Quota root: name=emailaccount backend=dict args=:proxy::quotadict Apr 26 11:57:53 deliver(darek at domain.com): Info: Quota rule: root=emailaccount mailbox=* bytes=25600000 messages=0 Apr 26 11:57:53 deliver(darek at domain.com): Info: dict quota: user=darek at domain.com, uri=proxy::quotadict, noenforcing=0 Apr 26 11:57:53 deliver(darek at domain.com): Info: maildir: data=/home/vmail/domain.com/darek/ Apr 26 11:57:53 deliver(darek at domain.com): Info: maildir++: root=/home/vmail/domain.com/darek, index=, control=, inbox=/home/vmail/domain.com/darek Apr 26 11:57:53 deliver(darek at domain.com): Info: dict quota: user=darek at domain.com, uri=proxy::quotadict, noenforcing=0 Apr 26 11:57:53 deliver(darek at domain.com): Info: sieve: user's script path /home/vmail/domain.com/darek/sieve/darek at domain.com.sieve doesn't exist (using global script path in stead) Apr 26 11:57:53 deliver(darek at domain.com): Info: sieve: user has no valid personal script Apr 26 11:57:53 deliver(darek at domain.com): Info: sieve: no scripts to execute: reverting to default delivery. Apr 26 11:57:53 deliver(darek at domain.com): Info: Namespace : Using permissions from /home/vmail/domain.com/darek: mode=0700 gid=-1 Apr 26 11:57:53 dict: Info: mysql: Connected to /tmp/mysql.sock (postfix) Apr 26 11:57:53 deliver(darek at domain.com): Info: msgid=<4DB6EB69.5010501 at server.net>: saved mail to INBOX # vuserinfo darek at domain.com ? ? ? ?Email: darek at domain.com ? ? ? ?Name: Darek ? ? ? ?Maildir: domain.com/darek/ ? ? ? ?Created: 2011-04-11 18:08:05 ? ? ? ?Modified: 2011-04-25 17:30:26 ? ? ? ?Quota: 25,000K (24.41M) ? ? ? ?Used: ?23,000.09K (22.46M) ? ? ? ?Usage: 92.00% Output of 'dovecot -n': ===============# 1.2.16: /usr/local/etc/dovecot.conf # OS: FreeBSD 8.2-RELEASE i386 ?ufs log_path: /var/log/dovecot/dovecot-err.log info_log_path: /var/log/dovecot/dovecot-info.log protocols: imap imaps pop3 pop3s managesieve listen: , [::] ssl_cert_file: /etc/ssl/dovecot/certs/dovecot.pem ssl_key_file: /etc/ssl/dovecot/private/dovecot.pem disable_plaintext_auth: no nfs_check: no version_ignore: yes login_dir: /var/run/dovecot/login login_executable(default): /usr/local/libexec/dovecot/imap-login login_executable(imap): /usr/local/libexec/dovecot/imap-login login_executable(pop3): /usr/local/libexec/dovecot/pop3-login login_executable(managesieve): /usr/local/libexec/dovecot/managesieve-login login_process_per_connection: no login_processes_count: 10 first_valid_uid: 5000 last_valid_uid: 5000 first_valid_gid: 5000 last_valid_gid: 5000 mail_uid: 5000 mail_gid: 5000 mail_location: maildir:/home/vmail/%d/%n mail_debug: yes mail_nfs_storage: yes lock_method: dotlock maildir_very_dirty_syncs: yes mail_executable(default): /usr/local/libexec/dovecot/imap mail_executable(imap): /usr/local/libexec/dovecot/imap mail_executable(pop3): /usr/local/libexec/dovecot/pop3 mail_executable(managesieve): /usr/local/libexec/dovecot/managesieve mail_plugins(default): quota imap_quota mail_plugins(imap): quota imap_quota mail_plugins(pop3): quota mail_plugins(managesieve): mail_plugin_dir(default): /usr/local/lib/dovecot/imap mail_plugin_dir(imap): /usr/local/lib/dovecot/imap mail_plugin_dir(pop3): /usr/local/lib/dovecot/pop3 mail_plugin_dir(managesieve): /usr/local/lib/dovecot/managesieve lda: ?postmaster_address: supportteam at domain.net ?hostname: inbox4.domain.net ?mail_plugins: quota sieve ?sendmail_path: /usr/sbin/sendmail auth default: ?mechanisms: plain login apop ?user: nobody ?username_translation: %@ ?passdb: ? ?driver: sql ? ?args: /usr/local/etc/postfix/dovecot.sql ?userdb: ? ?driver: sql ? ?args: /usr/local/etc/postfix/dovecot.sql ?socket: ? ?type: listen ? ?client: ? ? ?path: /var/spool/postfix/private/auth ? ? ?mode: 432 ? ? ?user: postfix ? ? ?group: vmail ? ?master: ? ? ?path: /var/run/dovecot/auth-master ? ? ?mode: 384 ? ? ?user: vmail ? ? ?group: vmail plugin: ?quota: dict:emailaccount::proxy::quotadict ?quota_warning95: storage=95%% /usr/local/bin/dovecot-quota-warning.sh 95 ?quota_warning90: storage=90%% /usr/local/bin/dovecot-quota-warning.sh 90 ?quota_warning80: storage=80%% /usr/local/bin/dovecot-quota-warning.sh 80 ?sieve: /home/vmail/%d/%n/sieve/%n@%d.sieve ?sieve_dir: /home/vmail/%d/%n/sieve/ dict: ?quotadict: mysql:/usr/local/etc/postfix/dovecot-dict-sql.conf Database schema: ============= # mysql -u root postfix mysql> describe quota2; +----------+--------------+------+-----+---------+-------+ | Field ? ?| Type ? ? ? ? | Null | Key | Default | Extra | +----------+--------------+------+-----+---------+-------+ | username | varchar(100) | NO ? | PRI | NULL ? ?| ? ? ? | | bytes ? ?| bigint(20) ? | NO ? | ? ? | 0 ? ? ? | ? ? ? | | messages | int(11) ? ? ?| NO ? | ? ? | 0 ? ? ? | ? ? ? | +----------+--------------+------+-----+---------+-------+ 3 rows in set (0.00 sec) mysql> select * from quota2 where username='darek at domain.com'; +------------------+----------+----------+ | username ? ? ? ? | bytes ? ?| messages | +------------------+----------+----------+ | darek at domain.com | 23552090 | ? ? ? ?7 | +------------------+----------+----------+ -- Darek
Timo Sirainen
2011-Apr-26 23:03 UTC
[Dovecot] Why is my quota warning script not getting executed?
On 26.4.2011, at 20.34, Darek M wrote:> quota_warning95: storage=95%% /usr/local/bin/dovecot-quota-warning.sh 95 > quota_warning90: storage=90%% /usr/local/bin/dovecot-quota-warning.sh 90 > quota_warning80: storage=80%% /usr/local/bin/dovecot-quota-warning.sh 80The setting names need to be quota_warning, quota_warning2, quota_warning3, etc. You can't just use arbitrary numbers.