Fixes for SPF record parsing
This commit is contained in:
parent
36ca29853b
commit
1368a6400c
@ -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 = {
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user