Problems with CentOS 5.9, Postfix and MySQL
The latest version of CentOS, 5.9, has updated their Postfix (an SMTP mail server) package to require mysql because it now supports reading user and domain lists from a MySQL database.
Unfortunately this has caused issues with anyone using the Oracle or MariaDB MySQL distributions.
Update 2013-02-27
The folks over at RedHat have fixed the bug I logged within 1 day!
There is a new postfix RPM available that removes the dependency of "mysql", and instead only requires "libmysqlclient.so.15", which is satisfied by either MySQL-shared-compat or MariaDB-compat. Open Source for the win.
Its all about Requires
Software for any RedHat based operating system is packaged using an RPM (RedHat Package Manager) file. These files describe what features the software requires and provides to the system, along with what files it contains.
The postfix package in CentOS 5.9 requires the "mysql" package.
The "mysql" package in CentOS 5.9 provides the MySQL 5.0 client utility for accessing MySQL servers.
The problems arise when trying to use either Oracle's MySQL or MariaDB packages.
The latest version of Oracle's MySQL 5.5 series is 5.5.30. None of its packages now claim to provide "mysql", which means when installing Postfix these packages will not be installed. Instead the vanilla mysql client package will be installed.
Unfortunately when you try to install the MySQL-client package from Oracle, it will conflict, because both the "mysql" and "MySQL-client" packages try to manage the same files, e.g. /usr/bin/mysql.
For the MariaDB packages, the current stable version is 5.5.29. The MariaDB-server package claims to provide "mysql", so when installing postfix, yum will try and install MariaDB-server.
This works fine, but seeing as most servers should have some sort of MTA installed (for sending cron emails for example) and only database servers need MySQL-server install, it seems silly to go installing MariaDB-server on every server.
This means we are now in a rather awkward situation:
- Oracle's MySQL client cannot be installed on a server running postfix
- MariaDB's MySQL server must be installed on a server running postfix
A twist in the tale
It turns out that postfix doesn't actually require "mysql" at all. It requires the MySQL libraries so that it can communicate with a MySQL server, it doesn't need the command line client utility.
It seems the people who package postfix for CentOS 6 (and Fedora) realize this, and their packages do not require "mysql", but instead require only "mysql-libs".
The effect of this small change is to allow either MariaDB or Oracle's packages to be installed cleanly, as yum will pull in MariaDB-compat or MySQL-shared-compat respectively.
I do not know why the CentOS 5.9 package of postfix has this difference in requirements.
A solution, of sorts
A short term solution is to grab the postfix SRPM from a CentOS mirror, edit the RPM SPEC file to disable the requirement for mysql and increment its build version. Then rebuild it and put that in your own YUM repository. This will allow you to install the updated postfix without any MySQL dependencies.
A proper solution
As it stands currently Oracle's MySQL-client package is not installable on CentOS/RHEL 5.9 running postfix. These packages are specifically marketed as compatible with this OS, so for them to be incompatible is a big problem.
The upstream resolutions as I see them are:
- Oracle and MariaDB to modify their client RHEL/CentOS packages to provide “mysql” - This will ensure compatibility with any other packages that require “mysql”
- CentOS/RHEL update their postfix package to require “mysql-libs” rather than “mysql”