From owner-freebsd-questions@freebsd.org Tue Sep 29 15:06:47 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4670A0C8A1 for ; Tue, 29 Sep 2015 15:06:47 +0000 (UTC) (envelope-from herbert@oslo.ath.cx) Received: from oslo.ath.cx (oslo.ath.cx [IPv6:2a01:4f8:200:42e4::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D7A01AFE for ; Tue, 29 Sep 2015 15:06:47 +0000 (UTC) (envelope-from herbert@oslo.ath.cx) Received: from oslo.ath.cx (localhost [IPv6:::1]) by oslo.ath.cx (Postfix) with ESMTP id E147614BC; Tue, 29 Sep 2015 17:06:36 +0200 (CEST) Date: Tue, 29 Sep 2015 17:06:36 +0200 From: "Herbert J. Skuhra" To: freebsd-questions@freebsd.org Cc: Nagy =?iso-8859-1?B?TOFzemzz?= Zsolt Subject: Re: postfix + policyd-spf : ip address not recognized Message-ID: <20150929150636.GB85538@oslo.ath.cx> References: <560A431D.4060108@shopzeus.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <560A431D.4060108@shopzeus.com> User-Agent: Mutt/1.5.24+9 (2dac9fa02842) (2015-08-30) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2015 15:06:47 -0000 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 > 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