August 10, 2014

RHEL 6 Configure an MTA to Forward (Relay) Email Through a Smart Host.

Introduction

A relay mail server (MTA) is a intermediate server that forwards email to the final delivery mail server (MDA), i.e. writes message to default store /var/spool/mail/${USER}.

Remote Client --> Mail Transfer Agent, MTA (192.168.1.11) --> Mail Delivery Agent, MDA (192.168.1.12)

Configuration MTA

If you want MTA to ONLY transfer mail then set 'mydestination = '. With the above configuration the MTA will delivers local users email from remote client.

Restart service to let configuration take effects.

Check that SMTP port 25 (TCP) is open in iptables. If you need to update the configuration, don't forget to restart iptables service.

Configuration MDA

Do not forget to restart postfix service after configuration changes.

Create ordinary unix user for test, via command adduser mail2.

Check iptables SMTP port 25 (tcp) is open. Update if needed and restart iptables service.

If SELinux is active (default), check that default SELinux boolean for postfix is on.

Test

Now we are ready to test by sending mail from a remote client.

Now verify that mail was delivered on MDA (192.168.1.12).

No comments: