OpenSMTPD Is the Mail Server for the Future

WhyNotHugo1 pts0 comments

OpenSMTPD Is The Mail Server For The Future

OpenSMTPD Is The Mail Server For The Future

Image credit: the OpenSMTPD project

© 2026 Peter N. M. Hansteen

The SMTP mail server for the 21st century and onwards is OpenSMTPD,<br>which is developed as an integral part of OpenBSD, but available in a portable<br>variety too.

It was one of those things that I had fully intended to do years ago,<br>but I only got around to actually doing once there was a definite<br>deadline to get it done.

The time has come, as OpenBSD 7.9 will leave the exim package behind, and exim users will need to find a replacement before upgrading. This article describes my transition to OpenBSD's own OpenSMTPD mail server.

OpenBSD 7.9 will leave the exim package behind, and exim users will need to find a replacement.

OpenSMTPD (smtpd) is in the base system.

When OpenSMTPD was first introduced in the OpenBSD base system in<br>OpenBSD 4.6 in October 2009, I had already been running a mail service<br>for some years.

At the time I still found it convenient to keep using<br>exim as the real mail server, protected by OpenBSD spamd in the<br>incoming signal path and with a combination of spamassassin and clamav<br>for content filtering.

It seemed quite tempting to me to play around with at the new smtpd at the time, but the initial version of the new<br>mail server was not yet considered quite ready for prime time.

Note: This piece is also available with trackers but nicer formatting here.<br>without trackers but classic formatting only here.<br>-->

The pace of development was quite hectic in the early years, and by<br>the time smtpd replaced the classic sendmail as the default mail<br>server in OpenBSD with the November 2014 OpenBSD 5.6 release, I had<br>just completed the third edition of The Book of PF and I was interested, but the writing had been quite a drain on my energy.

And of course, the mail server setups I had running for myself and friends I thought of as complex enough that moving to something else would<br>require quite some preparation and testing. So I would leave looking into the new mail server software properly for another day, soon to come, I was sure.

An Old Setup, Maintained With Much Love and Care

There are some hints of what that setup did (and still does) in the<br>2012 piece In The Name Of Sane Email: Setting Up OpenBSD's spamd(8)<br>With Secondary MXes In Play - A Full Recipe<br>(also<br>tracked, prettified),<br>but the main features are:

Two (originally three) separate sites, each with their own domains,<br>where the other site(s) provide secondary MX duty for the other(s),<br>each with a spamd-instrumented OpenBSD machine as the<br>Internet-facing part of the mail setup

The OpenBSD machines perform spamd greylisting and greytrapping, but<br>also provide content filtering on behalf of another set of domains<br>with their own, not necessarily Internet-exposed, mail servers that<br>receive the filtered mail relayed to them by the Internet-facing<br>mail services.

This setup, with OpenBSD spamd in a greylisting and greytrapping setup<br>in front and content filtering as the second stage before finally<br>relaying to the protected mail hosts, worked well enough that we<br>simply kept the systems running with only routine system and package<br>upgrades and minor adjustments to configurations as needed.

In short, domains to be served came and went, but<br>the spamd, exim and<br>clamav+spamassassin combination stayed, on<br>the ever reliable OpenBSD platform.

Time To Move On, Wait, Then Finally ...

Over the years, there were several episodes with medium to severe<br>security flaws discovered in the exim codebase, but the OpenBSD<br>package was generally well maintained and fixes tended to appear<br>within a reasonable time.

From time to time OpenBSD developers and port maintainers discussed<br>dropping support and removing exim from the package system, but it was<br>only in early 2026 it finally happened.

OpenBSD 7.9 will ship without<br>an official exim package.

So it was finally time for even this holdout to move to something<br>else.

And Of Course, A False Start

Other OpenBSD users had kept telling me how good OpenSMTPD had become,<br>so I decided now was the time, so I dug out some old notes and started<br>experimenting.

Those old notes turned out to be utterly useless, and for a reason:<br>The OpenSMTPD 6.4 release was the result of a major code overhaul that<br>also changed important parts of the smtpd.conf syntax.

Unfortunately a majority of the third party guides out there that turn<br>up early in search results still use the old syntax, and as a<br>consequence, are useless, at least to users on OpenBSD or other<br>platforms that have kept their code reasonably in sync. A useful rule<br>of thumb is, if you find yourself reading an OpenSMTPD guide that is dated before 2020, do yourself a<br>favor and move on to something newer.

If you find yourself reading an OpenSMTPD guide is dated before 2020, do yourself a<br>favor and move on to something newer.

The Task At Hand: The Analysis

But to the problem at hand. The setup I was setting out...

openbsd mail opensmtpd time server exim

Related Articles