(updated Feb 29th 2016)
One problem that can comes up with the fantastic Centos Linux distro is that it sticks to the proven but also old packages. I needed some newer features several times. The only (good) way to upgrade Postfix to the newest package is to build it up from the source.
First, we need the link to the newest package (take a look here). In my case, it’s 2.11 stable, so let’s download it:
Now we need to isntall the development packages and the dependencies. These are the packages that I needed but You might need to install more, depending on which features You want to compile into it. For a standard featured Postfix MTA with SASL and MySQL support you’ll need the following:
Let’s celan up the makefiles now, and build new ones (because by the supplied makefile Postfix won’t be compiled with SASL and SQL support), and at the end let’s build the whole package:
The last step (build) will take a while, depeding on the CPU power of Your Linux box. At this moment, if it maneges to build without errors, you’ll have a ready to upgrade package. If not, you will need to yum groupinstall “Development Tools” and retry.
Regarding the arguments about building the makefile (step 3 above), depending on the features You want built in the new Postfix package please refer to the chapter 4.4 of the Postfix documentation. Basically, I never needed anything more than this, except that sometimes I want to use PgSQL instead of MySQL, then you will need to yum install postgresql-devel package and insert the correct arguments when creating the makefile.
creating the makefile in this example is done for Centos 6.x x64. If you are building for the 32-bit verion you will have to replace all the /usr/lib64 arguments with /usr/lib.
If everything is errorless, perform the update:
Done. Please also read the suggested articles during install about the new features, and sugested changes to the master.cf and main.cf files.
Regarding the package, since You done it by compiling from the source, the RPM package will stay at version 2.6.x but when you finally do a service postfix restart you will see:
Dec 3 09:23:56 one postfix/master: daemon started — version 3.0.3, configuration /etc/postfix