I am setting up a Postfix SMTP server (pre v2.10) and was thinking to put the smtpd_recipient_restrictions as follows.
smtpd_recipient_restrictions=
permit_mynetworks,
reject_non_fqdn_recipient,
reject_unknown_recipient_domain,
reject_unauth_destination,
reject_rbl_client sub.domain.tld,
reject_rhsbl_reverse_client sub.domain.tld,
reject_rhsbl_helo sub.domain.tld,
reject_rhsbl_sender sub.domain.tld,
check_policy_service unix:private/policyd-spf
Would it work, and might it be an even better idea, to put the SPF checks before the RBL and RHSBL checks, so as to limit (if the SPF check might block something before reaching the RBL and RHSBL checks) the number of queries to the RBL and RHSBL lists/services?
Thank you.
RBL checks happen based on the incoming IP of the connection and can dispatch a 'bad' connection very quickly. SPF checks must wait for the SMTP conversation to begin and are therefore require more resources. In a high-volume situation, doing RBL first is "cheaper"