0

I recently encountered a problem on my freebsd postfix mail server with the packet py27-postfix-policyd-spf-python-1.3.2_1

My maillogs where full with the following messages:

policyd-spf[16637]: ERROR: 127.0.0.0/8 in skip_addresses not IP network.  Message: '11.22.33.44' 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?. Aborting white list processing.

Switching to python 3 as suggested by other people did NOT work (neither changing the shebang, nor starting it via python3 directly

1 Answer 1

0

The solution to my Problem was (for now) to add the following lines to the function _cidrmatch in /usr/local/bin/policyd-spf

def _cidrmatch(ip, netwrk)
  netwrk = unicode(netwrk)
  ip = unicode(ip)
  try:
    address = ipaddress.ip_address(ip)

This is done so that the python module ipaddr only has to deal with unicode string (as requested by the error message)

switching to python3 as suggested by other posts on the web did not work for me (maybe some missing dependencies?)

This post also helped me a lot https://stackoverflow.com/questions/30389019/valueerror-10-0-0-0-24-does-not-appear-to-be-an-ipv4-or-ipv6-network

BUT KEEP IN MIND: this fix will be GONE after the packet gets an update, so this is just intended as a helpful note to someone running into the same problem as I did!

So if anybody has a real solution, let us know :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .