Can anyone decipher this Policyd-spf error?

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Can anyone decipher this Policyd-spf error?

Danny Horne
Hi all,

I am getting the following error on just one email address from
policyd-spf, called from Postfix.  No other email address has caused me
problems (as far as I'm aware) and I had to completely disable
policyd-spf in Postfix to allow the email through.  Can anyone decipher
what the problem was?

Thanks for looking

Feb  4 14:32:04 gallium policyd-spf[8810]: None; identity=helo;
client-ip=2a00:1450:400c:c09::233; helo=mail-wm0-x233.google.com;
envelope-from=[hidden email]; receiver=[hidden email]
Feb  4 14:32:06 gallium policyd-spf[8810]: Traceback (most recent call
last):
Feb  4 14:32:06 gallium policyd-spf[8810]:  File "/usr/bin/policyd-spf",
line 680, in <module>
Feb  4 14:32:06 gallium policyd-spf[8810]:    instance_dict, configData,
peruser)
Feb  4 14:32:06 gallium policyd-spf[8810]:  File "/usr/bin/policyd-spf",
line 517, in _spfcheck
Feb  4 14:32:06 gallium policyd-spf[8810]:    res = spf.check2(ip,
sender, helo, querytime=configData.get('Lookup_Time'))
Feb  4 14:32:06 gallium policyd-spf[8810]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 297, in check2
Feb  4 14:32:06 gallium policyd-spf[8810]:  
receiver=receiver,timeout=timeout,verbose=verbose,querytime=querytime).check()
Feb  4 14:32:06 gallium policyd-spf[8810]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 547, in check
Feb  4 14:32:06 gallium policyd-spf[8810]:    rc = self.check1(spf,
self.d, 0)
Feb  4 14:32:06 gallium policyd-spf[8810]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 586, in check1
Feb  4 14:32:06 gallium policyd-spf[8810]:    return self.check0(spf,
recursion)
Feb  4 14:32:06 gallium policyd-spf[8810]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 900, in check0
Feb  4 14:32:06 gallium policyd-spf[8810]:    if
self.cidrmatch(self.dns_mx(arg), cidrlength):
Feb  4 14:32:06 gallium policyd-spf[8810]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 1194, in dns_mx
Feb  4 14:32:06 gallium policyd-spf[8810]:    return [a for mx in
mxnames[:max] for a in self.dns_a(mx[1],self.A)]
Feb  4 14:32:06 gallium policyd-spf[8810]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 1206, in dns_a
Feb  4 14:32:06 gallium policyd-spf[8810]:    return
[ipaddress.Bytes(ip) for ip in r]
Feb  4 14:32:06 gallium policyd-spf[8810]: AttributeError: 'module'
object has no attribute 'Bytes'
Feb  4 14:32:06 gallium postfix/smtpd[8803]: warning: premature
end-of-input on private/policyd-spf while reading input attribute name
Feb  4 14:32:07 gallium policyd-spf[8811]: None; identity=helo;
client-ip=2a00:1450:400c:c09::233; helo=mail-wm0-x233.google.com;
envelope-from=[hidden email]; receiver=[hidden email]
Feb  4 14:32:07 gallium policyd-spf[8811]: Traceback (most recent call
last):
Feb  4 14:32:07 gallium policyd-spf[8811]:  File "/usr/bin/policyd-spf",
line 680, in <module>
Feb  4 14:32:07 gallium policyd-spf[8811]:    instance_dict, configData,
peruser)
Feb  4 14:32:07 gallium policyd-spf[8811]:  File "/usr/bin/policyd-spf",
line 517, in _spfcheck
Feb  4 14:32:07 gallium policyd-spf[8811]:    res = spf.check2(ip,
sender, helo, querytime=configData.get('Lookup_Time'))
Feb  4 14:32:07 gallium policyd-spf[8811]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 297, in check2
Feb  4 14:32:07 gallium policyd-spf[8811]:  
receiver=receiver,timeout=timeout,verbose=verbose,querytime=querytime).check()
Feb  4 14:32:07 gallium policyd-spf[8811]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 547, in check
Feb  4 14:32:07 gallium policyd-spf[8811]:    rc = self.check1(spf,
self.d, 0)
Feb  4 14:32:07 gallium policyd-spf[8811]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 586, in check1
Feb  4 14:32:07 gallium policyd-spf[8811]:    return self.check0(spf,
recursion)
Feb  4 14:32:07 gallium policyd-spf[8811]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 900, in check0
Feb  4 14:32:07 gallium policyd-spf[8811]:    if
self.cidrmatch(self.dns_mx(arg), cidrlength):
Feb  4 14:32:07 gallium policyd-spf[8811]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 1194, in dns_mx
Feb  4 14:32:07 gallium policyd-spf[8811]:    return [a for mx in
mxnames[:max] for a in self.dns_a(mx[1],self.A)]
Feb  4 14:32:07 gallium policyd-spf[8811]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 1206, in dns_a
Feb  4 14:32:07 gallium policyd-spf[8811]:    return
[ipaddress.Bytes(ip) for ip in r]
Feb  4 14:32:07 gallium policyd-spf[8811]: AttributeError: 'module'
object has no attribute 'Bytes'
Feb  4 14:32:07 gallium postfix/smtpd[8803]: warning: premature
end-of-input on private/policyd-spf while reading input attribute name
Feb  4 14:32:07 gallium postfix/smtpd[8803]: warning: problem talking to
server private/policyd-spf: Success



signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone decipher this Policyd-spf error?

Bill Cole-3
On 4 Feb 2016, at 15:52, Danny Horne wrote:

> Hi all,
>
> I am getting the following error on just one email address from
> policyd-spf, called from Postfix.  No other email address has caused
> me
> problems (as far as I'm aware) and I had to completely disable
> policyd-spf in Postfix to allow the email through.  Can anyone
> decipher
> what the problem was?

Only enough to be sure that the problem happened inside policyd-spf and
that you're using the Python implementation, not the Perl one, since
that log mess is a Python error trackback.

These lines tell the immediate error:

Feb  4 14:32:06 gallium policyd-spf[8810]:  File
"/usr/lib/python2.7/site-packages/spf.py", line 1206, in dns_a
Feb  4 14:32:06 gallium policyd-spf[8810]:    return
[ipaddress.Bytes(ip) for ip in r]
Feb  4 14:32:06 gallium policyd-spf[8810]: AttributeError: 'module'
object has no attribute 'Bytes'

That would *probably* be meaningful to the developers of policyd-spf and
perhaps to any good Python developer. To me it says "spf.py has a bug"
but my guess is far from expert.

Looks possible that this is your answer:

https://bugs.launchpad.net/pypolicyd-spf/+bug/1229862/comments/3
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone decipher this Policyd-spf error?

Scott Kitterman-4
On Thursday, February 04, 2016 04:19:54 PM Bill Cole wrote:

> On 4 Feb 2016, at 15:52, Danny Horne wrote:
> > Hi all,
> >
> > I am getting the following error on just one email address from
> > policyd-spf, called from Postfix.  No other email address has caused
> > me
> > problems (as far as I'm aware) and I had to completely disable
> > policyd-spf in Postfix to allow the email through.  Can anyone
> > decipher
> > what the problem was?
>
> Only enough to be sure that the problem happened inside policyd-spf and
> that you're using the Python implementation, not the Perl one, since
> that log mess is a Python error trackback.
>
> These lines tell the immediate error:
>
> Feb  4 14:32:06 gallium policyd-spf[8810]:  File
> "/usr/lib/python2.7/site-packages/spf.py", line 1206, in dns_a
> Feb  4 14:32:06 gallium policyd-spf[8810]:    return
> [ipaddress.Bytes(ip) for ip in r]
> Feb  4 14:32:06 gallium policyd-spf[8810]: AttributeError: 'module'
> object has no attribute 'Bytes'
>
> That would *probably* be meaningful to the developers of policyd-spf and
> perhaps to any good Python developer. To me it says "spf.py has a bug"
> but my guess is far from expert.
>
> Looks possible that this is your answer:
>
> https://bugs.launchpad.net/pypolicyd-spf/+bug/1229862/comments/3

I believe that's correct.  I just confirmed that ipaddr.Bytes (which gets used
as ipaddress.Bytes in this policy server for python3 compatibility) was added
in ipaddr-py 2.1.10, so running with an older version will cause that error.

Scott K

Reply | Threaded
Open this post in threaded view
|

Re: Can anyone decipher this Policyd-spf error?

Danny Horne
Thanks for both replies,

I've just checked and I'm running python-ipaddr 2.1.9, with no updates
available.  I can live with the problem for now, I think this is the
only time I've seen that error (though that doesn't mean it hasn't
happened before).

Thanks again for your help

On 04/02/2016 9:34 pm, Scott Kitterman wrote:

> On Thursday, February 04, 2016 04:19:54 PM Bill Cole wrote:
>> On 4 Feb 2016, at 15:52, Danny Horne wrote:
>>> Hi all,
>>>
>>> I am getting the following error on just one email address from
>>> policyd-spf, called from Postfix.  No other email address has caused
>>> me
>>> problems (as far as I'm aware) and I had to completely disable
>>> policyd-spf in Postfix to allow the email through.  Can anyone
>>> decipher
>>> what the problem was?
>> Only enough to be sure that the problem happened inside policyd-spf and
>> that you're using the Python implementation, not the Perl one, since
>> that log mess is a Python error trackback.
>>
>> These lines tell the immediate error:
>>
>> Feb  4 14:32:06 gallium policyd-spf[8810]:  File
>> "/usr/lib/python2.7/site-packages/spf.py", line 1206, in dns_a
>> Feb  4 14:32:06 gallium policyd-spf[8810]:    return
>> [ipaddress.Bytes(ip) for ip in r]
>> Feb  4 14:32:06 gallium policyd-spf[8810]: AttributeError: 'module'
>> object has no attribute 'Bytes'
>>
>> That would *probably* be meaningful to the developers of policyd-spf and
>> perhaps to any good Python developer. To me it says "spf.py has a bug"
>> but my guess is far from expert.
>>
>> Looks possible that this is your answer:
>>
>> https://bugs.launchpad.net/pypolicyd-spf/+bug/1229862/comments/3
> I believe that's correct.  I just confirmed that ipaddr.Bytes (which gets used
> as ipaddress.Bytes in this policy server for python3 compatibility) was added
> in ipaddr-py 2.1.10, so running with an older version will cause that error.
>
> Scott K


signature.asc (836 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone decipher this Policyd-spf error?

Tom Hendrikx
Hi,

As the ticket says, the error is caused by handling ipv6 addresses. When
you hit any troubles later, you could look into disabling ipv6 :/

Regards,
        Tom

On 05-02-16 00:08, Danny Horne wrote:

> Thanks for both replies,
>
> I've just checked and I'm running python-ipaddr 2.1.9, with no updates
> available.  I can live with the problem for now, I think this is the
> only time I've seen that error (though that doesn't mean it hasn't
> happened before).
>
> Thanks again for your help
>
> On 04/02/2016 9:34 pm, Scott Kitterman wrote:
>> On Thursday, February 04, 2016 04:19:54 PM Bill Cole wrote:
>>> On 4 Feb 2016, at 15:52, Danny Horne wrote:
>>>> Hi all,
>>>>
>>>> I am getting the following error on just one email address from
>>>> policyd-spf, called from Postfix.  No other email address has caused
>>>> me
>>>> problems (as far as I'm aware) and I had to completely disable
>>>> policyd-spf in Postfix to allow the email through.  Can anyone
>>>> decipher
>>>> what the problem was?
>>> Only enough to be sure that the problem happened inside policyd-spf and
>>> that you're using the Python implementation, not the Perl one, since
>>> that log mess is a Python error trackback.
>>>
>>> These lines tell the immediate error:
>>>
>>> Feb  4 14:32:06 gallium policyd-spf[8810]:  File
>>> "/usr/lib/python2.7/site-packages/spf.py", line 1206, in dns_a
>>> Feb  4 14:32:06 gallium policyd-spf[8810]:    return
>>> [ipaddress.Bytes(ip) for ip in r]
>>> Feb  4 14:32:06 gallium policyd-spf[8810]: AttributeError: 'module'
>>> object has no attribute 'Bytes'
>>>
>>> That would *probably* be meaningful to the developers of policyd-spf and
>>> perhaps to any good Python developer. To me it says "spf.py has a bug"
>>> but my guess is far from expert.
>>>
>>> Looks possible that this is your answer:
>>>
>>> https://bugs.launchpad.net/pypolicyd-spf/+bug/1229862/comments/3
>> I believe that's correct.  I just confirmed that ipaddr.Bytes (which gets used
>> as ipaddress.Bytes in this policy server for python3 compatibility) was added
>> in ipaddr-py 2.1.10, so running with an older version will cause that error.
>>
>> Scott K
>
>
Reply | Threaded
Open this post in threaded view
|

RE: Can anyone decipher this Policyd-spf error?

L.P.H. van Belle
Switch to the perl version of this and your problem is fixed.

Use postfix-policyd-spf-perl
Not postfix-policyd-spf-python

Both work the same, but the perl version works fine with ipv6 on my server.

Greetz,

Louis


> -----Oorspronkelijk bericht-----
> Van: [hidden email] [mailto:[hidden email]] Namens Tom
> Hendrikx
> Verzonden: vrijdag 5 februari 2016 9:56
> Aan: [hidden email]
> Onderwerp: Re: Can anyone decipher this Policyd-spf error?
>
> Hi,
>
> As the ticket says, the error is caused by handling ipv6 addresses. When
> you hit any troubles later, you could look into disabling ipv6 :/
>
> Regards,
> Tom
>
> On 05-02-16 00:08, Danny Horne wrote:
> > Thanks for both replies,
> >
> > I've just checked and I'm running python-ipaddr 2.1.9, with no updates
> > available.  I can live with the problem for now, I think this is the
> > only time I've seen that error (though that doesn't mean it hasn't
> > happened before).
> >
> > Thanks again for your help
> >
> > On 04/02/2016 9:34 pm, Scott Kitterman wrote:
> >> On Thursday, February 04, 2016 04:19:54 PM Bill Cole wrote:
> >>> On 4 Feb 2016, at 15:52, Danny Horne wrote:
> >>>> Hi all,
> >>>>
> >>>> I am getting the following error on just one email address from
> >>>> policyd-spf, called from Postfix.  No other email address has caused
> >>>> me
> >>>> problems (as far as I'm aware) and I had to completely disable
> >>>> policyd-spf in Postfix to allow the email through.  Can anyone
> >>>> decipher
> >>>> what the problem was?

> >>> Only enough to be sure that the problem happened inside policyd-spf
> and
> >>> that you're using the Python implementation, not the Perl one, since
> >>> that log mess is a Python error trackback.
> >>>
> >>> These lines tell the immediate error:
> >>>
> >>> Feb  4 14:32:06 gallium policyd-spf[8810]:  File
> >>> "/usr/lib/python2.7/site-packages/spf.py", line 1206, in dns_a
> >>> Feb  4 14:32:06 gallium policyd-spf[8810]:    return
> >>> [ipaddress.Bytes(ip) for ip in r]
> >>> Feb  4 14:32:06 gallium policyd-spf[8810]: AttributeError: 'module'
> >>> object has no attribute 'Bytes'
> >>>
> >>> That would *probably* be meaningful to the developers of policyd-spf
> and
> >>> perhaps to any good Python developer. To me it says "spf.py has a bug"
> >>> but my guess is far from expert.
> >>>
> >>> Looks possible that this is your answer:
> >>>
> >>> https://bugs.launchpad.net/pypolicyd-spf/+bug/1229862/comments/3
> >> I believe that's correct.  I just confirmed that ipaddr.Bytes (which
> gets used
> >> as ipaddress.Bytes in this policy server for python3 compatibility) was
> added
> >> in ipaddr-py 2.1.10, so running with an older version will cause that
> error.
> >>
> >> Scott K
> >
> >


Reply | Threaded
Open this post in threaded view
|

Re: Can anyone decipher this Policyd-spf error?

Scott Kitterman-4
On Friday, February 05, 2016 11:09:03 AM L.P.H. van Belle wrote:
> Switch to the perl version of this and your problem is fixed.
>
> Use postfix-policyd-spf-perl
> Not postfix-policyd-spf-python
>
> Both work the same, but the perl version works fine with ipv6 on my server.

Both work fine with IPv6 with as long as their dependencies are correct.  The
Perl implementation does work well for the use cases it satisfies, but it is
much simpler than the Python implementation.  Switching may work fine as long
as you don't need any features not provided in the Perl version.

Scott K
Reply | Threaded
Open this post in threaded view
|

Re: Can anyone decipher this Policyd-spf error?

Danny Horne
I've decided to stop using SPF checking until I've got the later version
of python-ipaddr (or whatever it was called)

On 05/02/2016 2:49 pm, Scott Kitterman wrote:

> On Friday, February 05, 2016 11:09:03 AM L.P.H. van Belle wrote:
>> Switch to the perl version of this and your problem is fixed.
>>
>> Use postfix-policyd-spf-perl
>> Not postfix-policyd-spf-python
>>
>> Both work the same, but the perl version works fine with ipv6 on my server.
> Both work fine with IPv6 with as long as their dependencies are correct.  The
> Perl implementation does work well for the use cases it satisfies, but it is
> much simpler than the Python implementation.  Switching may work fine as long
> as you don't need any features not provided in the Perl version.
>
> Scott K


signature.asc (836 bytes) Download Attachment