diff --git a/checks/categories.py b/checks/categories.py index 5687ec563..9ccb300bf 100644 --- a/checks/categories.py +++ b/checks/categories.py @@ -2263,12 +2263,12 @@ def __init__(self): def result_good(self, tech_data): self._status(STATUS_SUCCESS) - self.verdict = "detail mail auth spf verdict good" + self.verdict = "detail mail auth tlsrpt verdict good" self.tech_data = [[tech_data]] def result_bad(self, tech_data): self._status(STATUS_FAIL) - self.verdict = "detail mail auth spf verdict bad" + self.verdict = "detail mail auth tlsrp verdict bad" if tech_data: # More than one spf record. Show the records. self.tech_data = [[tech_data]] diff --git a/checks/models.py b/checks/models.py index e119cae52..c09947b02 100644 --- a/checks/models.py +++ b/checks/models.py @@ -1010,6 +1010,9 @@ class MailTestAuth(BaseTestModel): spf_policy_status = EnumIntegerField(SpfPolicyStatus, null=True) spf_policy_score = models.IntegerField(null=True) spf_policy_records = ListField(null=True) + tlsrpt_score = models.IntegerField(null=True) + tlsrpt_available = models.BooleanField(null=True, default=False) + tlsrpt_record = ListField(default=[]) score = models.IntegerField(null=True) max_score = models.IntegerField(null=True) @@ -1032,6 +1035,9 @@ def __dir__(self): "spf_policy_status", "spf_policy_score", "spf_policy_records", + "tlsrpt_score", + "tlsrpt_available", + "tlsrpt_record", "score", "max_score", ] diff --git a/checks/tasks/mail.py b/checks/tasks/mail.py index 2e76c850b..af467d8e1 100644 --- a/checks/tasks/mail.py +++ b/checks/tasks/mail.py @@ -217,6 +217,12 @@ def callback(results, addr, category): else: subtests["spf"].result_bad(spf_record) + elif testname == "tlsrpt": + tlsrpt_available = result.get("available") + tlsrpt_record = result.get("record") + tlsrpt_score = result.get("score") + # TODO: Pass results to mtauth and subtests + print("This is the callback for TLS-RPT.") if skip_dkim_for_non_sending_domain(mtauth): mtauth.dkim_score = scoring.MAIL_AUTH_DKIM_PASS