From b05b952de291b595f13b6165068df137300ee3a3 Mon Sep 17 00:00:00 2001 From: Shane Frasier Date: Fri, 16 Nov 2018 21:46:13 -0500 Subject: [PATCH 1/2] Bumped version from 0.6.3 to 0.6.4 --- trustymail/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trustymail/__init__.py b/trustymail/__init__.py index 07545b4..9194e8a 100644 --- a/trustymail/__init__.py +++ b/trustymail/__init__.py @@ -1,6 +1,6 @@ from __future__ import unicode_literals, absolute_import, print_function -__version__ = '0.6.3' +__version__ = '0.6.4' PublicSuffixListFilename = 'public_suffix_list.dat' PublicSuffixListReadOnly = False From 56fcc07224a89726994dcf539264aa2300c7b021 Mon Sep 17 00:00:00 2001 From: Shane Frasier Date: Fri, 16 Nov 2018 21:46:31 -0500 Subject: [PATCH 2/2] Stop looking up the SPF record twice If we include the SPF record (as obtained by following redirects) as an argument to spf.query.check(), then that method will not look up the SPF record a second time. I suspect that these repeated DNS queries may be occasionally failing, and that is what is responsible for the "Result unexpectedly differs" errors that are seen in the trustymail results. --- trustymail/trustymail.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/trustymail/trustymail.py b/trustymail/trustymail.py index 4a2a3c2..f6fe849 100755 --- a/trustymail/trustymail.py +++ b/trustymail/trustymail.py @@ -204,7 +204,7 @@ def check_spf_record(record_text, expected_result, domain, strict=2): query = spf.query('128.143.22.36', 'email_wizard@' + domain.domain_name, domain.domain_name, strict=strict) - response = query.check() + response = query.check(spf=record_text) response_type = response[0] if response_type == 'temperror' or response_type == 'permerror': @@ -325,7 +325,7 @@ def spf_scan(resolver, domain): else: result = 'neutral' - check_spf_record(record_text_not_following_redirect, result, domain) + check_spf_record(record_text_following_redirect, result, domain) def parse_dmarc_report_uri(uri):