Fixes for SPF record parsing

This commit is contained in:
Reimar 2026-02-13 17:43:20 +01:00
parent 36ca29853b
commit 1368a6400c
Signed by: Reimar
GPG Key ID: 93549FA07F0AE268
2 changed files with 10 additions and 10 deletions

View File

@ -26,56 +26,56 @@ export class SpfRecord {
.desc("Match the IP addresses from the MX records of these domains (or current domain if none specified)")
.value(ValueRequirement.OPTIONAL)
.multiple()
.pos(2),
.pos(1),
new DomainMechanism("ptr")
.disabled()
.value(ValueRequirement.OPTIONAL)
.multiple()
.pos(2),
.pos(1),
new IPv4Mechanism("ip4")
.label("IPv4 addresses")
.desc("Match these IP addresses")
.multiple()
.pos(2),
.pos(1),
new IPv6Mechanism("ip6")
.label("IPv6 addresses")
.desc("Match these IP addresses")
.multiple()
.pos(2),
.pos(1),
new DomainMechanism("include")
.label("Include")
.desc("Check the SPF record of another domain. If it passes, return with the selected result")
.multiple()
.pos(2),
.pos(1),
new DomainMechanism("exists")
.label("Exists")
.desc("Apply only if this domain exists (can be used with macro expansions)")
.category("advanced")
.multiple()
.pos(2),
.pos(1),
new Mechanism("all")
.label("All others")
.desc("How to treat the rest of the IP addresses")
.value(ValueRequirement.PROHIBITED)
.pos(3),
.pos(2),
new Modifier("redirect")
.label("Redirect")
.desc("Redirect to the SPF record of this domain if no matches were found")
.category("advanced")
.pos(4),
.pos(3),
new Modifier("exp")
.label("Explanation")
.desc("Points to a domain whose TXT record contains an error message if validation fails. Macros can be used here")
.category("advanced")
.pos(4),
.pos(3),
];
static categories = {

View File

@ -18,7 +18,7 @@ export class IPv4Mechanism extends Mechanism {
});
if (segments.length !== 4 || !valid) {
throw new ValidationError(`Value for ${key} is not a valid IPv4 address`);
throw new ValidationError(`Value for ${this.key} is not a valid IPv4 address`);
}
return true;