No Hair Github Pages

Setting up a mailserver on OpenBSD 6.9: PF configuration

F. Adjust pf.conf

With this setup we will use imap and smtp.

1. Add to pf.conf on the firewall:

...
mailserver = "10.1.1.2"
email_ports = "{ smtp, imap, imap3, 465, submission, imaps }"
...
# Direct email traffic to smtp server
pass in on egress inet proto tcp from any to (egress) port $email_ports rdr-to $mailserver

2. Add to pf.conf on mailserver:

...
email_ports = "{ smtp, imap, imap3, 465, submission, imaps }"
...
# Pass in traffic to mailserver
pass in on egress inet proto tcp from any to ( egress ) port $email_ports

3. Now try to send an email to john@example.com from Gmail or other remote mail service. Check as above whether it is received.

You can't send mail yet, but at least 1/2 of the server is functional.

Next: Dovecot configuration

Previous: Initial OpenSMTPD configuration


Posted by Gordon, No Hair Github Pages, August 24, 2021

© nohair.net and the author

For comments, corrections, and addenda, email: gordon[AT]nohair.net

Github Pages index | Nohair.net | Links | Surfcams