Hmm.. I spent a lot of time fiddling around with settings trying to get it to work, but it seems for some reason I can only send from mynetworks anyway, and so that in combination with
Code:
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination
seems to do what I want (only able to send from the VPN, and even then only when authenticated). I can't see in my settings why RCPT TO from outside mynetworks is being denied, I guess it's a default setting?
I couldn't get SSL to work at all (client just hangs waiting for a connection) even though I'm pretty sure I had smtps running ok.
When I was trying to set it up to allow SSL on the VPN only, I got a lot of complaints in the log file along the lines of:
Code:
fatal: parameter "smtpd_recipient_restrictions": specify at least one working instance of: check_relay_domains, reject_unauth_destination, reject, defer or defer_if_permit
What I was trying to do was to specify really restrictive stuff in main.cf:
Code:
smtpd_recipient_restrictions = reject_unauth_destination
..then make smtps allow connections only from local clients and relay only from sasl authenticated clients (to enforce both requirements):
Code:
-o smtpd_client_restrictions=permit_mynetworks
-o smtpd_recipient_restrictions=permit_sasl_authenticated, reject_unauth_destination
..but it just wouldn't work, I have no idea why not!
Anyway, it seems to be relatively secure, so I'm going to move on to antispam settings
