Install the package:
apt-get install postfix-policyd-spf-perl
Add this line to /etc/postfix/main.cf:
policy-spf_time_limit = 3600s
Add the following lines to /etc/postfix/master.cf:
policy-spf unix - n n - - spawn
user=policyd-spf argv=/usr/sbin/postfix-policyd-spf-perl

In /etc/postfix/main.cf, find the smtpd_recipient_restrictions section, and, immediately after permit_mynetworks (and permit_sasl_authenticated, if you’re using that), add:
check_policy_service unix:private/policy-spf,
Restart Postfix and check your logs to see if everything is working properly.
tail -f /var/log/mail.log