Smart Host with the default Sendmail
I have a number of machines that while not email servers, do need to send outgoing mail.
Even in the default install root will receive mail about cron jobs etc…
The first thing that I do is set sendmail not to accept incoming mail by adding this to /etc/rc.conf
sendmail_enable=”NO”
This does not stop sendmail from starting, but it does stop it from accepting incoming mail.
Then I edit /etc/mail/sendmail.cf
Add your.mailserver.com directly after the line starting with DS ( No spaces ).
( The mail server entered has to allow your host to relay mail )
on 4.x
killall -SIGHUP sendmail
on 5.x
/etc/rc.d/sendmail restart
|
February 11th, 2008 at 12:11 pm
Though this article is 2.5 years old now, I would like to add a comment: you should -not- just edit sendmail.cf
Instead, edit the source file /etc/mail/freebsd.mc and look for this line:
dnl define(`SMART_HOST’, `your.isp.mail.server’)
Remove the ‘dnl’ part and change your.isp.mail.server
make, make install and then restart sendmail.