Saturday, September 29, 2012

Simple Opensmtpd Configuration

Having recently reverted my primary home desktop to FreeBSD, I went looking for a method to send out notifications and the like to my gmail account.  Typically I would install postfix, but that was such a case of overkill in this case that I wanted something simpler.  Before I moved to rolling my own, I went looking for a solution, and ran across opensmtpd.  Specifically, I found this guide: https://cooltrainer.org/2012/06/06/external-mailing-on-freebsd/

It turns out that there have been some updates in the past few months such that the configuration example given will not work.  Below is my working example of smtpd.conf (everything else in the post should be fine).


listen on 127.0.0.1

map "aliases" source db "/usr/local/etc/mail/aliases.db"
map "secrets" source db "/usr/local/etc/mail/secrets.db"

accept for local alias aliases deliver to mbox
accept from local for domain gmail.com relay via "tls+auth://smtp.gmail.com:587" auth "secrets"

Brackets in the map config line are optional, and will eventually be removed alltogether.

More importantly, the configuration options for a relay host are now all put into that URL format.

No comments:

Post a Comment