I’ve always had my machines attempt to send me email at my isp address but they always got bounced back.
So I finally set out to determine how to get sendmail to use my ISPs smtp server to send out email. And it turns out be a trivial task, but one I will document here for others to use:

You must be root to do this and stop sendmail:

su
/sbin/service sendmail stop

Always backup your configuration files otherwise, don’t come crying to me when your sendmail.cf is 0 bytes.

cd /etc/mail
cp sendmail.cf sendmail_cf.bak
cp sendmail.mc sendmail_mc.bak

Edit sendmail.mc (uncomment or add)

define(`SMART_HOST',`smtp.your.isp.com')

Ensure you have sendmail-cf installed, otherwise install it.

rpm -q sendmail-cf
yum -y install sendmail-cf

Now rebuild sendmail.cf and restart sendmail.

m4 sendmail.mc > sendmail.cf
/sbin/service sendmail start

3 thoughts on “Sendmail & local ISP

  1. No one should ever get flamed for not using the command line. I’d be perfectly happy if every admin task was available through a UI in Linux. And I think it would make it even more popular for the home user.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com 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