Introduction
------------

policyd_spf is a Postfix SMTPD policy to check SPF. 

See the details at http://www.openspf.org

it is based on libspf2 library.


System Requirements
-------------------

libspf2 1.2.6 is required to run the Postfix SPF Policy policyd_spf 

Of course, you will need postfix > 2.1.0 to work with.


Brief and asbolutely incomplete test
------------------------------------

Previous to install, it is useful you check the binary. There some
small samples you can

  cat sample0 | ./policyd_spf

  cat sample1 | ./policyd_spf

  cat sample2 | ./policyd_spf


The answer must be a line of type 'action=DUNNO|REJECT|...' followed by an
empty line.

You can read more about it in Postfix documentation pages

  http://www.postfix.org/SMTPD_POLICY_README.html



Installing
----------

 1. Check where binary policyd_spf is installed in your
    system. Usually is in /usr/bin or /usr/local/bin directory

 2. Add the following to /etc/postfix/master.cf (you may change the path):

        policy  unix  -       n       n       -       -       spawn
            user=nobody argv=/usr/bin/policyd_spf

 3. Configure the Postfix policy service in /etc/postfix/main.cf:

        smtpd_recipient_restrictions =
            ...
            reject_unauth_destination
            check_policy_service unix:private/policy
            ...

    NOTE:  Specify check_policy_service AFTER reject_unauth_destination or
    else your system can become an open relay.

 4. Restart Postfix.

 NOTE: If you have problmes running policy_spf you can also try 
policy_spf_static which is compiled statically

