Photo by Helena Lopes on Pexels.com

Introduction

If you are running the Postfix version originally came with CentOS 7 or other linux flavor, it will have v2.10.10 or less than v3.

2.10.10 was launched in year 2016 and it is unsupported, this is the reason you should upgrade it to the supported version, at least 3.5.0 or higher. This way you can use many new features as well as your implemention will be less buggy.

https://en.wikipedia.org/wiki/Postfix_(software)

Make sure you have tested the config in your test environment before you do these steps in prod.

  • Keep copy of config and other config files like transport, relaylist etc before you uninstall older version.
  • Suggested to make copy of complete /etc/postfix directory.

Uninstall Older Version

yum remove postix
  • Take back up of config files
mv /etc/postfix/ /etc/postfix_old

Download Postfix

  • Download postfix 3 binaries
touch /etc/yum.repos.d/gf.repo
nano /etc/yum.repos.d/gf.repo
[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

Install Postfix3

  • Install Postfix 3, SASL and other related binaries
yum install postfix3 postfix3-ldap postfix3-mysql postfix3-mysql
yum install cyrus-sasl cyrus-sasl-plain cyrus-sasl-md5
yum enable saslauthd
yum start saslauthd
  • Make configuration file updates, like copy config main.cf to /etc/postfix/main.cf
  • Now, you can start postfix and verify postfix version.
postconf | grep "ver"
yum enable postfix
yum start postfix

Thanks you for reading !