Follow these steps
- Get the Fedora source RPM for the level of Postfix you want to install.
- Install the source RPM. This is a simple matter of running
rpm -Uvh /tmp/postfix-2.0.16-1.src.rpm
Where that happens to be the path to and name of the source RPM I grabbed, from testing. You should install whatever level you choose.
- By default, the source is installed in /usr/src/redhat/. The actual source will go into /usr/src/redhat/SOURCES and the specfile will go in /usr/src/redhat/SPECS. Make sure you can find them.
- Edit the file /usr/src/redhat/SPECS/postfix.spec. Near the beginning, there is a line that says
%define MYSQL 0
Find that line, and change the 0 to a 1. Save the file.
- Use buildrpm to build a new binary RPM, by using the command
rpmbuild -bb /usr/src/redhat/SPECS/postfix.spec
You should see the files go by, and you should see compiler options mentioning MySQL and libraries.
- The RPM that was built will be deposited in /usr/src/redhat/$arch/. In my case, the RPM is called /usr/src/redhat/RPMS/i386/postfix-2.0.16-1.i386.rpm. Find the binary RPM.
- Install the binary RPM with a command such as
rpm -uvh /usr/src/redhat/RPMS/i386/postfix-2.0.16-1.i386.rpm
- Do cleanup as appropriate.
If you have already installed this level of postfix, the rpm command will balk at installing the same level of the postfix package over again. To increment the subrelease number, you must edit the spec file, and change the line that says:
In my case, the original release was 1, and I wanted to change it to 2, so as to make the install work. I could have used --force once I was sure that everything was right, but, frankly, I wanted to make it work as it was designed. The risk is that someone will create an official Release 2 of the same level of postscript --- but since I am faced with installing postfix from source RPMs in all cases in any case, I will want to do something to save myself from having the Postfix rpm overlaid. To make it clear, however, 1 and 2 are examples --- you might have a different starter number, just increase it.
Finally, you are now in the situation where, as and if new releases of Postfix come out, you will not want to automatically install them. How you stop new versions of a package from installing is up to you - there is a simple way to do it with up2date --configure. With yum, editing the /etc/yum.conf file and adding postfix to the exclude line will do it.
Once you have done the installation, you can verify it, simply, by running the command postconf -m. This lists the types of tables that Postfix can use, and you ahould be able to see the fact that mysql is now a supported table type.