Email Relay Outgoing

Creating Mail Relay Authenticated By IP (Outgoing)

I used Centos 6.8 to configure a Mail Relay.

1st step -

Install exim in your server :

yum install exim-mysql -y

Usually centos default MTA is postfix, so we need to change the default MTA to exim, with command below :

alternatives --config mta

It will bring you below selection :

There are 2 programs which provide 'mta'.

Selection Command
-----------------------------------------------
* 1 /usr/sbin/sendmail.postfix
+ 2 /usr/sbin/sendmail.exim

Enter to keep the current selection[+], or type selection number:

Choose 2 to use exim as the default MTA, (I have chosen 2 in my example).

service postfix stop
chkconfig postfix off
service exim start
chkconfig exim on

Now we need to change the exim configuration at /etc/exim/exim.conf

Change to below :

Then find a section called "router" in the configuration and make sure the router is set as below :

Above config will tell route all email, and send it for you to the recipient.

But we must make sure that your mail server know where to relay the server to, so you need to login to your mail server (origin server).

Then edit the exim config for smarthost as below :

After completed all above steps, try to send using your origin server to anyone.You will got the header of the email as below :

As you can see above, it stated that it received from my Mail Relay (acaprelay.amirulasyraf.com).

Last updated

Was this helpful?