Tag Archives: smtp

Migration to OpenSMTPD

After being a FreeBSD port maintainer for mail/opensmtpd port for quite sometime, missing updates, and committing a buggy snapshot, I decided to start using OpenSMTPD myself. It was on my TODO list since a long time, with a pf-like configuration syntax, it was very tempting. Due to laziness, I was not switching to it, so yesterday I gave up (my laziness ofcourse :P), and following is my OpenSMTPD configuration:

listen on lo0
expire 3d

table aliases db:/usr/local/etc/mail/aliases.db
table secrets db:/usr/local/etc/mail/secrets.db
table personal { "user1@domain1.tld", "user2@domain2.tld" }

accept for local alias <aliases> deliver to mda "/usr/local/libexec/dovecot/deliver -o mail_location=mdbox:%{user.directory}/.mdbox -f %{sender}"

# my personal accounts
accept from local sender <personal> for any relay via smtp://localhost:8027

# my another personal account but goes through different MTA
accept from local sender user3@doman3.tld for any relay via smtp://localhost:8025

# my work account
accept from local sender work@workdomain.tld for any relay via tls+auth://work@localhost:8026 auth <secrets>

More details about my email setup in this mailing-list post. Back to being lazy again! 😉