Skip to content

Commit

Permalink
Merge pull request #1705 from YunoHost/fix-2235
Browse files Browse the repository at this point in the history
[fix]  Diagnosis: reverse DNS check should be case-insensitive #2235
  • Loading branch information
alexAubin authored Aug 31, 2023
2 parents 65d2571 + 0b05143 commit f895f99
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/diagnosers/24-mail.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class MyDiagnoser(Diagnoser):
dependencies: List[str] = ["ip"]

def run(self):
self.ehlo_domain = _get_maindomain()
self.ehlo_domain = _get_maindomain().lower()
self.mail_domains = domain_list()["domains"]
self.ipversions, self.ips = self.get_ips_checked()

Expand Down Expand Up @@ -132,7 +132,7 @@ def check_ehlo(self):
summary=summary,
details=[summary + "_details"],
)
elif r["helo"] != self.ehlo_domain:
elif r["helo"].lower() != self.ehlo_domain:
yield dict(
meta={"test": "mail_ehlo", "ipversion": ipversion},
data={"wrong_ehlo": r["helo"], "right_ehlo": self.ehlo_domain},
Expand Down Expand Up @@ -185,7 +185,7 @@ def check_fcrdns(self):
rdns_domain = ""
if len(value) > 0:
rdns_domain = value[0][:-1] if value[0].endswith(".") else value[0]
if rdns_domain != self.ehlo_domain:
if rdns_domain.lower() != self.ehlo_domain:
details = [
"diagnosis_mail_fcrdns_different_from_ehlo_domain_details"
] + details
Expand All @@ -194,7 +194,7 @@ def check_fcrdns(self):
data={
"ip": ip,
"ehlo_domain": self.ehlo_domain,
"rdns_domain": rdns_domain,
"rdns_domain": rdns_domain.lower(),
},
status="ERROR",
summary="diagnosis_mail_fcrdns_different_from_ehlo_domain",
Expand Down

0 comments on commit f895f99

Please sign in to comment.