Setup Mail Gateway/Forwarding using Postfix

I will show you on how to setup a mail forwarding run in Postfix, which is my MX record will be the email gateway and this server will forward all emails to my mail server which run under cPanel.

What we really need is an MTA (mail transfer agent), application which route your email here and there until all the transaction complete and the email reach the destination. Variables as below:

OS: CentOS 5.5 64bit
MTA version: Postfix 2.3.3
Mail gateway IP:
Mail gateway IP:
Destination server (cPanel):
Domain:, and

1. In this case, I already have MX record which pointing to my cPanel server for 3 domains as below:    MX    10
mail             A    MX    10
mail               A    MX    10
mail             A

2. Lets setup and configure MTA and all required applications. We also need to stop sendmail (by default has been enabled by system), remove sendmail from start-up service, disable SElinux and install Postfix using yum:

service sendmail stop
chkconfig sendmail off
setenforce 0
yum install postfix -y

3. We need to do some configuration to tell Postfix what type of MTA it should be. Edit /etc/postfix/ with text editor and change or uncomment following value: Continue reading “Setup Mail Gateway/Forwarding using Postfix” »