Closed tmkis2 closed 2 years ago
same here, sending quarantine mail notifications stopped after upgrade to 2022-08(a)
Update: maybe related to quarantine_notify.pid:
ofelia logs: mailcowdockerized-ofelia-mailcow-1 | 2022-09-03T21:32:55.573+02:00 [32m common.go:125 ▶ NOTICE[0m [Job "dovecot_quarantine" (f9251ecfa21b)] StdOut: /tmp/quarantine_notify.pid already exists, exiting mailcowdockerized-ofelia-mailcow-1 | 2022-09-03T21:32:55.573+02:00 [32m common.go:125 ▶ NOTICE[0m [Job "dovecot_quarantine" (f9251ecfa21b)] Finished in "558.809894ms", failed: false, skipped: false, error: none
in quarantine_notify.py ~#22
pidfile = "/tmp/quarantine_notify.pid"
if os.path.isfile(pidfile):
print("%s already exists, exiting" % (pidfile))
sys.exit()
so quarantine_notify.py never fully runs...
Update II: restarted dovecot and then the ofelia container, quarantine_notify.pid file is gone...
mailcowdockerized-ofelia-mailcow-1 | 2022-09-06T15:28:49.014+02:00 common.go:125 ▶ NOTICE [Job "dovecot_quarantine" (37449573657f)] Started - /bin/bash -c "[[ ${MASTER} == y ]] && /usr/local/bin/gosu vmail /usr/local/bin/quarantine_notify.py || exit 0"
but after the first run of quarantine_notify.py the quarantine_notify.pid file is not deleted...
Update III:
found this error is the ofelia-log:
mailcowdockerized-ofelia-mailcow-1 | 2022-09-06T09:32:55.227+02:00 [31m common.go:121 ▶ ERROR[0m [Job "dovecot_quarantine" (ddea2612b22b)] StdOut: 1273 (HY000): Unknown collation: 'utf8mb4_0900_ai_ci' - trying again...
followed by thousand's of this lines: mailcowdockerized-ofelia-mailcow-1 | Character set 'utf8' unsupported - trying again...
sorry, still not working with latest Amoogust Update 2022 Revision B...
ofelia-log: mailcowdockerized-ofelia-mailcow-1 | 2022-09-08T15:49:57.667+02:00 [32m common.go:125 ▶ NOTICE[0m [Job "dovecot_quarantine" (b7be5efa6c49)] StdOut: /tmp/quarantine_notify.pid already exists, exiting mailcowdockerized-ofelia-mailcow-1 | 2022-09-08T15:49:57.667+02:00 [32m common.go:125 ▶ NOTICE[0m [Job "dovecot_quarantine" (b7be5efa6c49)] Finished in "646.59802ms", failed: false, skipped: false, error: none
pip3 show mysql-connector-python Name: mysql-connector-python Version: 8.0.30 Summary: MySQL driver written in Python Home-page: http://dev.mysql.com/doc/connector-python/en/index.html -> https://stackoverflow.com/questions/73244027/character-set-utf8-unsupported-in-python-mysql-connector -> https://downloads.mysql.com/docs/connector-python-relnotes-en.pdf
Confirmed, same here with version 2022-08a and 2022-08b as well
Confirmed: Still doesn't work in 2022-08b
Confirmed: Same here on 20.04.5 LTS, mailcow 2022-08b.
We could downgrade mysql-connector-python to 8.0.29, but I dont like having to pinpoint such release We could also upgrade mariadb I guess - didnt test it yet We could also install mariadb pip package and use this to connect to a mariadb server - works too on my side
Will dig a bit deeper on this
@DerLinkman any suggestion which part we should use?
Does it come from mariadb? Or the connector in general?
Basicly the current latest release of mysql-connector-python is aliasing utf8 to utf8mb4 which the mariadb doesn't handle at the moment. I am not sure if an update to a newer mariadb will solve this issue. If we downgrade the connector the alias is not there and we can connect to the DB. If we upgrade the DB we may can connect (need to check newer changelogs first). If we use the mariadb connector we don't need to set a charset, but the image will be a bit bigger because of the dependencies we need to install
We should consider a update to mariadb:10.6 anyway in the near future so i would say we´ll try this. With a lot of tests of course.
I´ll try a update on my test maschine tomorrow but i doubt that it will work flawlessly.
@MAGICCC if you take a look at the init-db.inc.php https://github.com/mailcow/mailcow-dockerized/blob/master/data/web/inc/init_db.inc.php you can see that the tables are already using utf8mb4 as the default char set.
Indeed @DerLinkman..
That's why I just gave it a second shot with the latest mysql-connector-python package and when using following line in quarantine_notify.py
the script can connect to the DB and fetches the mails
- cnx = mysql.connector.connect(unix_socket = '/var/run/mysqld/mysqld.sock', user=os.environ.get('DBUSER'), passwd=os.environ.get('DBPASS'), database=os.environ.get('DBNAME'), charset="utf8")
+ cnx = mysql.connector.connect(unix_socket = '/var/run/mysqld/mysqld.sock', user=os.environ.get('DBUSER'), passwd=os.environ.get('DBPASS'), database=os.environ.get('DBNAME'), charset="utf8mb4", collation="utf8mb4_general_ci")
Would be nice if you can check it on your side too
Yes that works perfectly. Can you create a PR about that?
We should consider a update to mariadb:10.6 anyway in the near future so i would say we´ll try this. With a lot of tests of course.
Currently testing this. Right now it looks good.
We should consider a update to mariadb:10.6 anyway in the near future so i would say we´ll try this. With a lot of tests of course.
Currently testing this. Right now it looks good.
Would apprectiate it if you could also test it (update mariadb:10.5 to 10.6 in docker-compose.yml)
Done, tested it with mariadb:10.6
Ok 10.6 works for you flawlessly? I mean especially the upgrade process.
Yes, I pulled the image, did a compose down and a up -d and it upgraded fine. We should test it with some users if they have some test boxes too
Yeah definately. Probably doing this inside of nightly maybe.
Is there any update on this? :)
Confirmed: Same here on Debian 11 Bullseye, mailcow 2022-08b.
Will be fixed in 2022-09 (probably tomorrow)
Contribution guidelines
I've found a bug and checked that ...
Description
Quarantine Mails still works but no notification is sent to users mailbox regardless of setting it to 1 hour, 24 hours or something else
Logs
Steps to reproduce
Enable Quarantine notifications to 1 hour - get some quarantined messages - wait
System information
docker version
)docker-compose version
)git describe --tags `git rev-list --tags --max-count=1`
)Output of
git diff origin/master
, any other changes to the code? If so, please post them:All third-party firewalls and custom iptables rules are unsupported. Please check the Docker docs about how to use Docker with your own ruleset. Nevertheless, iptabels output can help us to help you: iptables -L -vn:
ip6tables -L -vn:
iptables -L -vn -t nat:
ip6tables -L -vn -t nat:
DNS problems? Please run
docker exec -it $(docker ps -qf name=acme-mailcow) dig +short stackoverflow.com @172.22.1.254
(set the IP accordingly, if you changed the internal mailcow network) and post the output: