postfix + policyd-spf : ip address not recognized

Nagy László Zsolt gandalf at shopzeus.com
Fri Oct 2 10:24:45 UTC 2015


>> /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
> Remove net/py-ipaddress and try again!
>
py-ipaddress was installed using pip and not the ports tree.  This is
sometimes confusing: python modules can be installed with pkg, the ports
tree, pip and easy_install.

But py27-ipaddr was installed from the ports tree (as a dependency). For
python packanges I prefer to use pip, because some pure python packages
are not available from the ports tree. But sometimes they mix and I
could not yet find a general good solution.

After uninstalling ipaddress ("pip uninstall ipaddress") the SPF policy
daemon works as expected.

I think that the good solution in this case would be this:

  * create a patch for policyd-spf freebsd package, and remove python
    import statements for ipaddress package (e.g. force to use ipaddr
    package)
  * leave py27-ipaddr as a dependency for policyd-spf


This python related bug was still unresolved on bugzilla two months ago.
And because the new package system uses quarterly builds, the bug is
still in the system.

Unfortunately, I don't know how to create and submit a patch. But it
would be very easy, just replacing this:


-----
try:
    import ipaddress
except ImportError:
    import ipaddr as ipaddress
-----

Into this:

-----
import ipaddr as ipaddress
-----

Removing the ipaddress package is another "solution", but it not good
because it can be installed as a dependency, anytime.

   Laszlo





More information about the freebsd-questions mailing list