Setup sendmail to forward to external smtp server

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 and To do that, open the

[root@computron ~]# vi /etc/mail/

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', `[]')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

[root@computron ~]# vi /etc/mail/

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)

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


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s