$ doas pkg_add rspamd opensmtpd-filter-rspamd


The default configuration is fine for most use cases, so we'll just leave it there. However you can add the following line to your smtpd.conf

filter rspamd proc-exec "filter-rspamd"

Also add rspamd after dkimsign in the authcheck part, mentioned in Opensmtpd.Configure

authcheck = "pki auth <passwd> filter { check_rdns check_fcrdns dkimsign rspamd }"

After done, restart smtpd with

$ doas rcctl restart smtpd