Skip to content

Commit 0b82fc9

Browse files
committed
5.14.1
Make the DMARC `p` tag required again until DMARCbis is released
1 parent 1e9c38b commit 0b82fc9

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 5.14.1
4+
5+
### Fixes
6+
7+
- Make the DMARC `p` tag required again until DMARCbis is released with an RFC number.
8+
39
## 5.14.0
410

511
### DMARCbis changes

checkdmarc/_constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
See the License for the specific language governing permissions and
2020
limitations under the License."""
2121

22-
__version__ = "5.14.0"
22+
__version__ = "5.14.1"
2323

2424
OS = platform.system()
2525
OS_RELEASE = platform.release()

checkdmarc/dmarc.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ class DMARCErrorData(TypedDict, total=False):
434434
},
435435
"p": {
436436
"name": "Requested Mail Receiver Policy",
437-
"required": False,
437+
"required": True,
438438
"description": (
439439
"Specifies the policy to "
440440
"be enacted by the "
@@ -1342,11 +1342,12 @@ def parse_dmarc_record(
13421342
if tag not in tags and "default" in dmarc_tags[tag]:
13431343
tags[tag] = {"value": dmarc_tags[tag]["default"], "explicit": False}
13441344
if "p" not in tags:
1345-
tags["p"] = {"value": "none", "explicit": False}
1346-
warnings.append(
1347-
"The p tag is optional in DMARCbis, but is required "
1348-
"in older versions of DMARC."
1349-
)
1345+
raise DMARCSyntaxError('The record is missing the required policy ("p") tag.')
1346+
# tags["p"] = {"value": "none", "explicit": False}
1347+
# warnings.append(
1348+
# "A missing p tag is equivalent to p=none in DMARCbis, "
1349+
# "but a p tag is required in older versions of DMARC."
1350+
# )
13501351
tags["p"]["value"] = tags["p"]["value"].lower()
13511352
if "sp" not in tags:
13521353
tags["sp"] = {"value": tags["p"]["value"], "explicit": False}

0 commit comments

Comments
 (0)