quota warnings not sent out anymore
Hi,
We suddenly realised that our maildir quota warnings are no longer sent out. We don't understand why not.
This is dovecot 2.3.4.1 on debian 10.11. We use a script to send out the notification, adapted from the dovecot wiki here: (https://doc.dovecot.org/configuration_manual/quota/)
Our quota notification script is:
#!/bin/sh PERCENT=$1 USER=$2 cat << EOF | /usr/lib/dovecot/dovecot-lda -d $USER -o "plugin/quota=maildir::noenforcing" From: noreply@domain.com Subject: quota warning
Your mailbox is now $PERCENT% full.
Please delete or archive items to decrease your mailbox size.
Our complete doveconf -n output is at the end of this email.
When calling the script manually as user root, it works perfectly. But as user vmail or dovecot, no notifications are sent at all.
I guess this is relevant:
root@dovecot:/etc/dovecot# ls -l /var/run/dovecot/ total 8 srw------- 1 root root 0 Dec 6 00:00 anvil srw------- 1 root root 0 Dec 6 00:00 anvil-auth-penalty srw------- 1 dovecot root 0 Dec 6 11:34 auth-client srw------- 1 dovecot root 0 Dec 6 11:34 auth-login srw------- 1 root root 0 Dec 6 11:34 auth-master -rw------- 1 root root 32 Jul 19 17:39 auth-token-secret.dat srw-rw-rw- 1 vmail vmail 0 Dec 6 11:34 auth-userdb srw------- 1 dovecot root 0 Dec 6 11:34 auth-worker srw------- 1 root root 0 Dec 6 11:34 config srw-rw---- 1 root dovecot 0 Dec 6 11:34 dict srw-rw---- 1 root dovecot 0 Dec 6 11:34 dict-async srw------- 1 root root 0 Dec 6 11:34 director-admin srw-rw-rw- 1 root root 0 Dec 6 11:34 dns-client srw------- 1 root root 0 Dec 6 11:34 doveadm-server lrwxrwxrwx 1 root root 25 Dec 6 00:00 dovecot.conf -> /etc/dovecot/dovecot.conf drwxr-xr-x 2 root root 40 Jul 19 17:39 empty srw-rw---- 1 root dovecot 0 Dec 6 11:34 imap-hibernate srw------- 1 root root 0 Dec 6 11:34 imap-master srw-rw-rw- 1 root root 0 Dec 6 11:34 imap-urlauth srw------- 1 dovecot root 0 Dec 6 11:34 imap-urlauth-worker srw-rw-rw- 1 root root 0 Dec 6 11:34 indexer srw------- 1 dovecot root 0 Dec 6 11:34 indexer-worker srw------- 1 dovecot root 0 Dec 6 11:34 ipc srw-rw-rw- 1 root root 0 Dec 6 11:34 lmtp srw------- 1 root root 0 Dec 6 11:34 log-errors drwxr-x--- 2 root nogroup 120 Dec 6 11:34 login srw------- 1 root root 0 Dec 6 11:34 master -rw------- 1 root root 6 Dec 6 00:00 master.pid srw------- 1 root root 0 Dec 6 11:34 old-stats prw------- 1 root root 0 Dec 6 11:34 old-stats-mail prw------- 1 root root 0 Dec 6 11:34 old-stats-user srw------- 1 vmail root 0 Dec 6 11:34 quota-warning srw------- 1 root root 0 Dec 6 11:34 replication-notify prw------- 1 root root 0 Dec 6 11:34 replication-notify-fifo srw------- 1 dovecot root 0 Dec 6 11:34 replicator srw-rw---- 1 vmail vmail 0 Dec 6 11:34 stats-reader srw-rw---- 1 vmail vmail 0 Dec 6 11:34 stats-writer drwxr-x--- 2 root nogroup 80 Dec 6 11:34 token-login
Can anyone help, and explain what is going on here?
Thank you very much in advance for a reply!
MJ
The doveconf -n output:
root@imap:/etc/dovecot# doveconf -n # 2.3.4.1 (f79e8e7e4): /etc/dovecot/dovecot.conf # Pigeonhole version 0.5.4 () # OS: Linux 4.19.0-17-amd64 x86_64 Debian 10.11 xfs # Hostname: mail.company.com auth_debug = yes auth_failure_delay = 10 secs auth_master_user_separator = * auth_mechanisms = plain login auth_username_format = %Ln auth_verbose = yes auth_verbose_passwords = sha1 default_vsz_limit = 512 M deliver_log_format = %f | %s | msgid=%m: %$ lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes login_greeting = Dovecot ready. login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c lport=%a mail_gid = vmail mail_location = maildir:/var/vmail/%Ln/Maildir:LAYOUT=fs:DIRNAME=mAildir mail_plugins = acl lazy_expunge zlib quota mail_log notify mail_shared_explicit_inbox = yes mail_uid = vmail 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 { list = children location = maildir:/var/vmail/%%u/Maildir:LAYOUT=fs:DIRNAME=mAildir:INDEX=/var/vmail/%u/shared/%%u prefix = shared/%%n/ separator = / subscriptions = no type = shared } namespace inbox { inbox = yes location = mailbox "Deleted items" { special_use = \Trash } mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent items" { special_use = \Sent } mailbox Trash { special_use = \Trash } mailbox inbox { auto = subscribe } prefix = separator = / type = private } passdb { args = /etc/dovecot/deny.imap deny = yes driver = passwd-file } passdb { args = /etc/dovecot/master-users driver = passwd-file master = yes } passdb { args = /etc/dovecot/dovecot-ldap.conf.ext driver = ldap result_failure = return-fail } plugin { acl = vfile acl_shared_dict = file:/var/lib/dovecot/db/shared-mailboxes.db mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename append mail_log_fields = uid box msgid from subject quota = maildir quota_rule = ?:storage=5G quota_rule2 = Trash:storage=+100M quota_warning = storage=97%% quota-warning 97 %u quota_warning2 = storage=95%% quota-warning 95 %u quota_warning3 = storage=90%% quota-warning 90 %u quota_warning4 = storage=85%% quota-warning 85 %u quota_warning5 = storage=80%% quota-warning 80 %u quota_warning6 = -storage=100%% quota-warning below %u sieve = ~/.dovecot.sieve sieve_default = /var/lib/dovecot/default.sieve sieve_dir = ~/sieve } protocols = imap lmtp sieve service auth { unix_listener /var/spool/postfix/private/auth { mode = 0666 } unix_listener auth-userdb { group = vmail mode = 0666 user = vmail } } service imap-login { process_limit = 500 process_min_avail = 2 } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = vmail } user = dovecot } service stats { unix_listener stats-reader { group = vmail mode = 0660 user = vmail } unix_listener stats-writer { group = vmail mode = 0660 user = vmail } } shutdown_clients = no ssl = required ssl_cert =
Additional info: there seems to be permission-related issue anyway, as we also see messages like these in our logs:
2021-12-03T19:06:15.032873+01:00 hostname dovecot - - - quota-warning: Error: lda(username,)Error: net_connect_unix(/var/run/dovecot/stats-writer) failed: Permission denied
But are permissions of stats-writer related to not sending out quota notifications?
MJ
Op 06-12-2021 om 12:10 schreef mj:
Hi,
We suddenly realised that our maildir quota warnings are no longer sent out. We don't understand why not.
This is dovecot 2.3.4.1 on debian 10.11. We use a script to send out the notification, adapted from the dovecot wiki here: (https://doc.dovecot.org/configuration_manual/quota/)
Our quota notification script is:
#!/bin/sh PERCENT=$1 USER=$2 cat << EOF | /usr/lib/dovecot/dovecot-lda -d $USER -o "plugin/quota=maildir::noenforcing" From: noreply@domain.com Subject: quota warning
Your mailbox is now $PERCENT% full.
Please delete or archive items to decrease your mailbox size.
Our complete doveconf -n output is at the end of this email.
When calling the script manually as user root, it works perfectly. But as user vmail or dovecot, no notifications are sent at all.
I guess this is relevant:
root@dovecot:/etc/dovecot# ls -l /var/run/dovecot/ total 8 srw------- 1 root root 0 Dec 6 00:00 anvil srw------- 1 root root 0 Dec 6 00:00 anvil-auth-penalty srw------- 1 dovecot root 0 Dec 6 11:34 auth-client srw------- 1 dovecot root 0 Dec 6 11:34 auth-login srw------- 1 root root 0 Dec 6 11:34 auth-master -rw------- 1 root root 32 Jul 19 17:39 auth-token-secret.dat srw-rw-rw- 1 vmail vmail 0 Dec 6 11:34 auth-userdb srw------- 1 dovecot root 0 Dec 6 11:34 auth-worker srw------- 1 root root 0 Dec 6 11:34 config srw-rw---- 1 root dovecot 0 Dec 6 11:34 dict srw-rw---- 1 root dovecot 0 Dec 6 11:34 dict-async srw------- 1 root root 0 Dec 6 11:34 director-admin srw-rw-rw- 1 root root 0 Dec 6 11:34 dns-client srw------- 1 root root 0 Dec 6 11:34 doveadm-server lrwxrwxrwx 1 root root 25 Dec 6 00:00 dovecot.conf -> /etc/dovecot/dovecot.conf drwxr-xr-x 2 root root 40 Jul 19 17:39 empty srw-rw---- 1 root dovecot 0 Dec 6 11:34 imap-hibernate srw------- 1 root root 0 Dec 6 11:34 imap-master srw-rw-rw- 1 root root 0 Dec 6 11:34 imap-urlauth srw------- 1 dovecot root 0 Dec 6 11:34 imap-urlauth-worker srw-rw-rw- 1 root root 0 Dec 6 11:34 indexer srw------- 1 dovecot root 0 Dec 6 11:34 indexer-worker srw------- 1 dovecot root 0 Dec 6 11:34 ipc srw-rw-rw- 1 root root 0 Dec 6 11:34 lmtp srw------- 1 root root 0 Dec 6 11:34 log-errors drwxr-x--- 2 root nogroup 120 Dec 6 11:34 login srw------- 1 root root 0 Dec 6 11:34 master -rw------- 1 root root 6 Dec 6 00:00 master.pid srw------- 1 root root 0 Dec 6 11:34 old-stats prw------- 1 root root 0 Dec 6 11:34 old-stats-mail prw------- 1 root root 0 Dec 6 11:34 old-stats-user srw------- 1 vmail root 0 Dec 6 11:34 quota-warning srw------- 1 root root 0 Dec 6 11:34 replication-notify prw------- 1 root root 0 Dec 6 11:34 replication-notify-fifo srw------- 1 dovecot root 0 Dec 6 11:34 replicator srw-rw---- 1 vmail vmail 0 Dec 6 11:34 stats-reader srw-rw---- 1 vmail vmail 0 Dec 6 11:34 stats-writer drwxr-x--- 2 root nogroup 80 Dec 6 11:34 token-login
Can anyone help, and explain what is going on here?
Thank you very much in advance for a reply!
MJ
The doveconf -n output:
root@imap:/etc/dovecot# doveconf -n # 2.3.4.1 (f79e8e7e4): /etc/dovecot/dovecot.conf # Pigeonhole version 0.5.4 () # OS: Linux 4.19.0-17-amd64 x86_64 Debian 10.11 xfs # Hostname: mail.company.com auth_debug = yes auth_failure_delay = 10 secs auth_master_user_separator = * auth_mechanisms = plain login auth_username_format = %Ln auth_verbose = yes auth_verbose_passwords = sha1 default_vsz_limit = 512 M deliver_log_format = %f | %s | msgid=%m: %$ lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes login_greeting = Dovecot ready. login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c lport=%a mail_gid = vmail mail_location = maildir:/var/vmail/%Ln/Maildir:LAYOUT=fs:DIRNAME=mAildir mail_plugins = acl lazy_expunge zlib quota mail_log notify mail_shared_explicit_inbox = yes mail_uid = vmail 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 { list = children location = maildir:/var/vmail/%%u/Maildir:LAYOUT=fs:DIRNAME=mAildir:INDEX=/var/vmail/%u/shared/%%u
prefix = shared/%%n/ separator = / subscriptions = no type = shared } namespace inbox { inbox = yes location = mailbox "Deleted items" { special_use = \Trash } mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent items" { special_use = \Sent } mailbox Trash { special_use = \Trash } mailbox inbox { auto = subscribe } prefix = separator = / type = private } passdb { args = /etc/dovecot/deny.imap deny = yes driver = passwd-file } passdb { args = /etc/dovecot/master-users driver = passwd-file master = yes } passdb { args = /etc/dovecot/dovecot-ldap.conf.ext driver = ldap result_failure = return-fail } plugin { acl = vfile acl_shared_dict = file:/var/lib/dovecot/db/shared-mailboxes.db mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename append mail_log_fields = uid box msgid from subject quota = maildir quota_rule = ?:storage=5G quota_rule2 = Trash:storage=+100M quota_warning = storage=97%% quota-warning 97 %u quota_warning2 = storage=95%% quota-warning 95 %u quota_warning3 = storage=90%% quota-warning 90 %u quota_warning4 = storage=85%% quota-warning 85 %u quota_warning5 = storage=80%% quota-warning 80 %u quota_warning6 = -storage=100%% quota-warning below %u sieve = ~/.dovecot.sieve sieve_default = /var/lib/dovecot/default.sieve sieve_dir = ~/sieve } protocols = imap lmtp sieve service auth { unix_listener /var/spool/postfix/private/auth { mode = 0666 } unix_listener auth-userdb { group = vmail mode = 0666 user = vmail } } service imap-login { process_limit = 500 process_min_avail = 2 } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = vmail } user = dovecot } service stats { unix_listener stats-reader { group = vmail mode = 0660 user = vmail } unix_listener stats-writer { group = vmail mode = 0660 user = vmail } } shutdown_clients = no ssl = required ssl_cert =
ssl_dh = # hidden, use -P to show it ssl_key = # hidden, use -P to show it ssl_min_protocol = TLSv1.2 userdb { args = uid=vmail gid=vmail home=/var/vmail/%n allow_all_users=yes driver = static } userdb { args = /etc/dovecot/dovecot-ldap.conf.ext driver = ldap } verbose_proctitle = yes protocol lda { mail_plugins = acl lazy_expunge zlib quota mail_log notify sieve quota } protocol imap { imap_max_line_length = 2 M mail_max_userip_connections = 40 mail_plugins = acl lazy_expunge zlib quota mail_log notify imap_quota imap_acl }
Hi,
I set mail_debug=yes, and sent a test email to a 90% full mailbox: I would expect a warning about it. These lines are logged:
Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: fs: root=/var/vmail/username/Maildir, index=, indexpvt=, control=, inbox=, alt= Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: acl: initializing backend with data: vfile Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: acl: acl username = username Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: acl: owner = 1 Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: acl vfile: Global ACLs disabled Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: quota: quota_over_flag check: quota_over_script unset - skipping Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Quota root: name= backend=maildir args= Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Quota rule: root= mailbox=? bytes=5368709120 messages=0 Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Quota rule: root= mailbox=Trash bytes=+104857600 messages=0 Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Quota warning: bytes=5207647846 (97%) messages=0 reverse=no command=quota-warning 97 raw mail user Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Quota warning: bytes=5100273664 (95%) messages=0 reverse=no command=quota-warning 95 raw mail user Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Quota warning: bytes=4831838208 (90%) messages=0 reverse=no command=quota-warning 90 raw mail user Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Quota warning: bytes=4563402752 (85%) messages=0 reverse=no command=quota-warning 85 raw mail user Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Quota warning: bytes=4294967296 (80%) messages=0 reverse=no command=quota-warning 80 raw mail user Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Quota warning: bytes=5368709120 (100%) messages=0 reverse=yes command=quota-warning below raw mail user Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Quota grace: root= bytes=536870912 (10%) Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: quota: quota_over_flag check: quota_over_script unset - skipping Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Destination address: username@company.com (source: -a parameter) Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Mailbox INBOX: Mailbox opened because: lib-lda delivery Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Quota root : Recalculated relative rules with bytes=15737418240 count=0. Now grace=1573741824 Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: Debug: Mailbox INBOX: saving UID 0: Opened mail because: mail stream Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: save: box=INBOX, uid=86077, msgid=c5a339e7-e45d-9bb2-c0b3-9272f5f5fa29@gmail.com, from=username@gmail.com, subject=test Dec 8 11:31:57 mail dovecot: lda(username)<14734><tqBrLp2JsGGOOQAA4uZ9mg>: sieve: username@gmail.com | test | msgid=c5a339e7-e45d-9bb2-c0b3-9272f5f5fa29@gmail.com: stored mail into mailbox 'INBOX'
Does "quota: quota_over_flag check: quota_over_script unset - skipping" mean I forgot to set some specific flag in order to make our script run?
MJ
Hi,
I am still struggling with this, and would appreciate any help ayone can give. Let me try to explain step for step.
I created a test account test@company.com:
root@dovecot:/# doveadm quota get -u test Quota name Type Value Limit % STORAGE 1209 1368 88 MESSAGE 35 - 0
As you can see, the test mailbox is 88% full, so it should receive warnings, because in dovecot.conf I have set:
plugin { quota = maildir quota_rule = ?:storage=5G quota_rule2 = Trash:storage=+100M quota_warning = storage=97%% quota-warning 97 %u quota_warning2 = storage=95%% quota-warning 95 %u quota_warning3 = storage=90%% quota-warning 90 %u quota_warning4 = storage=85%% quota-warning 85 %u quota_warning5 = storage=80%% quota-warning 80 %u quota_warning6 = -storage=100%% quota-warning below %u }
We use a script to send out the email warnings, configured like this:
service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = vmail mode = 0666 } user = vmail }
When running this script manually as vmail, the warning is delivered to the test user:
sudo -H -u vmail bash -c '/usr/local/bin/quota-warning.sh 90 test'
However, in practice: dovecot never sends out any quota-warnings. It just starts generating delivery failures when the mailbox is over 100%.
We define the per-user quota in the first line of each user's maildirsize file, for the test user: /var/vmail/test/Maildir/maildirsize
Here is a debug=yes log file of 88% full incoming mailbox delivery:
Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Loading modules from directory: /usr/lib/dovecot/modules Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib01_acl_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib02_lazy_expunge_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib15_notify_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib20_mail_log_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib20_zlib_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib90_sieve_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: auth USER input: test uid=5000 gid=5000 home=/var/vmail/test Dec 15 13:56:07 mail dovecot: auth: Debug: master in: USER#0111#011test@company.com#011service=lda Dec 15 13:56:07 mail dovecot: auth: Debug: userdb out: USER#0111#011test#011uid=5000#011gid=5000#011home=/var/vmail/test Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: changed username to test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Effective uid=5000, gid=5000, home=/var/vmail/test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: lazy_expunge: No lazy_expunge setting - plugin disabled Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota root: name= backend=maildir args= Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota rule: root= mailbox=? bytes=5368709120 messages=0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota rule: root= mailbox=Trash bytes=+104857600 messages=0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5207647846 (97%) messages=0 reverse=no command=quota-warning 97 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5100273664 (95%) messages=0 reverse=no command=quota-warning 95 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4831838208 (90%) messages=0 reverse=no command=quota-warning 90 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4563402752 (85%) messages=0 reverse=no command=quota-warning 85 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4294967296 (80%) messages=0 reverse=no command=quota-warning 80 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5368709120 (100%) messages=0 reverse=yes command=quota-warning below test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota grace: root= bytes=536870912 (10%) Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Namespace : type=shared, prefix=shared/%n/, sep=/, inbox=no, hidden=no, list=children, subscriptions=no location=maildir:/var/vmail/%u/Maildir:LAYOUT=fs:DIRNAME=mAildir:INDEX=/var/vmail/test/shared/%u Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: shared: root=/var/run/dovecot, index=, indexpvt=, control=, inbox=, alt= Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: initializing backend with data: vfile Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: acl username = test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: owner = 0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl vfile: Global ACLs disabled Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Namespace inbox: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/var/vmail/test/Maildir:LAYOUT=fs:DIRNAME=mAildir Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: fs: root=/var/vmail/test/Maildir, index=, indexpvt=, control=, inbox=, alt= Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: initializing backend with data: vfile Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: acl username = test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: owner = 1 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl vfile: Global ACLs disabled Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: quota: quota_over_flag check: quota_over_script unset - skipping Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota root: name= backend=maildir args= Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota rule: root= mailbox=? bytes=5368709120 messages=0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota rule: root= mailbox=Trash bytes=+104857600 messages=0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5207647846 (97%) messages=0 reverse=no command=quota-warning 97 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5100273664 (95%) messages=0 reverse=no command=quota-warning 95 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4831838208 (90%) messages=0 reverse=no command=quota-warning 90 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4563402752 (85%) messages=0 reverse=no command=quota-warning 85 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4294967296 (80%) messages=0 reverse=no command=quota-warning 80 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5368709120 (100%) messages=0 reverse=yes command=quota-warning below raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota grace: root= bytes=536870912 (10%) Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: quota: quota_over_flag check: quota_over_script unset - skipping Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Destination address: test@company.com (source: -a parameter) Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Pigeonhole version 0.5.4 () initializing Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: include: sieve_global is not set; it is currently not possible to include
:global' scripts. Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Using active Sieve script path: /var/vmail/test/.dovecot.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Using script storage path: /var/vmail/test/sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Relative path to sieve storage in active link: sieve/ Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Using Sieve script path: /var/vmail/test/.dovecot.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Storage path
/var/vmail/test/.dovecot.sieve' not found Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Using Sieve script path: /var/lib/dovecot/default.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file script: Opened scriptdefault' from
/var/lib/dovecot/default.sieve' Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Using the following location for user's Sieve script: /var/lib/dovecot/default.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Opening script 1 of 1 from/var/lib/dovecot/default.sieve' Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Loading script /var/lib/dovecot/default.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Script binary /var/lib/dovecot/default.svbin successfully loaded Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: binary save: not saving binary /var/lib/dovecot/default.svbin, because it is already stored Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Executing script from
/var/lib/dovecot/default.svbin' Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Mailbox INBOX: Mailbox opened because: lib-lda delivery Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota root : Recalculated relative rules with bytes=1400000 count=0. Now grace=140000 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Mailbox INBOX: saving UID 0: Opened mail because: mail stream Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: save: box=INBOX, uid=20, msgid=46e7b334-80a0-3a99-4494-bc6fd07aa3db@external.com, from=user name user@external.com, subject=test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: sieve: user@external.com | test | msgid=46e7b334-80a0-3a99-4494-bc6fd07aa3db@external.com: stored mail into mailbox 'INBOX' Dec 15 13:56:07 mail postfix/pipe[20088]: 76722819170D6: to=test@company.com, relay=dovecot, delay=0.24, delays=0.2/0.02/0/0.03, dsn=2.0.0, status=sent (delivered via dovecot service) Dec 15 13:56:07 mail postfix/qmgr[19577]: 76722819170D6: removed
I would appreciate any help. :-)
Finally, our dovecont -n running-config:
root@dovecot:# dovecot -n # 2.3.4.1 (f79e8e7e4): /etc/dovecot/dovecot.conf # Pigeonhole version 0.5.4 () # OS: Linux 4.19.0-17-amd64 x86_64 Debian 10.11 xfs # Hostname: mail.company.com auth_debug = yes auth_failure_delay = 10 secs auth_master_user_separator = * auth_mechanisms = plain login auth_username_format = %Ln auth_verbose = yes auth_verbose_passwords = sha1 default_vsz_limit = 512 M deliver_log_format = %f | %s | msgid=%m: %$ lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes login_greeting = Dovecot ready. login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c lport=%a mail_gid = vmail mail_location = maildir:/var/vmail/%Ln/Maildir:LAYOUT=fs:DIRNAME=mAildir mail_plugins = acl lazy_expunge zlib quota mail_log notify mail_shared_explicit_inbox = yes mail_uid = vmail 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 { list = children location = maildir:/var/vmail/%%u/Maildir:LAYOUT=fs:DIRNAME=mAildir:INDEX=/var/vmail/%u/shared/%%u prefix = shared/%%n/ separator = / subscriptions = no type = shared } namespace inbox { inbox = yes location = mailbox "Deleted items" { special_use = \Trash } mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent items" { special_use = \Sent } mailbox Trash { special_use = \Trash } mailbox inbox { auto = subscribe } prefix = separator = / type = private } passdb { args = /etc/dovecot/deny.imap deny = yes driver = passwd-file } passdb { args = /etc/dovecot/master-users driver = passwd-file master = yes } passdb { args = /etc/dovecot/dovecot-ldap.conf.ext driver = ldap result_failure = return-fail } plugin { acl = vfile acl_shared_dict = file:/var/lib/dovecot/db/shared-mailboxes.db mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename append mail_log_fields = uid box msgid from subject quota = maildir quota_rule = ?:storage=5G quota_rule2 = Trash:storage=+100M quota_warning = storage=97%% quota-warning 97 %u quota_warning2 = storage=95%% quota-warning 95 %u quota_warning3 = storage=90%% quota-warning 90 %u quota_warning4 = storage=85%% quota-warning 85 %u quota_warning5 = storage=80%% quota-warning 80 %u quota_warning6 = -storage=100%% quota-warning below %u sieve = ~/.dovecot.sieve sieve_default = /var/lib/dovecot/default.sieve sieve_dir = ~/sieve } protocols = imap lmtp sieve service auth { unix_listener /var/spool/postfix/private/auth { mode = 0666 } unix_listener auth-userdb { group = vmail mode = 0666 user = vmail } } service imap-login { process_limit = 500 process_min_avail = 2 } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { mode = 0666 user = vmail } user = vmail } service stats { unix_listener stats-reader { group = vmail mode = 0666 user = vmail } unix_listener stats-writer { group = vmail mode = 0666 user = vmail } } shutdown_clients = no ssl = required ssl_cert =
Thanks very much for your help!
MJ
Hello
Just to clarify. You only will getting an over quota once, you step over one or multiple of those quota warning limits while storing an email.
Therefore you will not get any warning, just because you are over that 85% limit. If you receive another email in that account, and go at least over 90%, then dovecot will call your script once. If you also go over 100% with that same mail, you will not get one for 90% or 95%, but only one for 100%.
You also should check, if you have any environment variables set, which are not present, when your script is run by dovecot. Do you have any logging in it?
Kind regards, Christian Mack
Am 15.12.21 um 14:06 schrieb mj:
Hi,
I am still struggling with this, and would appreciate any help ayone can give. Let me try to explain step for step.
I created a test account test@company.com:
root@dovecot:/# doveadm quota get -u test Quota name Type Value Limit % STORAGE 1209 1368 88 MESSAGE 35 - 0
As you can see, the test mailbox is 88% full, so it should receive warnings, because in dovecot.conf I have set:
plugin { quota = maildir quota_rule = ?:storage=5G quota_rule2 = Trash:storage=+100M quota_warning = storage=97%% quota-warning 97 %u quota_warning2 = storage=95%% quota-warning 95 %u quota_warning3 = storage=90%% quota-warning 90 %u quota_warning4 = storage=85%% quota-warning 85 %u quota_warning5 = storage=80%% quota-warning 80 %u quota_warning6 = -storage=100%% quota-warning below %u }
We use a script to send out the email warnings, configured like this:
service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = vmail mode = 0666 } user = vmail }
When running this script manually as vmail, the warning is delivered to the test user:
sudo -H -u vmail bash -c '/usr/local/bin/quota-warning.sh 90 test'
However, in practice: dovecot never sends out any quota-warnings. It just starts generating delivery failures when the mailbox is over 100%.
We define the per-user quota in the first line of each user's maildirsize file, for the test user: /var/vmail/test/Maildir/maildirsize
Here is a debug=yes log file of 88% full incoming mailbox delivery:
Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Loading modules from directory: /usr/lib/dovecot/modules Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib01_acl_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib02_lazy_expunge_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib15_notify_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib20_mail_log_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib20_zlib_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib90_sieve_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: auth USER input: test uid=5000 gid=5000 home=/var/vmail/test Dec 15 13:56:07 mail dovecot: auth: Debug: master in: USER#0111#011test@company.com#011service=lda Dec 15 13:56:07 mail dovecot: auth: Debug: userdb out: USER#0111#011test#011uid=5000#011gid=5000#011home=/var/vmail/test Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: changed username to test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Effective uid=5000, gid=5000, home=/var/vmail/test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: lazy_expunge: No lazy_expunge setting - plugin disabled Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota root: name= backend=maildir args= Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota rule: root= mailbox=? bytes=5368709120 messages=0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota rule: root= mailbox=Trash bytes=+104857600 messages=0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5207647846 (97%) messages=0 reverse=no command=quota-warning 97 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5100273664 (95%) messages=0 reverse=no command=quota-warning 95 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4831838208 (90%) messages=0 reverse=no command=quota-warning 90 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4563402752 (85%) messages=0 reverse=no command=quota-warning 85 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4294967296 (80%) messages=0 reverse=no command=quota-warning 80 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5368709120 (100%) messages=0 reverse=yes command=quota-warning below test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota grace: root= bytes=536870912 (10%) Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Namespace : type=shared, prefix=shared/%n/, sep=/, inbox=no, hidden=no, list=children, subscriptions=no location=maildir:/var/vmail/%u/Maildir:LAYOUT=fs:DIRNAME=mAildir:INDEX=/var/vmail/test/shared/%u
Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: shared: root=/var/run/dovecot, index=, indexpvt=, control=, inbox=, alt= Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: initializing backend with data: vfile Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: acl username = test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: owner = 0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl vfile: Global ACLs disabled Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Namespace inbox: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/var/vmail/test/Maildir:LAYOUT=fs:DIRNAME=mAildir Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: fs: root=/var/vmail/test/Maildir, index=, indexpvt=, control=, inbox=, alt= Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: initializing backend with data: vfile Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: acl username = test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: owner = 1 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl vfile: Global ACLs disabled Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: quota: quota_over_flag check: quota_over_script unset - skipping Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota root: name= backend=maildir args= Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota rule: root= mailbox=? bytes=5368709120 messages=0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota rule: root= mailbox=Trash bytes=+104857600 messages=0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5207647846 (97%) messages=0 reverse=no command=quota-warning 97 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5100273664 (95%) messages=0 reverse=no command=quota-warning 95 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4831838208 (90%) messages=0 reverse=no command=quota-warning 90 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4563402752 (85%) messages=0 reverse=no command=quota-warning 85 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4294967296 (80%) messages=0 reverse=no command=quota-warning 80 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5368709120 (100%) messages=0 reverse=yes command=quota-warning below raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota grace: root= bytes=536870912 (10%) Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: quota: quota_over_flag check: quota_over_script unset - skipping Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Destination address: test@company.com (source: -a parameter) Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Pigeonhole version 0.5.4 () initializing Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: include: sieve_global is not set; it is currently not possible to include
:global' scripts. Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Using active Sieve script path: /var/vmail/test/.dovecot.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Using script storage path: /var/vmail/test/sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Relative path to sieve storage in active link: sieve/ Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Using Sieve script path: /var/vmail/test/.dovecot.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Storage path
/var/vmail/test/.dovecot.sieve' not found Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Using Sieve script path: /var/lib/dovecot/default.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file script: Opened scriptdefault' from
/var/lib/dovecot/default.sieve' Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Using the following location for user's Sieve script: /var/lib/dovecot/default.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Opening script 1 of 1 from/var/lib/dovecot/default.sieve' Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Loading script /var/lib/dovecot/default.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Script binary /var/lib/dovecot/default.svbin successfully loaded Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: binary save: not saving binary /var/lib/dovecot/default.svbin, because it is already stored Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Executing script from
/var/lib/dovecot/default.svbin' Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Mailbox INBOX: Mailbox opened because: lib-lda delivery Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota root : Recalculated relative rules with bytes=1400000 count=0. Now grace=140000 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Mailbox INBOX: saving UID 0: Opened mail because: mail stream Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: save: box=INBOX, uid=20, msgid=46e7b334-80a0-3a99-4494-bc6fd07aa3db@external.com, from=user name user@external.com, subject=test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: sieve: user@external.com | test | msgid=46e7b334-80a0-3a99-4494-bc6fd07aa3db@external.com: stored mail into mailbox 'INBOX' Dec 15 13:56:07 mail postfix/pipe[20088]: 76722819170D6: to=test@company.com, relay=dovecot, delay=0.24, delays=0.2/0.02/0/0.03, dsn=2.0.0, status=sent (delivered via dovecot service) Dec 15 13:56:07 mail postfix/qmgr[19577]: 76722819170D6: removedI would appreciate any help. :-)
Finally, our dovecont -n running-config:
root@dovecot:# dovecot -n # 2.3.4.1 (f79e8e7e4): /etc/dovecot/dovecot.conf # Pigeonhole version 0.5.4 () # OS: Linux 4.19.0-17-amd64 x86_64 Debian 10.11 xfs # Hostname: mail.company.com auth_debug = yes auth_failure_delay = 10 secs auth_master_user_separator = * auth_mechanisms = plain login auth_username_format = %Ln auth_verbose = yes auth_verbose_passwords = sha1 default_vsz_limit = 512 M deliver_log_format = %f | %s | msgid=%m: %$ lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes login_greeting = Dovecot ready. login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c lport=%a mail_gid = vmail mail_location = maildir:/var/vmail/%Ln/Maildir:LAYOUT=fs:DIRNAME=mAildir mail_plugins = acl lazy_expunge zlib quota mail_log notify mail_shared_explicit_inbox = yes mail_uid = vmail 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 { list = children location = maildir:/var/vmail/%%u/Maildir:LAYOUT=fs:DIRNAME=mAildir:INDEX=/var/vmail/%u/shared/%%u
prefix = shared/%%n/ separator = / subscriptions = no type = shared } namespace inbox { inbox = yes location = mailbox "Deleted items" { special_use = \Trash } mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent items" { special_use = \Sent } mailbox Trash { special_use = \Trash } mailbox inbox { auto = subscribe } prefix = separator = / type = private } passdb { args = /etc/dovecot/deny.imap deny = yes driver = passwd-file } passdb { args = /etc/dovecot/master-users driver = passwd-file master = yes } passdb { args = /etc/dovecot/dovecot-ldap.conf.ext driver = ldap result_failure = return-fail } plugin { acl = vfile acl_shared_dict = file:/var/lib/dovecot/db/shared-mailboxes.db mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename append mail_log_fields = uid box msgid from subject quota = maildir quota_rule = ?:storage=5G quota_rule2 = Trash:storage=+100M quota_warning = storage=97%% quota-warning 97 %u quota_warning2 = storage=95%% quota-warning 95 %u quota_warning3 = storage=90%% quota-warning 90 %u quota_warning4 = storage=85%% quota-warning 85 %u quota_warning5 = storage=80%% quota-warning 80 %u quota_warning6 = -storage=100%% quota-warning below %u sieve = ~/.dovecot.sieve sieve_default = /var/lib/dovecot/default.sieve sieve_dir = ~/sieve } protocols = imap lmtp sieve service auth { unix_listener /var/spool/postfix/private/auth { mode = 0666 } unix_listener auth-userdb { group = vmail mode = 0666 user = vmail } } service imap-login { process_limit = 500 process_min_avail = 2 } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { mode = 0666 user = vmail } user = vmail } service stats { unix_listener stats-reader { group = vmail mode = 0666 user = vmail } unix_listener stats-writer { group = vmail mode = 0666 user = vmail } } shutdown_clients = no ssl = required ssl_cert =
ssl_dh = # hidden, use -P to show it ssl_key = # hidden, use -P to show it ssl_min_protocol = TLSv1.2 userdb { args = uid=vmail gid=vmail home=/var/vmail/%n allow_all_users=yes driver = static } userdb { args = /etc/dovecot/dovecot-ldap.conf.ext driver = ldap } verbose_proctitle = yes protocol lda { mail_plugins = acl lazy_expunge zlib quota mail_log notify sieve quota } protocol imap { imap_max_line_length = 2 M mail_max_userip_connections = 40 mail_plugins = acl lazy_expunge zlib quota mail_log notify imap_quota imap_acl }
Thanks very much for your help!
MJ
-- Christian Mack Universität Konstanz Kommunikations-, Informations-, Medienzentrum (KIM) Abteilung IT-Dienste Forschung und Lehre 78457 Konstanz +49 7531 88-4416
Hi Christian,
Thanks for replying!
It seems that your comments (or perhaps some of my recent config tinkering) helped, because once I tried just now to make it go from 89% to 91%, and I did receive the quota warning!
Thanks!
MJ
Op 15-12-2021 om 15:23 schreef Christian Mack:
Hello
Just to clarify. You only will getting an over quota once, you step over one or multiple of those quota warning limits while storing an email.
Therefore you will not get any warning, just because you are over that 85% limit. If you receive another email in that account, and go at least over 90%, then dovecot will call your script once. If you also go over 100% with that same mail, you will not get one for 90% or 95%, but only one for 100%.
You also should check, if you have any environment variables set, which are not present, when your script is run by dovecot. Do you have any logging in it?
Kind regards, Christian Mack
Am 15.12.21 um 14:06 schrieb mj:
Hi,
I am still struggling with this, and would appreciate any help ayone can give. Let me try to explain step for step.
I created a test account test@company.com:
root@dovecot:/# doveadm quota get -u test Quota name Type Value Limit % STORAGE 1209 1368 88 MESSAGE 35
0
As you can see, the test mailbox is 88% full, so it should receive warnings, because in dovecot.conf I have set:
plugin { quota = maildir quota_rule = ?:storage=5G quota_rule2 = Trash:storage=+100M quota_warning = storage=97%% quota-warning 97 %u quota_warning2 = storage=95%% quota-warning 95 %u quota_warning3 = storage=90%% quota-warning 90 %u quota_warning4 = storage=85%% quota-warning 85 %u quota_warning5 = storage=80%% quota-warning 80 %u quota_warning6 = -storage=100%% quota-warning below %u }
We use a script to send out the email warnings, configured like this:
service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { user = vmail mode = 0666 } user = vmail }
When running this script manually as vmail, the warning is delivered to the test user:
sudo -H -u vmail bash -c '/usr/local/bin/quota-warning.sh 90 test'
However, in practice: dovecot never sends out any quota-warnings. It just starts generating delivery failures when the mailbox is over 100%.
We define the per-user quota in the first line of each user's maildirsize file, for the test user: /var/vmail/test/Maildir/maildirsize
Here is a debug=yes log file of 88% full incoming mailbox delivery:
Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Loading modules from directory: /usr/lib/dovecot/modules Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib01_acl_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib02_lazy_expunge_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib15_notify_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib20_mail_log_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib20_zlib_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: Module loaded: /usr/lib/dovecot/modules/lib90_sieve_plugin.so Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: auth USER input: test uid=5000 gid=5000 home=/var/vmail/test Dec 15 13:56:07 mail dovecot: auth: Debug: master in: USER#0111#011test@company.com#011service=lda Dec 15 13:56:07 mail dovecot: auth: Debug: userdb out: USER#0111#011test#011uid=5000#011gid=5000#011home=/var/vmail/test Dec 15 13:56:07 mail dovecot: lda(test@company.com)<20290><>: Debug: changed username to test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Effective uid=5000, gid=5000, home=/var/vmail/test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: lazy_expunge: No lazy_expunge setting - plugin disabled Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota root: name= backend=maildir args= Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota rule: root= mailbox=? bytes=5368709120 messages=0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota rule: root= mailbox=Trash bytes=+104857600 messages=0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5207647846 (97%) messages=0 reverse=no command=quota-warning 97 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5100273664 (95%) messages=0 reverse=no command=quota-warning 95 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4831838208 (90%) messages=0 reverse=no command=quota-warning 90 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4563402752 (85%) messages=0 reverse=no command=quota-warning 85 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4294967296 (80%) messages=0 reverse=no command=quota-warning 80 test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5368709120 (100%) messages=0 reverse=yes command=quota-warning below test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota grace: root= bytes=536870912 (10%) Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Namespace : type=shared, prefix=shared/%n/, sep=/, inbox=no, hidden=no, list=children, subscriptions=no location=maildir:/var/vmail/%u/Maildir:LAYOUT=fs:DIRNAME=mAildir:INDEX=/var/vmail/test/shared/%u
Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: shared: root=/var/run/dovecot, index=, indexpvt=, control=, inbox=, alt= Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: initializing backend with data: vfile Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: acl username = test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: owner = 0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl vfile: Global ACLs disabled Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Namespace inbox: type=private, prefix=, sep=/, inbox=yes, hidden=no, list=yes, subscriptions=yes location=maildir:/var/vmail/test/Maildir:LAYOUT=fs:DIRNAME=mAildir Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: fs: root=/var/vmail/test/Maildir, index=, indexpvt=, control=, inbox=, alt= Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: initializing backend with data: vfile Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: acl username = test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl: owner = 1 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: acl vfile: Global ACLs disabled Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: quota: quota_over_flag check: quota_over_script unset - skipping Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota root: name= backend=maildir args= Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota rule: root= mailbox=? bytes=5368709120 messages=0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota rule: root= mailbox=Trash bytes=+104857600 messages=0 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5207647846 (97%) messages=0 reverse=no command=quota-warning 97 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5100273664 (95%) messages=0 reverse=no command=quota-warning 95 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4831838208 (90%) messages=0 reverse=no command=quota-warning 90 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4563402752 (85%) messages=0 reverse=no command=quota-warning 85 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=4294967296 (80%) messages=0 reverse=no command=quota-warning 80 raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota warning: bytes=5368709120 (100%) messages=0 reverse=yes command=quota-warning below raw mail user Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota grace: root= bytes=536870912 (10%) Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: quota: quota_over_flag check: quota_over_script unset - skipping Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Destination address: test@company.com (source: -a parameter) Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Pigeonhole version 0.5.4 () initializing Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: include: sieve_global is not set; it is currently not possible to include
:global' scripts. Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Using active Sieve script path: /var/vmail/test/.dovecot.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Using script storage path: /var/vmail/test/sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Relative path to sieve storage in active link: sieve/ Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Using Sieve script path: /var/vmail/test/.dovecot.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Storage path
/var/vmail/test/.dovecot.sieve' not found Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file storage: Using Sieve script path: /var/lib/dovecot/default.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: file script: Opened scriptdefault' from
/var/lib/dovecot/default.sieve' Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Using the following location for user's Sieve script: /var/lib/dovecot/default.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Opening script 1 of 1 from/var/lib/dovecot/default.sieve' Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Loading script /var/lib/dovecot/default.sieve Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Script binary /var/lib/dovecot/default.svbin successfully loaded Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: binary save: not saving binary /var/lib/dovecot/default.svbin, because it is already stored Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: sieve: Executing script from
/var/lib/dovecot/default.svbin' Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Mailbox INBOX: Mailbox opened because: lib-lda delivery Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Quota root : Recalculated relative rules with bytes=1400000 count=0. Now grace=140000 Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: Debug: Mailbox INBOX: saving UID 0: Opened mail because: mail stream Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: save: box=INBOX, uid=20, msgid=46e7b334-80a0-3a99-4494-bc6fd07aa3db@external.com, from=user name user@external.com, subject=test Dec 15 13:56:07 mail dovecot: lda(test)<20290><cqPGJOfluWFCTwAA4uZ9mg>: sieve: user@external.com | test | msgid=46e7b334-80a0-3a99-4494-bc6fd07aa3db@external.com: stored mail into mailbox 'INBOX' Dec 15 13:56:07 mail postfix/pipe[20088]: 76722819170D6: to=test@company.com, relay=dovecot, delay=0.24, delays=0.2/0.02/0/0.03, dsn=2.0.0, status=sent (delivered via dovecot service) Dec 15 13:56:07 mail postfix/qmgr[19577]: 76722819170D6: removedI would appreciate any help. :-)
Finally, our dovecont -n running-config:
root@dovecot:# dovecot -n # 2.3.4.1 (f79e8e7e4): /etc/dovecot/dovecot.conf # Pigeonhole version 0.5.4 () # OS: Linux 4.19.0-17-amd64 x86_64 Debian 10.11 xfs # Hostname: mail.company.com auth_debug = yes auth_failure_delay = 10 secs auth_master_user_separator = * auth_mechanisms = plain login auth_username_format = %Ln auth_verbose = yes auth_verbose_passwords = sha1 default_vsz_limit = 512 M deliver_log_format = %f | %s | msgid=%m: %$ lda_mailbox_autocreate = yes lda_mailbox_autosubscribe = yes login_greeting = Dovecot ready. login_log_format_elements = user=<%u> method=%m rip=%r lip=%l mpid=%e %c lport=%a mail_gid = vmail mail_location = maildir:/var/vmail/%Ln/Maildir:LAYOUT=fs:DIRNAME=mAildir mail_plugins = acl lazy_expunge zlib quota mail_log notify mail_shared_explicit_inbox = yes mail_uid = vmail 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 { list = children location = maildir:/var/vmail/%%u/Maildir:LAYOUT=fs:DIRNAME=mAildir:INDEX=/var/vmail/%u/shared/%%u
prefix = shared/%%n/ separator = / subscriptions = no type = shared } namespace inbox { inbox = yes location = mailbox "Deleted items" { special_use = \Trash } mailbox Drafts { special_use = \Drafts } mailbox Junk { special_use = \Junk } mailbox Sent { special_use = \Sent } mailbox "Sent items" { special_use = \Sent } mailbox Trash { special_use = \Trash } mailbox inbox { auto = subscribe } prefix = separator = / type = private } passdb { args = /etc/dovecot/deny.imap deny = yes driver = passwd-file } passdb { args = /etc/dovecot/master-users driver = passwd-file master = yes } passdb { args = /etc/dovecot/dovecot-ldap.conf.ext driver = ldap result_failure = return-fail } plugin { acl = vfile acl_shared_dict = file:/var/lib/dovecot/db/shared-mailboxes.db mail_log_events = delete undelete expunge copy mailbox_delete mailbox_rename append mail_log_fields = uid box msgid from subject quota = maildir quota_rule = ?:storage=5G quota_rule2 = Trash:storage=+100M quota_warning = storage=97%% quota-warning 97 %u quota_warning2 = storage=95%% quota-warning 95 %u quota_warning3 = storage=90%% quota-warning 90 %u quota_warning4 = storage=85%% quota-warning 85 %u quota_warning5 = storage=80%% quota-warning 80 %u quota_warning6 = -storage=100%% quota-warning below %u sieve = ~/.dovecot.sieve sieve_default = /var/lib/dovecot/default.sieve sieve_dir = ~/sieve } protocols = imap lmtp sieve service auth { unix_listener /var/spool/postfix/private/auth { mode = 0666 } unix_listener auth-userdb { group = vmail mode = 0666 user = vmail } } service imap-login { process_limit = 500 process_min_avail = 2 } service quota-warning { executable = script /usr/local/bin/quota-warning.sh unix_listener quota-warning { mode = 0666 user = vmail } user = vmail } service stats { unix_listener stats-reader { group = vmail mode = 0666 user = vmail } unix_listener stats-writer { group = vmail mode = 0666 user = vmail } } shutdown_clients = no ssl = required ssl_cert =
ssl_dh = # hidden, use -P to show it ssl_key = # hidden, use -P to show it ssl_min_protocol = TLSv1.2 userdb { args = uid=vmail gid=vmail home=/var/vmail/%n allow_all_users=yes driver = static } userdb { args = /etc/dovecot/dovecot-ldap.conf.ext driver = ldap } verbose_proctitle = yes protocol lda { mail_plugins = acl lazy_expunge zlib quota mail_log notify sieve quota } protocol imap { imap_max_line_length = 2 M mail_max_userip_connections = 40 mail_plugins = acl lazy_expunge zlib quota mail_log notify imap_quota imap_acl }
Thanks very much for your help!
MJ
participants (2)
-
Christian Mack
-
mj