ipaddress is included in python3, but not python2. pypolicyd-spf tries to import ipaddress and when that fails, imports ipaddr instead. However, dev-python/ipaddress (a backport of the python3 functionality) is now available. So, if dev-python/ipaddress gets installed pypolicyd-spf will attempt to use it instead of ipaddr and it assumes the incorrect usage semantics (character strings, not byte strings, see: https://github.com/phihag/ipaddress). This causes a fatal error than can block mail delivery. Reproducible: Always Steps to Reproduce: 1. install stable pypolicyd-spf 2. install dev-python/ipaddress 3. watch mail delivery fail See: https://bugzilla.redhat.com/show_bug.cgi?id=1230373 and: https://bugzilla.redhat.com/show_bug.cgi?id=1232595 The fix is to stop using ipaddr and use the correct usage semantics. (There's a related fix needed for dev-python/pyspf too.)
Created attachment 410806 [details, diff] use ipaddress exclusively and use it correctly
Created attachment 410808 [details] pypolicyd-spf-1.3.2.ebuild
Created attachment 410810 [details] pypolicyd-spf-1.2-r1.ebuild
Created attachment 410812 [details, diff] ipaddress.patch
@python Upstream is going to be python3-only next release, and they suggest using python3 to solve this problem. I plan on trying a pypolicyd-spf-1.3.2-r1 that has PYTHON_COMPAT=( python{3_3,3_4} ) and dropping the ipaddr dependency. I'll test this to make sure of a few things: * eselecting python2 doesn't break it (it gets run via the python-exec wrapper). * installing dev-python/ipaddress (which installs for python3?) doesn't affect it. I will do testing on a real mail server but if you see any obvious problems with the above please let me know before I crash everything.
This is fixed in https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=948a8a4aa89c00dd9f8dac44172d9b05284678c8 by removing python2 support. Sadly I can't fix the stable version, but please test the new revision and see if it solves the problem for you. If it does, comment on bug #529492 and I will update the stabilization request for this new revision.