Saturday, January 23, 2010

Postfix with MySQL in RHEL/CentOS 5

SkyHi @ Saturday, January 23, 2010

The version of Postfix that comes with Red Hat Enterprise Linux 5 or CentOS 5 does not support MySQL lookups. You can build your own custom Postfix RPM or get a prebuilt RPM from the CentOS Plus repository. You can use the CentOS repository in RHEL since CentOS is binary compatible with RHEL. This article describes how to install Postfix with MySQL lookup table support from the CentOS Plus repository.

Edit CentOS-Base.repo
1. Edit the file /etc/yum.repos.d/CentOS-Base.repo or its equivalent in RHEL and edit the lines below.
[base]
exclude=postfix

[update]
exclude=postfix

[centosplus]
enabled=1
includepkgs=postfix
If you are using RHEL, add the lines below under the centosplus section.
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
yum remove postfix
2. Type yum remove postfix in a terminal window to remove the standard version of Postfix.
yum install postfix
3. Type yum install postfix to install the version of Postfix found in the CentOS Plus repository.
postconf -m
4. To verify MySQL support, type postconf -m and check if mysql is found in the output.


REFERENCE

http://www.linuxmail.info/postfix-mysql-centos-5/