Validate domain SPF records

This function validates a Sender Policy Framework (SPF) record for one or more domains.

SecurityBasicAuth
Request
query Parameters
domain
required
string <domain>

The domain for which to check the SPF records.

Examples:
domain=domain-1=example.com domain-2=example2.com domain-3=example3.com
domain=domain=example.com domain=example2.com domain=example3.com
domain=example.com
Responses
200

HTTP Request was successful.

Response Schema: application/json
object
object
get/validate_current_spfs
Request samples
whmapi1 --output=jsonpretty \
  validate_current_spfs \
  domain='example.com'
Response samples
application/json
{
  • "data": {
    • "payload": [
      • {
        • "domain": "example.com",
        • "expected": "ip6:0:0:0:0:0:ffff:c0a8:101",
        • "ip_address": "0:0:0:0:0:ffff:c0a8:101",
        • "ip_version": 6,
        • "records": [
          • {
            • "current": "v=spf1 ~all",
            • "reason": "example.com: Sender is not authorized by default to use 'example.com' in 'helo' identity (mechanism '-all' matched)",
            • "state": "FAIL"
            }
          ],
        • "state": "VALID"
        },
      • {
        • "domain": "example2.com",
        • "error": "(XID rm8h9f) DNS returned “SERVFAIL” (code 2) in response to the system’s query for “example2.com”’s “TXT” records.",
        • "ip_address": "198.252.32.45",
        • "ip_version": 4,
        • "records": [ ],
        • "state": "ERROR"
        }
      ]
    },
  • "metadata": {
    • "command": "validate_current_spfs",
    • "reason": "OK",
    • "result": 1,
    • "version": 1
    }
}