Skip to content

Commit

Permalink
Add some verbosity to the SPF testing output
Browse files Browse the repository at this point in the history
This change causes the SPF library we are using to output (to standard
out) any additional SPF records that are looked up in the course of
validating the one corresponding to the being tested.  This
information is occasionally useful when debugging BOD 18-01 scanning
issues.
  • Loading branch information
jsf9k committed Dec 18, 2018
1 parent 1d10227 commit a4214e0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion trustymail/trustymail.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,13 @@ def check_spf_record(record_text, expected_result, domain, strict=2):
# I'm actually temporarily using an IP that virginia.edu resolves to
# until we resolve why Google DNS does not return the same PTR records
# as the CAL DNS does for 64.69.57.18.
#
# Passing verbose=True causes the SPF library being used to
# print out the SPF records encountered as include and
# redirect cause other SPF records to be looked up.
query = spf.query('128.143.22.36',
'email_wizard@' + domain.domain_name,
domain.domain_name, strict=strict)
domain.domain_name, strict=strict, verbose=True)
response = query.check(spf=record_text)

response_type = response[0]
Expand Down

0 comments on commit a4214e0

Please sign in to comment.