MailWatch unable to connect to database after upgrading to MariaDB 10.6.5
Issue summary
MailWatch is unable to connect to the MariaDB database, emitting the error. As a workaround, you can edit the '/usr/share/mysql/charsets/Index.xml' file and make a copy of "utf8mb3" block and change this new block's charset name to "utf8" as described here (https://jira.mariadb.org/browse/MDEV-26863). It appears that RoundCube has fixed a similar issue in a later release (also noted here, in the comment section at bottom: https://jira.mariadb.org/browse/MDEV-26863).
Steps to reproduce
- Upgrade to MariaDB 10.6.5
- Run "MailScanner --lint" in terminal
Expected result
No error should be emitted and it should connect to the MariaDB database.
Actual result
Error is generated stating "Character set 'utf8' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file" and it cannot connect to the MariaDB database.
Installation
Version and method
- MailWatch Version: stable 1.2.18
- Install type: Zip install (CyberPanel)
- Updated from an older MailWatch or fresh install: fresh install
Server configuration
- Operation System: CentOS 7
- PHP version: 7.4
- Database: MariaDB 10.6.5
- Mail Server: Postfix
- Used web server: OpenLiteSpeed
Client configuration
- Operation System: Windows 11
- Browser: Chromium Edge
I ran into this as well after noticing the MariaDB 10.2 repo was gone and subsequently trying to upgrade to 10.9. (ended up rolling back to 10.2 via the mariadb archive repo) I don't know enough about perl to create a patch but a new future proof 'utf8' standard should probably be added depending on mariadb version ?
Due to the backward compatibility promise of 1.2 branch MailWatch must support old version of MySQL and their choice to support an incomplete set of UTF8 back in the days. ATM the workaround reported by OP is a quick fix of this issue that doesn't nedd a complete rewrite of the UTF8 stack.