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