mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
dnstools: ignore extra spaces in records.
This commit is contained in:
@@ -165,6 +165,8 @@ def check_spf_syntax(record):
|
||||
modifiers = []
|
||||
mechanisms = []
|
||||
for part in parts:
|
||||
if part == "":
|
||||
continue
|
||||
qualifier = None
|
||||
if part[0] in ["+", "-", "~", "?"]:
|
||||
qualifier = part[0]
|
||||
@@ -200,6 +202,8 @@ def check_dkim_syntax(record):
|
||||
key = None
|
||||
for tag in record.split(";")[1:]:
|
||||
tag = tag.strip(" ")
|
||||
if tag == "":
|
||||
continue
|
||||
parts = tag.split("=", 1)
|
||||
if len(parts) != 2:
|
||||
raise DNSSyntaxError(_("Invalid tag {}").format(tag))
|
||||
@@ -250,6 +254,8 @@ def check_dmarc_syntax(record):
|
||||
raise DNSSyntaxError(_("Not a valid DMARC record"))
|
||||
tags = {}
|
||||
for tag in record.split(";")[1:]:
|
||||
if tag == "":
|
||||
continue
|
||||
tag = tag.strip(" ")
|
||||
parts = tag.split("=")
|
||||
if len(parts) != 2:
|
||||
|
||||
@@ -44,7 +44,7 @@ GOOD_SPF_RECORDS = [
|
||||
"v=spf1 ptr -all",
|
||||
"v=spf1 ptr:otherdomain.com -all",
|
||||
"v=spf1 exists:example.com -all",
|
||||
"v=spf1 include:example.com -all",
|
||||
"v=spf1 include:example.com -all",
|
||||
"v=spf1 ?include:example.com -all",
|
||||
"v=spf1 redirect=example.com",
|
||||
"v=spf1 exp=example.com",
|
||||
|
||||
Reference in New Issue
Block a user