Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 05 Jan 2016 01:30:02 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-ports-bugs@FreeBSD.org
Subject:   [Bug 205910] postfix-policyd-spf-python-1.3.2_1 breaks ability to receive mail
Message-ID:  <bug-205910-13@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D205910

            Bug ID: 205910
           Summary: postfix-policyd-spf-python-1.3.2_1 breaks ability to
                    receive mail
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: Individual Port(s)
          Assignee: sunpoet@FreeBSD.org
          Reporter: freebsd-bugs@joe.mulloy.me
             Flags: maintainer-feedback?(sunpoet@FreeBSD.org)
          Assignee: sunpoet@FreeBSD.org

Revision 404778 changed postfix-policyd-spf-python to always depend on
dns/py-py3dns which causes postfix-policyd-spf-python to crash, which retur=
ns a
non-zero exit status which causes Postfix to reject all mail. Undoing the
change in the Makefile fixes the crashing, but the underlying parsing issue
still exists. With the temporary fix postfix-policyd-spf-python doesn't cra=
sh
but it doesn't seem like it will be able to filter either. This port should
probably be updated or forked to support Python 3 as that seems to be the
recommendation from upstream and the next version will by Python 3 only.

https://svnweb.freebsd.org/ports?view=3Drevision&revision=3D404778

Related bug reports:
https://bugs.launchpad.net/pypolicyd-spf/+bug/1495159 (Upstream)

Linux Distro Bugs:
https://bugs.gentoo.org/show_bug.cgi?id=3D559364
https://bugzilla.redhat.com/show_bug.cgi?id=3D1230373
https://bugzilla.redhat.com/show_bug.cgi?id=3D1232595

Before:
RUN_DEPENDS=3D    ${PYTHON_PKGNAMEPREFIX}py3dns>=3D0:${PORTSDIR}/dns/py-py3=
dns

maillog:
Jan  5 00:51:39 mail policyd-spf[5314]: Config: {'Mail_From_reject': 'Fail',
'Void_Limit': 2, 'Lookup_Time': 20, 'H
ELO_reject': 'SPF_Not_Pass', 'Header_Type': 'SPF', 'defaultSeedOnly': 1,
'PermError_reject': 'True', 'debugLevel':
5, 'skip_addresses': '127.0.0.0/8,::ffff:127.0.0.0/104,::1', 'TempError_Def=
er':
'True'}
Jan  5 00:51:39 mail policyd-spf[5314]: Cached data for this instance: []
Jan  5 00:51:39 mail policyd-spf[5314]: ERROR: 127.0.0.0/8 in skip_addresses
not IP network.  Message: '209.85.223.
174' 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 whitelist processing.
Jan  5 00:51:39 mail policyd-spf[5314]: Traceback (most recent call last):
Jan  5 00:51:39 mail policyd-spf[5314]:   File "/usr/local/bin/policyd-spf",
line 700, in <module>
Jan  5 00:51:39 mail policyd-spf[5314]:     instance_dict, configData, peru=
ser)
Jan  5 00:51:39 mail policyd-spf[5314]:   File "/usr/local/bin/policyd-spf",
line 412, in _spfcheck
Jan  5 00:51:39 mail policyd-spf[5314]:     res =3D spf.check2(ip,
helo_fake_sender, helo, querytime=3DconfigData.get('
Lookup_Time'))
Jan  5 00:51:39 mail policyd-spf[5314]:   File "/usr/local/bin/spf.py", line
315, in check2
Jan  5 00:51:39 mail policyd-spf[5314]:=20=20=20=20
receiver=3Dreceiver,timeout=3Dtimeout,verbose=3Dverbose,querytime=3Dqueryti=
me).
check()
Jan  5 00:51:39 mail policyd-spf[5314]:   File "/usr/local/bin/spf.py", line
572, in check
Jan  5 00:51:39 mail policyd-spf[5314]:     spf =3D self.dns_spf(self.d)
Jan  5 00:51:39 mail policyd-spf[5314]:   File "/usr/local/bin/spf.py", line
1141, in dns_spf
Jan  5 00:51:39 mail policyd-spf[5314]:     a =3D [t for t in
self.dns_txt(domain) if RE_SPF.match(t)]
Jan  5 00:51:39 mail policyd-spf[5314]:   File "/usr/local/bin/spf.py", line
1190, in dns_txt
Jan  5 00:51:39 mail policyd-spf[5314]:     dns_list =3D self.dns(domainnam=
e,
rr,ignore_void=3Dignore_void)
Jan  5 00:51:39 mail policyd-spf[5314]:   File "/usr/local/bin/spf.py", line
1318, in dns
Jan  5 00:51:39 mail policyd-spf[5314]:     for k, v in DNSLookup(name, qty=
pe,
self.strict, timeout):
Jan  5 00:51:39 mail policyd-spf[5314]:   File "/usr/local/bin/spf.py", line
138, in DNSLookup
Jan  5 00:51:39 mail policyd-spf[5314]:     resp =3D req.req()
Jan  5 00:51:39 mail policyd-spf[5314]:   File
"/usr/local/lib/python2.7/site-packages/DNS/Base.py", line 315, in r
eq
Jan  5 00:51:39 mail policyd-spf[5314]:     m =3D Lib.Mpacker()
Jan  5 00:51:39 mail policyd-spf[5314]:   File
"/usr/local/lib/python2.7/site-packages/DNS/Lib.py", line 341, in __
init__
Jan  5 00:51:39 mail policyd-spf[5314]:     Packer.__init__(self)
Jan  5 00:51:39 mail policyd-spf[5314]:   File
"/usr/local/lib/python2.7/site-packages/DNS/Lib.py", line 114, in __
init__
Jan  5 00:51:39 mail policyd-spf[5314]:     self.buf =3D bytes('', enc)
Jan  5 00:51:39 mail policyd-spf[5314]: TypeError: str() takes at most 1
argument (2 given)
Jan  5 00:51:39 mail postfix/spawn[5312]: warning: command
/usr/local/bin/policyd-spf exit status 1
Jan  5 00:51:39 mail postfix/smtpd[5310]: warning: premature end-of-input on
private/policyd-spf while reading inpu
t attribute name
Jan  5 00:51:39 mail postfix/smtpd[5310]: warning: problem talking to server
private/policyd-spf: No error: 0
Jan  5 00:51:39 mail postfix/smtpd[5310]: NOQUEUE: reject: RCPT from
mail-io0-f174.google.com[209.85.223.174]: 451
4.3.5 Server configuration problem; from=3D<example@gmail.com>
to=3D<joe@example.com> proto=3DESMTP helo=3D<mail-io0-f174.go
ogle.com>

After:
RUN_DEPENDS=3D    ${PYTHON_PKGNAMEPREFIX}dns>=3D0:${PORTSDIR}/dns/py-dns

maillog:
Jan  5 01:15:12 mail policyd-spf[6423]: Config: {'Mail_From_reject': 'Fail',
'Void_Limit': 2, 'Lookup_Time': 20, 'HELO_reject': 'SPF_Not_Pass',
'Header_Type': 'SPF', 'defaultSeedOnly': 1, 'PermError_reject': 'True',
'debugLevel': 5, 'skip_addresses': '127.0.0.0/8,::ffff:127.0.0.0/104,::1',
'TempError_Defer': 'True'}
Jan  5 01:15:12 mail policyd-spf[6423]: Cached data for this instance: []
Jan  5 01:15:12 mail policyd-spf[6423]: ERROR: 127.0.0.0/8 in skip_addresses
not IP network.  Message: '209.85.213.170' 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 whitelist processing.
Jan  5 01:15:12 mail policyd-spf[6423]: spfcheck: pyspf result: "['None', '=
',
'helo']"
Jan  5 01:15:12 mail policyd-spf[6423]: None; identity=3Dhelo;
client-ip=3D209.85.213.170; helo=3Dmail-ig0-f170.google.com;
envelope-from=3Dexample@gmail.com; receiver=3Djoseph@example.com
Jan  5 01:15:12 mail policyd-spf[6423]: Header type: SPF; Authres ID (for A=
R):
None
Jan  5 01:15:12 mail policyd-spf[6423]: spfcheck: pyspf result: "['Pass',
'sender SPF authorized', 'mailfrom']"
Jan  5 01:15:12 mail policyd-spf[6423]: Pass; identity=3Dmailfrom;
client-ip=3D209.85.213.170; helo=3Dmail-ig0-f170.google.com;
envelope-from=3Dexample@gmail.com; receiver=3Djoseph@example.com
Jan  5 01:15:12 mail policyd-spf[6423]: Header type: SPF; Authres ID (for A=
R):
None
Jan  5 01:15:12 mail policyd-spf[6423]: Action: prepend: Text: Received-SPF:
Pass (sender SPF authorized) identity=3Dmailfrom; client-ip=3D209.85.213.17=
0;
helo=3Dmail-ig0-f170.google.com; envelope-from=3Dexample@gmail.com;
receiver=3Djoseph@example.com
Jan  5 01:15:12 mail postfix/smtpd[6419]: 86DB4254:
client=3Dmail-ig0-f170.google.com[209.85.213.170]
Jan  5 01:15:12 mail postfix/cleanup[6424]: 86DB4254:
message-id=3D<CABYAtyVFKFrmG8F6xB64C=3DBHzKs2m0-wg7uWM1i_3MtCFbB6fw@mail.gm=
ail.com>
Jan  5 01:15:12 mail postfix/qmgr[6391]: 86DB4254: from=3D<example@gmail.co=
m>,
size=3D1814, nrcpt=3D1 (queue active)
Jan  5 01:15:12 mail postfix/smtpd[6419]: disconnect from
mail-ig0-f170.google.com[209.85.213.170]

--=20
You are receiving this mail because:
You are the assignee for the bug.=



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