From 1368a6400c12aeabb91184f57bd1ee2d4dbc199e Mon Sep 17 00:00:00 2001 From: Reimar Date: Fri, 13 Feb 2026 17:43:20 +0100 Subject: [PATCH] Fixes for SPF record parsing --- assets/scripts/records/SpfRecord.js | 18 +++++++++--------- assets/scripts/spf/IPv4Mechanism.js | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/assets/scripts/records/SpfRecord.js b/assets/scripts/records/SpfRecord.js index 73aba4f..514a222 100644 --- a/assets/scripts/records/SpfRecord.js +++ b/assets/scripts/records/SpfRecord.js @@ -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 = { diff --git a/assets/scripts/spf/IPv4Mechanism.js b/assets/scripts/spf/IPv4Mechanism.js index 3c51d72..a9bd1bb 100644 --- a/assets/scripts/spf/IPv4Mechanism.js +++ b/assets/scripts/spf/IPv4Mechanism.js @@ -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;