Skip to content

Instantly share code, notes, and snippets.

Created June 7, 2017 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/0b04a03da268723be3d821eb4f7cfd4b to your computer and use it in GitHub Desktop.
Save anonymous/0b04a03da268723be3d821eb4f7cfd4b to your computer and use it in GitHub Desktop.
Relay-only OpenSMTPd config
Straight relay:
listen on 0.0.0.0
listen on ::
table aliases db:/etc/opensmtpd/aliases.db
table vmap db:/etc/opensmtpd/vmap.db
table localnets { 192.168.10.0/24, 192.168.100.0/24, 192.168.157.0/24, 192.168.158.0/24, 192.168.101.0/24 }
accept from local for any relay via smtp://avant-ca.mail.protection.outlook.com hostname remote.avant.ca
accept from source <localnets> for any relay via smtp://avant-ca.mail.protection.outlook.com hostname remote.avant.ca
Full version:
listen on 0.0.0.0
listen on ::
table aliases db:/etc/opensmtpd/aliases.db
table vmap db:/etc/opensmtpd/vmap.db
table localnets { 192.168.10.0/24, 192.168.100.0/24, 192.168.157.0/24, 192.168.158.0/24, 192.168.101.0/24 }
accept from local for any relay via smtp://avant-ca.mail.protection.outlook.com hostname remote.avant.ca
accept from source 192.168.158.63 for domain 192.168.158.63 virtual <vmap> deliver to lmtp localhost:25
accept from source 192.168.100.63 for domain 192.168.100.63 virtual <vmap> deliver to lmtp localhost:25
accept from source 192.168.158.63 for any relay via smtp://avant-ca.mail.protection.outlook.com as avantsysadm@avant.ca hostname remote.avant.ca
accept from source 192.168.100.63 for any relay via smtp://avant-ca.mail.protection.outlook.com as avantsysadm@avant.ca hostname remote.avant.ca
accept from source <localnets> for any relay via smtp://avant-ca.mail.protection.outlook.com hostname remote.avant.ca
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment