Skip to content

Instantly share code, notes, and snippets.

@gahr
Created October 17, 2023 08:22
Show Gist options
  • Select an option

  • Save gahr/28885833d775073e87d96f32032d708c to your computer and use it in GitHub Desktop.

Select an option

Save gahr/28885833d775073e87d96f32032d708c to your computer and use it in GitHub Desktop.
smtpd.conf
my_net = "192.168.1.0/24"
table domains sqlite:/usr/local/etc/mail/sqlite.conf
table virtuals sqlite:/usr/local/etc/mail/sqlite.conf
table userinfo sqlite:/usr/local/etc/mail/sqlite.conf
table credentials sqlite:/usr/local/etc/mail/sqlite.conf
table aliases file:/etc/mail/aliases
pki ptrcrt.ch cert "/usr/local/etc/acme.sh/ptrcrt.ch/fullchain.cer"
pki ptrcrt.ch key "/usr/local/etc/acme.sh/ptrcrt.ch/ptrcrt.ch.key"
filter "rspamd" proc-exec "opensmtpd-filter-rspamd -url http://192.168.1.8:11333"
filter "rdns" phase connect match !rdns disconnect "550 RDNS error"
filter "fcrdns" phase connect match !fcrdns disconnect "550 FCRDNS error"
# Listen on SMTP for incoming connections
listen on lo1 port 588 filter { "rspamd" }
listen on lo1 port 587 tls-require auth <credentials> pki ptrcrt.ch tag submission filter { "rspamd" }
listen on lo1 tls pki ptrcrt.ch filter { "rdns", "fcrdns", "rspamd" }
listen on lo1 smtps pki ptrcrt.ch filter { "rdns", "fcrdns", "rspamd" }
action "local" maildir alias <aliases>
action "inbound" lmtp "/var/run/dovecot/lmtp" rcpt-to virtual <virtuals> userbase <userinfo>
action "outbound" relay
match from local for local action "local"
match from any for domain <domains> action "inbound"
match from local for any action "outbound"
match from any for any auth action "outbound"
match from src $my_net for any action "outbound"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment