Postfix 3

Postfix 3 on Centos 6 and 7

Install and configure postfix3

Postfix version 3 is not available in the default CentOS 7 repository so we will use the GhettoForge repository:

# rpm -Uhv http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm

Install postfix3 with SQLite support with the command bellow:

yum install postfix3 postfix3-sqlite --enablerepo=gf-plus

Once the installation is completed, c

  --------------

Adding Postfix 3 mirrors

Let’s add the repository:

vim /etc/yum.repos.d/gf.repo

Add:

[gf] name=Ghettoforge packages that won't overwrite core distro packages. mirrorlist=http://mirrorlist.ghettoforge.org/el/7/gf/$basearch/mirrorlist enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7 failovermethod=priority  [gf-plus] name=Ghettoforge packages that will overwrite core distro packages. mirrorlist=http://mirrorlist.ghettoforge.org/el/7/plus/$basearch/mirrorlist # Please read http://ghettoforge.org/index.php/Usage *before* enabling this repository! enabled=1 gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7 failovermethod=priority

You can now go ahead and update yum cache:

yum clean all yum makecache fast

Test by searching postfix3 packages:

# yum search postfix3 Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile ========== N/S matched: postfix3 ======================= postfix3.x86_64 : Postfix Mail Transport Agent postfix3-cdb.x86_64 : CDB Database Support for Postfix postfix3-ldap.x86_64 : LDAP Database Support for Postfix postfix3-lmdb.x86_64 : LMDBtabase Support for Postfix postfix3-mysql.x86_64 : MySQL Database Support for Postfix postfix3-pcre.x86_64 : PCRE Database Support for Postfix postfix3-perl-scripts.x86_64 : Postfix utilities written in perl postfix3-pgsql.x86_64 : PostgreSQL Database Support for Postfix postfix3-sqlite.x86_64 : SQLite Database Support for Postfix

Proceed to Installing postfix3 on CentOS 7. Add any additional packages you want.

yum -y install postfix3 postfix3-ldap postfix3-mysql postfix3-mysql

Check installed postfix3 version:

# rpm -qi postfix3 Name : postfix3 Epoch : 2 Version : 3.2.2 Release : 4.gf.el7 Architecture: x86_64 Install Date: Thu 07 Sep 2017 09:16:33 PM EAT Group : System Environment/Daemons Size : 10447398 License : IBM Signature : RSA/SHA1, Mon 24 Jul 2017 02:20:56 AM EAT, Key ID d005ae31da8b7718 Source RPM : postfix3-3.2.2-4.gf.el7.src.rpm Build Date : Mon 24 Jul 2017 02:20:11 AM EAT Build Host : builder-01.ghettoforge.org Relocations : (not relocatable) Packager : builder@ghettoforge.org Vendor : GhettoForge URL : http://www.postfix.org Summary : Postfix Mail Transport Agent Description : Postfix is a Mail Transport Agent (MTA), supporting LDAP, SMTP AUTH (SASL), TLS

Starting postfix3 service

To start postfix3 on CentOS 7, do:

systemctl start postfix.service

Enable postfix to start on boot up:

systemctl enable postfix

Check postfix status:

systemctl status postfix

------------------------

cd wget http://cdn.postfix.johnriley.me/mirrors/postfix-release/official/postfix-3.2.0.tar.gz tar xvf postfix-3.2.0.tar.gz cd postfix-3.2.0

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:

yum install libdb-devel db4-devel cyrus-sasl cyrus-sasl-devel openssl openssl-devel pcre pcre-devel openldap openldap-devel mysql-devel

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:

make clean  make tidy  make makefiles CCARGS='-fPIC -DUSE_TLS -DUSE_SSL -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -DPREFIX=\\"/usr\\" -DHAS_LDAP -DLDAP_DEPRECATED=1 -DHAS_PCRE -I/usr/include/openssl -DHAS_MYSQL -I/usr/include/mysql -I/usr/include/sasl -I/usr/include' AUXLIBS='-L/usr/lib64 -L/usr/lib64/openssl -lssl -lcrypto -L/usr/lib64/mysql -lmysqlclient -L/usr/lib64/sasl2 -lsasl2 -lpcre -lz -lm -lldap -llber -Wl,-rpath,/usr/lib64/openssl -pie -Wl,-z,relro' OPT='-O' DEBUG='-g'   make

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.

One more note: creating the makefile in this example is done for Centos 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 upgrade to Postfix 3:

make upgrade

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[31460]: daemon started — version 3.1, configuration /etc/postfix

Good luck!