Using a smart host in OpenBSD’s sendmail

Here are some quick notes of configuring sendmail(8) to transfer mail
to your ISP’s smart host on a standard OpenBSD Installation. Tested with
OpenBSD 4.7/i386 and 4.8/i386

First, make a copy of the default configuration. Here ‘mysettings’ is something you can name anything you’d like.

# cd /usr/share/sendmail/cf
# cp

Define smarthost by adding this line in replacing ‘’ with the smtp server of your ISP.


Generate a .cf file from the .mc configuration with m4 and move it to /etc/mail/

# pwd
# m4 ../m4/cf.m4 >
# mv /etc/mail/

Add this line to /etc/rc.conf.local to override the default flags in /etc/rc.conf

sendmail_flags="-L sm-mta -C/etc/mail/ -bd -q30m"

Instructions shamelessly stolen from a post by Diana Eichert on the misc mailing list at OpenBSD.

Did you enjoy this post? Why not leave a comment below and continue the conversation, or subscribe to my feed and get articles like this delivered automatically to your feed reader.


No comments yet.

Leave a comment