Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Sep 2015 17:06:36 +0200
From:      "Herbert J. Skuhra" <herbert@oslo.ath.cx>
To:        freebsd-questions@freebsd.org
Cc:        Nagy =?iso-8859-1?B?TOFzemzz?= Zsolt <gandalf@shopzeus.com>
Subject:   Re: postfix + policyd-spf : ip address not recognized
Message-ID:  <20150929150636.GB85538@oslo.ath.cx>
In-Reply-To: <560A431D.4060108@shopzeus.com>
References:  <560A431D.4060108@shopzeus.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Sep 29, 2015 at 09:51:57AM +0200, Nagy László Zsolt wrote:
> System: FreeBSD 10.2-RELEASE-p2
> Postfix version: 2.11.6
> Policyd-spf version: py27-postfix-policyd-spf-python-1.2

This is not the latest version. I have just installed
'py27-postfix-policyd-spf-python-1.3.1'. 

> 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

Remove net/py-ipaddress and try again!

-- 
Herbert



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150929150636.GB85538>