Back to services

OpenSMTPD

Secure SMTP server implementation from the OpenBSD project.

View alternatives to OpenSMTPD
Suggest edit
Open source
Self-hostable
ISC
Recent reviews

Alternatives

Tech stack

No tech stack added yet. Sign in to suggest some

Note: We couldn't retrieve the official website, so the following was written from what is confirmed about the project. Details we weren't sure of have been left out.

Introduction

OpenSMTPD is a free SMTP server implementation developed by the OpenBSD project, and it is a mail transfer agent (MTA). It sends and receives mail according to the RFC 5321 standard, and it has been the default mail server on OpenBSD since OpenBSD 5.x. The project is written in C and uses the ISC license. Besides the native OpenBSD version, there is a portable version (OpenSMTPD-portable) that runs on Unix-like systems such as Linux, FreeBSD, NetBSD and macOS.

Key Features

  • SMTP sending, receiving and relaying: Accepts incoming mail and delivers it locally, and can also forward or relay mail to other servers (smarthosts).
  • Multiple local delivery methods: Supports mbox, Maildir and LMTP, and can also hand mail off to an external MDA program (for example, Dovecot's delivery agent).
  • TLS and authentication: Supports encrypted connections via STARTTLS and SMTPS, as well as SMTP AUTH client authentication.
  • Tables: Data such as aliases, virtual domains, virtual users and credentials can be stored in files or other backends, which makes it easy to host multiple domains.
  • Filters: External processing programs, such as anti-spam tools and DKIM signing, can be plugged in through the filter interface.
  • Administration tools: Use smtpctl to view the queue and statistics, or to pause, resume and reschedule mail delivery.

Core Strengths

  • Simple configuration: The syntax of the main configuration file, smtpd.conf, is close to natural language, and a few rules are enough for common setups, making it easier to get started with than traditional MTAs such as Sendmail and Postfix.
  • Focus on security: It follows OpenBSD's secure development practices, with privilege separation and a multi-process isolation design.
  • Lightweight: The codebase is small and resource usage is low, which suits personal servers and small deployments.

Target Users and Use Cases

It suits individuals and small teams who want to run their own mail service, OpenBSD/BSD users, and system administrators who need simple local mail delivery or relaying. It is often combined with components such as Dovecot (IMAP/POP3) and rspamd (anti-spam) to build a complete mail system.

Installation and Deployment

  • OpenBSD: It is included with the system. Edit /etc/mail/smtpd.conf, then enable the smtpd service with rcctl.
  • Other systems: Most Linux distributions and BSDs provide a package in their repositories (usually named opensmtpd), or you can download the portable source from the official website and compile it.

A simple example (deliver locally and relay outgoing mail):

listen on localhost
action "local" maildir alias <aliases>
action "relay" relay
match for local action "local"
match from local for any action "relay"

Technical Requirements

  • A Unix-like operating system (natively supported on OpenBSD; use the portable version on other systems)
  • To receive mail from the outside, you need a public IP address, correct DNS records (MX, SPF, reverse DNS, etc.) and an open port 25

Things to Note

  • OpenSMTPD only handles SMTP transport and delivery. It does not provide IMAP/POP3 or webmail, so you need to pair it with other components.
  • The configuration syntax has changed considerably between major versions, so watch for version differences when following older tutorials.