- Edited
The quota_notify.py has fatal error when executed by the system, when executed manually it works.
It seems it’s unable to get the REDISPASS from the OS environment.
Log:
dovecot-mailcow-1 | Feb 10 11:03:30 f988b5f2c60c dovecot: imap-login: Disconnected: Aborted login by logging out (no auth attempts in 0 secs): user=<>, rip=172.22.1.12, lip=172.22.1.250, TLS, TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error: Traceback (most recent call last):
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error: File “/usr/local/bin/quota_notify.py”, line 26, in <module>
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error: r = redis.StrictRedis(host=‘redis’, decode_responses=True, port=6379, db=0, password=os.environ[‘REDISPASS’])
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error:~~~~~^^^^^^^^^^^^^
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error: File “<frozen os>”, line 714, in getitem
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error: KeyError: ‘REDISPASS’
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error:
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error: During handling of the above exception, another exception occurred:
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error:
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error: Traceback (most recent call last):
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error: File “/usr/local/bin/quota_notify.py”, line 29, in <module>
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error: print(‘%s - trying again…’ % (ex))
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Error: BrokenPipeError: [Errno 32] Broken pipe
dovecot-mailcow-1 | Feb 10 11:03:31 f988b5f2c60c dovecot: quota-warning: Fatal: master: service(quota-warning): child 237297 returned error 1
dovecot-mailcow-1 | Feb 10 11:03:32 f988b5f2c60c dovecot: imap-login: Login: user=example@example.com, method=PLAIN, rip=172.22.1.248, lip=172.22.1.250, mpid=239076
Steps:
- Create a test mailbox with 10 MB quota
- Sent mail with 8 MB so quota notification is triggered, wait for 1-2 minutes after email is received
- See quota_notify.py fatal error in docker logs (docker compose logs -f dovecot-mailcow | grep quota)
For manual execution connect to dovecot-mailcow and execute it manually.
docker compose exec -it dovecot-mailcow /bin/bash
/usr/local/bin/quota_notify.py 90 testmail@example.com
In the dovecot container:
printenv returns the REDISPASS
Pythons version is 3.12.8
Can someone reproduce this?
Thanks