Re: quota warnings not sent out anymore

2021-12-15 Thread mj

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 t...@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(t...@company.com)<20290><>: Debug:
Loading modules from directory: /usr/lib/dovecot/modules
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
Module loaded: /usr/lib/dovecot/modules/lib01_acl_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
Module loaded: /usr/lib/dovecot/modules/lib02_lazy_expunge_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
Module loaded: /usr/lib/dovecot/modules/lib15_notify_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
Module loaded: /usr/lib/dovecot/modules/lib20_mail_log_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
Module loaded: /usr/lib/dovecot/modules/lib20_zlib_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
Module loaded: /usr/lib/dovecot/modules/lib90_sieve_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@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#011t...@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(t...@company.com)<20290><>: Debug:
changed username to test
Dec 15 13:56:07 mail dovecot:
lda(test)<20290>: Debug: Effective uid=5000,
gid=5000, home=/var/vmail/test
Dec 15 13:56:07 mail dovecot:
lda(test)<20290>: Debug: lazy_expunge: No
lazy_expunge setting - plugin disabled
Dec 15 13:56:07 mail dovecot:
lda(test)<20290>: Debug: Quota root: name=
backend=maildir args=
Dec 15 13:56:07 mail dovecot:
lda(test)<20290>: Debug: Quota rule: root=
mailbox=? bytes=5368709120 messages=0
Dec 15 13:56:07 mail dovecot:
lda(test)<20290>: Debug: Quota rule: root=
mailbox=Trash bytes=+104857600 messages=0
Dec 15 13:56:07 mail dovecot:
lda(test)<20290>: 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>: 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>: Debug: Quota warning:
bytes=4831838208 (90%) messages=0 reverse=no 

Re: quota warnings not sent out anymore

2021-12-15 Thread 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 t...@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(t...@company.com)<20290><>: Debug:
>> Loading modules from directory: /usr/lib/dovecot/modules
>> Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
>> Module loaded: /usr/lib/dovecot/modules/lib01_acl_plugin.so
>> Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
>> Module loaded: /usr/lib/dovecot/modules/lib02_lazy_expunge_plugin.so
>> Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
>> Module loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so
>> Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
>> Module loaded: /usr/lib/dovecot/modules/lib15_notify_plugin.so
>> Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
>> Module loaded: /usr/lib/dovecot/modules/lib20_mail_log_plugin.so
>> Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
>> Module loaded: /usr/lib/dovecot/modules/lib20_zlib_plugin.so
>> Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug:
>> Module loaded: /usr/lib/dovecot/modules/lib90_sieve_plugin.so
>> Dec 15 13:56:07 mail dovecot: lda(t...@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#011t...@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(t...@company.com)<20290><>: Debug:
>> changed username to test
>> Dec 15 13:56:07 mail dovecot:
>> lda(test)<20290>: Debug: Effective uid=5000,
>> gid=5000, home=/var/vmail/test
>> Dec 15 13:56:07 mail dovecot:
>> lda(test)<20290>: Debug: lazy_expunge: No
>> lazy_expunge setting - plugin disabled
>> Dec 15 13:56:07 mail dovecot:
>> lda(test)<20290>: Debug: Quota root: name=
>> backend=maildir args=
>> Dec 15 13:56:07 mail dovecot:
>> lda(test)<20290>: Debug: Quota rule: root=
>> mailbox=? bytes=5368709120 messages=0
>> Dec 15 13:56:07 mail dovecot:
>> lda(test)<20290>: Debug: Quota rule: root=
>> mailbox=Trash bytes=+104857600 messages=0
>> Dec 15 13:56:07 mail dovecot:
>> lda(test)<20290>: Debug: Quota warning:
>> bytes=5207647846 (97%) messages=0 reverse=no 

Re: quota warnings not sent out anymore

2021-12-15 Thread 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 t...@company.com:


root@dovecot:/# doveadm quota get -u test
Quota name TypeValue Limit  
  %
   STORAGE  1209  1368  
 88
   MESSAGE35 -  
  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(t...@company.com)<20290><>: Debug: Loading 
modules from directory: /usr/lib/dovecot/modules
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug: Module 
loaded: /usr/lib/dovecot/modules/lib01_acl_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug: Module 
loaded: /usr/lib/dovecot/modules/lib02_lazy_expunge_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug: Module 
loaded: /usr/lib/dovecot/modules/lib10_quota_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug: Module 
loaded: /usr/lib/dovecot/modules/lib15_notify_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug: Module 
loaded: /usr/lib/dovecot/modules/lib20_mail_log_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug: Module 
loaded: /usr/lib/dovecot/modules/lib20_zlib_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@company.com)<20290><>: Debug: Module 
loaded: /usr/lib/dovecot/modules/lib90_sieve_plugin.so
Dec 15 13:56:07 mail dovecot: lda(t...@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#011t...@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(t...@company.com)<20290><>: Debug: changed 
username to test
Dec 15 13:56:07 mail dovecot: lda(test)<20290>: Debug: 
Effective uid=5000, gid=5000, home=/var/vmail/test
Dec 15 13:56:07 mail dovecot: lda(test)<20290>: Debug: 
lazy_expunge: No lazy_expunge setting - plugin disabled
Dec 15 13:56:07 mail dovecot: lda(test)<20290>: Debug: 
Quota root: name= backend=maildir args=
Dec 15 13:56:07 mail dovecot: lda(test)<20290>: Debug: 
Quota rule: root= mailbox=? bytes=5368709120 messages=0
Dec 15 13:56:07 mail dovecot: lda(test)<20290>: Debug: 
Quota rule: root= mailbox=Trash bytes=+104857600 messages=0
Dec 15 13:56:07 mail dovecot: lda(test)<20290>: 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>: 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>: 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>: 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>: 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>: 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>: Debug: 
Quota grace: root= bytes=536870912 (10%)
Dec 15 13:56:07 mail dovecot: lda(test)<20290>: Debug: 
Namespace 

Re: quota warnings not sent out anymore

2021-12-08 Thread mj

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>: 
Debug: fs: root=/var/vmail/username/Maildir, index=, indexpvt=, control=, inbox=, alt=
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
Debug: acl: initializing backend with data: vfile
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
Debug: acl: acl username = username
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
Debug: acl: owner = 1
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
Debug: acl vfile: Global ACLs disabled
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
Debug: quota: quota_over_flag check: quota_over_script unset - skipping
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
Debug: Quota root: name= backend=maildir args=
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
Debug: Quota rule: root= mailbox=? bytes=5368709120 messages=0
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
Debug: Quota rule: root= mailbox=Trash bytes=+104857600 messages=0
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
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>: 
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>: 
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>: 
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>: 
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>: 
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>: 
Debug: Quota grace: root= bytes=536870912 (10%)
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
Debug: quota: quota_over_flag check: quota_over_script unset - skipping
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: Debug: 
Destination address:  (source: -a parameter)
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
Debug: Mailbox INBOX: Mailbox opened because: lib-lda delivery
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
Debug: Quota root : Recalculated relative rules with bytes=15737418240 count=0. Now 
grace=1573741824
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: 
Debug: Mailbox INBOX: saving UID 0: Opened mail because: mail stream
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: save: 
box=INBOX, uid=86077, msgid=, 
from=, subject=test
Dec  8 11:31:57 mail dovecot: lda(username)<14734>: sieve: 
usern...@gmail.com | test | msgid=: 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


Re: quota warnings not sent out anymore

2021-12-06 Thread mj
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: nore...@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 {
  

quota warnings not sent out anymore

2021-12-06 Thread 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: nore...@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 rootroot  0 Dec  6 00:00 anvil
srw--- 1 rootroot  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 rootroot  0 Dec  6 11:34 auth-master
-rw--- 1 rootroot 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 rootroot  0 Dec  6 11:34 config
srw-rw 1 rootdovecot   0 Dec  6 11:34 dict
srw-rw 1 rootdovecot   0 Dec  6 11:34 dict-async
srw--- 1 rootroot  0 Dec  6 11:34 director-admin
srw-rw-rw- 1 rootroot  0 Dec  6 11:34 dns-client
srw--- 1 rootroot  0 Dec  6 11:34 doveadm-server
lrwxrwxrwx 1 rootroot 25 Dec  6 00:00 dovecot.conf -> 
/etc/dovecot/dovecot.conf
drwxr-xr-x 2 rootroot 40 Jul 19 17:39 empty
srw-rw 1 rootdovecot   0 Dec  6 11:34 imap-hibernate
srw--- 1 rootroot  0 Dec  6 11:34 imap-master
srw-rw-rw- 1 rootroot  0 Dec  6 11:34 imap-urlauth
srw--- 1 dovecot root  0 Dec  6 11:34 imap-urlauth-worker
srw-rw-rw- 1 rootroot  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 rootroot  0 Dec  6 11:34 lmtp
srw--- 1 rootroot  0 Dec  6 11:34 log-errors
drwxr-x--- 2 rootnogroup 120 Dec  6 11:34 login
srw--- 1 rootroot  0 Dec  6 11:34 master
-rw--- 1 rootroot  6 Dec  6 00:00 master.pid
srw--- 1 rootroot  0 Dec  6 11:34 old-stats
prw--- 1 rootroot  0 Dec  6 11:34 old-stats-mail
prw--- 1 rootroot  0 Dec  6 11:34 old-stats-user
srw--- 1 vmail   root  0 Dec  6 11:34 quota-warning
srw--- 1 rootroot  0 Dec  6 11:34 replication-notify
prw--- 1 rootroot  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 rootnogroup  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 =