This shows how to do special SPF checks for a special recipient. Since the man pages contain wrong examples I’ve decided to read the code myself, from /usr/lib/python2.6/dist-packages/policydspfuser.py. This applies to Ubuntu 10.04.

1. Create a text file containing the exceptions. I created a file called: /etc/postfix-policyd-spf-python/userconf. The man page gives the following example which is wrong:

postmaster@example.com,{'Mail_From_reject'='No_Check'|'PermEr‐
       ror_reject'=  'False'|'HELO_reject'='SPF_Not_Pass'|'defaultSeedOnly'=
       1|'debugLevel'=
       5|'skip_addresses'='127.0.0.0/8,::ffff:127.0.0.0//104,::1//128'|  'Tem‐
       pError_Defer'='False'}

the correct format is:

Mail_From_reject=No_Check|PermError_reject=False|HELO_reject=SPF_Not_Pass|defaultSeedOnly=1|debugLevel=5|skip_addresses=127.0.0.0/8,::ffff:12\
7.0.0.0//104,::1//128|TempError_Defer=False

2. Include this file in the default config for policyd-spf which is: /etc/postfix-policyd-spf-python/policy-spf.conf

Per_User = text,/etc/postfix-policyd-spf-python/userconf

Done.