OpenSMTPD SPF filter

OpenSMTPD filter to enforce the Sender Policy Framework.

Build

Go >= 1.22 is required.


git clone https://netsend.nl/opensmtpd-filter-spf.git
cd opensmtpd-filter-spf
go build -o filter-spf

Install

Execute the following as the superuser.

install -m555 -gbin filter-spf /usr/local/libexec/smtpd/
useradd -d /var/empty -s /sbin/nologin _spf
Define the filter and add it to your listen directives.

smtpd.conf:


filter "spf" proc-exec "filter-spf" user _spf group _spf
listen on egress filter { spf }

Code and repository

Browse the source code here or on GitHub or clone the repository:

$ git clone https://netsend.nl/opensmtpd-filter-spf.git