email-dns-tools/spf-validator/index.html

72 lines
3.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>SPF Record Validator - Validate SPF DNS Records</title>
<link rel="stylesheet" href="/assets/styles/main.css">
<script type="module" src="/assets/scripts/ui/validator.js"></script>
</head>
<body>
<h1>SPF Record Validator</h1>
<label for="record">DNS Record</label><br>
<input id="record" type="text" placeholder="v=spf1 ..." autocapitalize="off" spellcheck="false">
<main>
<h2>Paste an SPF DNS record into the input field to check if it is valid.</h2>
<p id="error" class="validation-result">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path fill="currentColor" d="M320 576C461.4 576 576 461.4 576 320C576 178.6 461.4 64 320 64C178.6 64 64 178.6 64 320C64 461.4 178.6 576 320 576zM231 231C240.4 221.6 255.6 221.6 264.9 231L319.9 286L374.9 231C384.3 221.6 399.5 221.6 408.8 231C418.1 240.4 418.2 255.6 408.8 264.9L353.8 319.9L408.8 374.9C418.2 384.3 418.2 399.5 408.8 408.8C399.4 418.1 384.2 418.2 374.9 408.8L319.9 353.8L264.9 408.8C255.5 418.2 240.3 418.2 231 408.8C221.7 399.4 221.6 384.2 231 374.9L286 319.9L231 264.9C221.6 255.5 221.6 240.3 231 231z"/></svg>
<span id="error-message"></span>
</p>
<p id="success" class="validation-result">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640"><!--!Font Awesome Free v7.1.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path fill="currentColor" d="M320 576C178.6 576 64 461.4 64 320C64 178.6 178.6 64 320 64C461.4 64 576 178.6 576 320C576 461.4 461.4 576 320 576zM438 209.7C427.3 201.9 412.3 204.3 404.5 215L285.1 379.2L233 327.1C223.6 317.7 208.4 317.7 199.1 327.1C189.8 336.5 189.7 351.7 199.1 361L271.1 433C276.1 438 282.9 440.5 289.9 440C296.9 439.5 303.3 435.9 307.4 430.2L443.3 243.2C451.1 232.5 448.7 217.5 438 209.7z"/></svg>
<span>Validation Success</span>
</p>
<p id="result-placeholder" class="validation-result"></p>
<p>
SPF is an email standard for authorizing hosts to send emails from a specific domain. Most email
servers, such as Gmail or Outlook, require SPF for security reasons, since without it, it is easy to
spoof email addresses.
</p>
<p>
SPF is defined with a TXT record on the email domain. It must start with "v=spf1" (to differentiate it
from other TXT records), and after that contains a set of mechanisms and modifiers (together called
terms), separated by space.
</p>
<p>
Mechanisms are colon-separated key-value pairs, whose primary purpose is to define which IPs are allowed
to send emails from the domain. The most used mechanisms are:
</p>
<ul>
<li><b>include</b>: Includes the SPF definition from the specified domain</li>
<li><b>a</b>: Allows emails from the specified domain</li>
<li><b>mx</b>: Allows emails from the IP addresses specified in the MX records</li>
<li><b>ipv6</b> / <b>ipv6</b>: Allows emails from the specified IP address</li>
</ul>
<p>
By default, mechanisms allow the specified IPs to send emails. You can add a qualifier, such as <b>~</b>
or <b>-</b> to prohibit them instead.
</p>
<p>
Often, you would include some IP addresses (using e.g. the <b>include</b>, <b>a</b> and <b>mx</b>
mechanisms), and end with <b>-all</b> or <b>~all</b> to reject emails from everywhere else. If the
<b>all</b> mechanism is used, it must come after the other mechanisms.
</p>
<center>
<h3>More tools:</h3>
<a href="/dmarc-validator">DMARC Validator Tool</a>
</center>
</main>
</body>
</html>