Check SPF Records when receiving mail in postfix

This simple install assumes you already have policyd installed

apt-get install postfix-policyd-spf-perl

Another tutorial,  said that an executable file might be installed at /usr/sbin/policyd-spf,  however it was installed elsewhere on my ubuntu 14.04 system,  here is how I found it

#locate policyd-spf|bin

User the path to add this entry to your /etc/postfix/master.cfm

policy-spf unix - n n - - spawn
      user=nobody argv=/usr/sbin/postfix-policyd-spf-perl

So,  now we need to update /etc/postfix/ by adding the following line

spf-policyd_time_limit = 3600s

and updateing the ‘smtpd_receiptient_restrictions’ to have the following in the list of services,   I added mind after ‘permit_mynetworks’ and another ‘check_policy_service’ entry I have.

smtpd_recipient_restrictions = permit_mynetworks, 
     check_policy_service inet:,
     check_policy_service unix:private/policy-spf,

Reload and watch your logs

/etc/init.d/postfix restart
grep spf /var/log/mail.log