sdgathman / pyspf

Other
49 stars 26 forks source link

NameError: name "strict" is not defined #17

Closed vrubiella closed 4 years ago

vrubiella commented 4 years ago

Several checks fails with this traceback:

: Traceback (most recent call last):
:   File "/var/policyd-spf/env/bin/policyd-spf", line 809, in <module>
:     instance_dict, configData, peruser, peruserconfigData)
:   File "/var/policyd-spf/env/bin/policyd-spf", line 623, in _spfcheck
:     mres = mfromquery.check()
:   File "/var/policyd-spf/env/lib/python3.5/site-packages/spf.py", line 591, in check
:     spf = self.dns_spf(self.d)
:   File "/var/policyd-spf/env/lib/python3.5/site-packages/spf.py", line 1160, in dns_spf
:     a = [t for t in self.dns_txt(domain) if RE_SPF.match(t)]
:   File "/var/policyd-spf/env/lib/python3.5/site-packages/spf.py", line 1210, in dns_txt
:     dns_list = self.dns(domainname, rr,ignore_void=ignore_void)
:   File "/var/policyd-spf/env/lib/python3.5/site-packages/spf.py", line 1354, in dns
:     for k, v in DNSLookup(name, qtype, self.strict, timeout):
:   File "/var/policyd-spf/env/lib/python3.5/site-packages/spf.py", line 106, in DNSLookup_pydns
:     if strict > 1:
: NameError: name 'strict' is not defined

Output: warning: command /var/policyd-spf/env/bin/policyd-spf exit status 1 warning: premature end-of-input on private/policy-spf while reading input attribute name

More info: I'm using this module from policyd-spf filter for postfix. Current installed version is: pyspf==2.0.13

sdgathman commented 4 years ago

This is the fix for the error introduced in 2.0.13 for spf.py:

-def DNSLookup_pydns(name, qtype, tcpfallback=True, timeout=30): +def DNSLookup_pydns(name, qtype, strict=True, timeout=20):

The 2.0.14.pre1 included that fix.

kitterma commented 4 years ago

@sdgathman Did you push your changes for 2.0.14.pre1 in git? I don't see them.

sdgathman commented 4 years ago

I forgot to push updated versions to 2.0.14pre1, but the fix is there. I just pushed the version changes.

niftylettuce commented 4 years ago

Any update here?

sdgathman commented 4 years ago

The fix is in 2.0.14. I'll mark this done.