October 26, 2020

Out Here In The Fields

…of musings and ramblings

Setup sendmail to forward to external smtp server

1 min read

Screenshot from 2014-05-20 01:29:55

If you want your local installation of sendmail to forward all emails to certain, external smtp server, all you have to do is to enable and setup the smarthost feature on the sendmail.mc and sendmail.cf. To do that, open the sendmail.mc

[root@computron ~]# vi /etc/mail/sendmail.mc

Find the line that defines the smart host feature, uncomment, and point it to the external smtp server

dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
define(`SMART_HOST', `[172.16.2.10]')dnl
dnl #

Please notice the bracket at the star and the end of the smtp server’s IP. Restart sendmail by issuing:

[root@computron ~]# service sendmail restart

check whether the change has been reflected on sendmail.cf

[root@computron ~]# vi /etc/mail/sendmail.cf

find the smart host entry, and make sure that the smart host Ip is pointed to the right server

# "Smart" relay host (may be null)
DS[172.16.2.10]

If it’s there, then we’re done!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Copyright © All rights reserved. | Newsphere by AF themes.