postfix + policyd-spf : ip address not recognized

Nagy László Zsolt gandalf at shopzeus.com
Tue Sep 29 07:52:09 UTC 2015


System: FreeBSD 10.2-RELEASE-p2
Postfix version: 2.11.6
Policyd-spf version: py27-postfix-policyd-spf-python-1.2

I have added "check_policy_service unix:private/policyd-spf" to
"smtpd_recipient_restrictions" in main.cf.

This is what I see in the maillog:

Sep 29 03:49:37 shopzeus policyd-spf[5634]: Traceback (most recent call
last):
Sep 29 03:49:37 shopzeus policyd-spf[5634]:   File
"/usr/local/bin/policyd-spf", line 701, in <module>
Sep 29 03:49:37 shopzeus policyd-spf[5634]:     instance_dict,
configData, peruser)
Sep 29 03:49:37 shopzeus policyd-spf[5634]:   File
"/usr/local/bin/policyd-spf", line 413, in _spfcheck
Sep 29 03:49:37 shopzeus policyd-spf[5634]:     res = spf.check2(ip,
helo_fake_sender, helo, querytime=configData.get('Lookup_Time'))
Sep 29 03:49:37 shopzeus policyd-spf[5634]:   File
"/usr/local/bin/spf.py", line 297, in check2
Sep 29 03:49:37 shopzeus policyd-spf[5634]:    
receiver=receiver,timeout=timeout,verbose=verbose,querytime=querytime).check()
Sep 29 03:49:37 shopzeus policyd-spf[5634]:   File
"/usr/local/bin/spf.py", line 378, in __init__
Sep 29 03:49:37 shopzeus policyd-spf[5634]:     self.set_ip(i)
Sep 29 03:49:37 shopzeus policyd-spf[5634]:   File
"/usr/local/bin/spf.py", line 405, in set_ip
Sep 29 03:49:37 shopzeus policyd-spf[5634]:     self.ipaddr =
ipaddress.ip_address(i)
Sep 29 03:49:37 shopzeus policyd-spf[5634]:   File
"/usr/local/lib/python2.7/site-packages/ipaddress.py", line 163, in
ip_address
Sep 29 03:49:37 shopzeus policyd-spf[5634]:     ' a unicode object?' %
address)
Sep 29 03:49:37 shopzeus policyd-spf[5634]: AddressValueError:
'176.32.127.140' does not appear to be an IPv4 or IPv6 address. Did you
pass in a bytes (str in Python 2) instead of a unicode object?
Sep 29 03:49:37 shopzeus postfix/spawn[2227]: warning: command
/usr/local/bin/policyd-spf exit status 1
Sep 29 03:49:37 shopzeus postfix/smtpd[2786]: warning: premature
end-of-input on private/policyd-spf while reading input attribute name

Now, this seems to be the very same error:

https://bugzilla.redhat.com/show_bug.cgi?id=1230373

But here is what I also have:

# pip install -U ipaddress
Requirement already up-to-date: ipaddress in
/usr/local/lib/python2.7/site-packages
# pip install -U ipaddr
Requirement already up-to-date: ipaddr in
/usr/local/lib/python2.7/site-packages


I think this cannot be a bug introduced 2 months ago and still not
fixed? Then what is wrong here? How can I fix this?

Thanks,

   Laszlo





More information about the freebsd-questions mailing list