Skip to content

Commit

Permalink
mail fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mxsasha committed Dec 3, 2024
1 parent 3d6b47e commit 2cd1972
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions checks/tasks/mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def do_spf(url, *args, **kwargs):
result = dict(
available=available,
score=score,
record=spf_record,
record=[spf_record] if spf_record else [],
policy_status=policy_status,
policy_score=policy_score,
policy_records=policy_records,
Expand Down Expand Up @@ -324,19 +324,19 @@ def spf_check_include_redirect(
return status, score, left_lookups


def spf_check_redirect(domain, term, task, policy_records, max_lookups):
def spf_check_redirect(domain, term, policy_records, max_lookups):
return spf_check_include_redirect(
domain, term, task, policy_records, max_lookups, "=", SpfPolicyStatus.invalid_redirect
domain, term, policy_records, max_lookups, "=", SpfPolicyStatus.invalid_redirect
)


def spf_check_include(domain, term, task, policy_records, max_lookups):
def spf_check_include(domain, term, policy_records, max_lookups):
return spf_check_include_redirect(
domain, term, task, policy_records, max_lookups, ":", SpfPolicyStatus.invalid_include, is_include=True
domain, term, policy_records, max_lookups, ":", SpfPolicyStatus.invalid_include, is_include=True
)


def spf_check_policy(domain, spf_record, task, policy_records, max_lookups=10, is_include=False):
def spf_check_policy(domain, spf_record, policy_records, max_lookups=10, is_include=False):
"""
Check the SPF policy for syntax and efficiency.
Expand Down Expand Up @@ -408,12 +408,12 @@ def spf_check_policy(domain, spf_record, task, policy_records, max_lookups=10, i
break

if "redirect=" in term and not all_found:
status, score, left_lookups = spf_check_redirect(domain, term, task, policy_records, left_lookups)
status, score, left_lookups = spf_check_redirect(domain, term, policy_records, left_lookups)
# Only one redirect is followed
break

elif "include:" in term:
status, score, left_lookups = spf_check_include(domain, term, task, policy_records, left_lookups)
status, score, left_lookups = spf_check_include(domain, term, policy_records, left_lookups)

if status != SpfPolicyStatus.valid:
policy_records.append((domain, spf_record))
Expand Down

0 comments on commit 2cd1972

Please sign in to comment.