SPF: premature end-of-input on private/policy

Asked by Nicolas BADIA

I've ask a detailed question here: http://serverfault.com/questions/733528/spf-premature-end-of-input-on-private-policy

Basically I have this error:

Nov 3 10:49:05 ns3016726 postfix/spawn[16996]: warning: command /usr/bin/python exit status 1
Nov 3 10:49:05 ns3016726 postfix/smtpd[17991]: warning: premature end-of-input on private/policy while reading input attribute name
Nov 3 10:49:06 ns3016726 postfix/spawn[16998]: warning: command /usr/bin/python exit status 1
Nov 3 10:49:06 ns3016726 postfix/smtpd[17991]: warning: premature end-of-input on private/policy while reading input attribute name
Nov 3 10:49:06 ns3016726 postfix/smtpd[17991]: warning: problem talking to server private/policy: Connection reset by peer

I now since try to run `/usr/bin/python /usr/bin/policyd-spf /etc/postfix-policyd-spf-python/policyd-spf.conf` directly and get:

Traceback (most recent call last):
  File "/usr/bin/policyd-spf", line 36, in <module>
    import spf
ImportError: No module named spf

I then installed pydns and pyspf and now get:

ipaddr module required: http://code.google.com/p/ipaddr-py/
Traceback (most recent call last):
  File "/usr/bin/policyd-spf", line 40, in <module>
    import policydspfsupp
ImportError: No module named policydspfsupp

Any idea of what is going on ?

Question information

Language:
English Edit question
Status:
Solved
For:
pypolicyd-spf Edit question
Assignee:
No assignee Edit question
Solved by:
Nicolas BADIA
Solved:
Last query:
Last reply:
Revision history for this message
Scott Kitterman (kitterman) said :
#1

Did you install ipaddr? If not, you need to do that. policydspfsupp is provided as part of pypolicyd-spf, so if that's missing you somehow have an incomplete installation. I'd reinstall it.

Revision history for this message
Nicolas BADIA (badia-nicolas) said :
#2

I just installed it but still have the same issue.

When I installed SPF on my previous server I did not have to install any python package manually. It just worked. This make me think the problem is not here, but I have no idea how to debug it...

Note that I'm using debian 8.2. The other server were on 7.8.

Revision history for this message
Scott Kitterman (kitterman) said :
#3

I get the impression you installed from source rather than use the Debian package. I'd recommend the Debian package (postfix-policyd-spf-python). If you install that, it will pull in all the needed dependencies.

Revision history for this message
Nicolas BADIA (badia-nicolas) said :
#4

I unfortunately install postfix-policyd-spf-python from the debian repo, not from source...

Revision history for this message
Nicolas BADIA (badia-nicolas) said :
#5

Found it! just add to remove `/usr/bin/python` in master.cf like this:

/usr/bin/policyd-spf /etc/postfix-policyd-spf-python/policyd-spf.conf

Thanks for the help anyway :-)