My question would seem to be the opposite of How to setup postfix to check SPF record only for domains that i want to check -
How would I go about modifying my Postfix server so that it checks SPF for incoming emails by default, but allows me to retain a whitelist of domains that can bypass the check?
My main.conf file includes a stanza :
smtpd_recipient_restrictions = check_policy_service inet:127.0.0.1:10031,
permit_mynetworks,
permit_sasl_authenticated,
reject_unauth_destination,
check_policy_service unix:private/spfpolicy
(10031 is policyd, btw)
My master.conf file includes a stanza :
spfpolicy unix - n n - - spawn
user=nobody argv=/usr/bin/perl /usr/sbin/postfix-policyd-spf-perl
I'm using this method.
I have a list with white-listed and black-listed domains:
/etc/postfix/sender_checks
This file has to be hashed when it is changed.
The hash map is referenced with
check_sender_access
in thesmtpd_recipient_restrictions
directive:You can move the
check_sender_access
check further to the front if you need to.