Configure OpenSMTPD match rules and delivery actions
Choose a supported portable/OpenBSD build, define destination tables, and validate ordered match rules before accepting SMTP.
Reviewed
OpenSMTPD’s configuration separates named delivery actions from ordered match rules. The first matching rule wins; broad rules can change delivery policy even when the file is syntactically valid.
Define the mail path
- Install the supported OpenBSD or portable package and use its matching manual. Linux packaging paths and release timing may differ.
- Define the domains and aliases this instance is responsible for, using the required table formats.
- Choose an action appropriate to the destination: local maildir/mbox, an MDA, LMTP, or SMTP relay.
- Add narrow match rules connecting accepted recipients to that action. Do not grant arbitrary Internet clients permission to relay.
The smtpd.conf manual explains rule order, envelope processing, tables, and action semantics. Validate syntax before an approved service reload:
smtpd -n
Run the installed build’s help/man page if your packaging uses different paths or permissions. Syntax validation does not test credentials or delivery availability.
Verify destination policy
Use controlled local, unknown, and remote recipients to test the positive and negative paths. Keep production MX unchanged until mail reaches the intended delivery service and an unauthorized remote-to-remote relay attempt is rejected.
OpenSMTPD provides SMTP transport, not a standalone IMAP server or general HTTP email API. If users need mailbox access, connect the mailbox component explicitly and test its authentication independently from SMTP acceptance.