Install OpenSMTPD on a Debian Linux test server
Install Debian's OpenSMTPD package, create a local-only Maildir configuration, and validate it before configuring public SMTP.
Reviewed
OpenSMTPD has a portable Linux version as well as its OpenBSD implementation. This recipe targets Debian 13 (trixie) and starts with loopback-only SMTP and local Maildir delivery. It does not add IMAP, public domain reception, filtering, or authenticated submission.
For the broader choice, see OpenSMTPD in the Linux mail-server comparison.
Install on an isolated host
Use a clean Debian test machine with sudo access and no existing mail queue. Keep public SMTP blocked at the provider/host firewall while installing; package scripts may start the daemon. Check apt’s proposed removals before accepting a replacement of another MTA.
sudo apt update
sudo apt install opensmtpd
sudo systemctl stop opensmtpd
Inspect the installed manuals, man smtpd and man smtpd.conf. The Debian trixie smtpd manual documents /etc/smtpd.conf and the -n configuration check. Use documentation for your installed release: OpenBSD examples use interface names such as lo0, whereas Linux commonly uses lo.
Set a local-only Maildir configuration
Preserve the package configuration before editing it, for example as /etc/smtpd.conf.before-local-setup; don’t overwrite an existing backup. On this disposable test host, set /etc/smtpd.conf to:
listen on 127.0.0.1
action "local_mail" maildir
match from local for local action "local_mail"
This uses the documented match/action and Maildir syntax. Local recipients resolve to local system users; mail is delivered to their ~/Maildir. It intentionally has no outbound relay action and no public listener. Unknown destinations should not acquire a catch-all relay rule.
This minimal example also omits an alias table. Configure administrative aliases and the required recipient policy before treating it as a real mail service.
Validate and start
sudo smtpd -n -f /etc/smtpd.conf
sudo systemctl start opensmtpd
systemctl status opensmtpd --no-pager
sudo ss -ltnp
sudo smtpctl show queue
Run the syntax check first and stop if it fails. Confirm that SMTP listens only on 127.0.0.1, not a public address. A valid configuration or empty queue does not prove mailbox delivery; use a controlled local recipient and inspect its Maildir before proceeding. If startup fails, inspect journalctl -u opensmtpd and restore the preserved configuration if needed.
Add public mail capabilities deliberately
Next, configure OpenSMTPD match rules and delivery actions for the domain you control. For application sending, use TLS-protected submission and upstream relay, not a rule accepting arbitrary remote-to-remote traffic.
Leave production MX unchanged until domain acceptance, rejection of unknown recipients and unauthorized relay, TLS, backups, and recovery are verified. IMAP needs a separate service; this package does not turn mail into parsed webhooks automatically.
The commands and configuration are documentation recipes checked against the cited manuals, not a claim that MailKite has run this installation or tested public delivery.