mirror of
https://lab.it.hs-hannover.de/misc/pymilter-suspicious-from.git
synced 2024-11-27 23:49:55 +01:00
Do not be case sensitive when comparing domains
This commit is contained in:
parent
436c7db707
commit
eb1fa14665
1
main.py
1
main.py
@ -83,6 +83,7 @@ class SuspiciousFrom(Milter.Base):
|
|||||||
decoded_from = normalizeRawFromHeader(decoded_from)
|
decoded_from = normalizeRawFromHeader(decoded_from)
|
||||||
logger.info(f"({self.id}) \"From:\" decoded cleaned: '{decoded_from}'")
|
logger.info(f"({self.id}) \"From:\" decoded cleaned: '{decoded_from}'")
|
||||||
all_domains = address_domain_regex.findall(decoded_from)
|
all_domains = address_domain_regex.findall(decoded_from)
|
||||||
|
all_domains = [a.lower() for a in all_domains]
|
||||||
if len(all_domains) == 0:
|
if len(all_domains) == 0:
|
||||||
logger.warning(f"({self.id}) No domain in decoded \"From:\" - WTF! OK, though")
|
logger.warning(f"({self.id}) No domain in decoded \"From:\" - WTF! OK, though")
|
||||||
self.set_suspicious_headers(False, "No domains in decoded FROM")
|
self.set_suspicious_headers(False, "No domains in decoded FROM")
|
||||||
|
Loading…
Reference in New Issue
Block a user