class SPFRecordValidator implements DnsRecordValidatorInterface (View source)

SPF record validator

Validates Sender Policy Framework (SPF) records according to:

  • RFC 7208: Sender Policy Framework (SPF) for Authorizing Use of Email (April 2014)
  • RFC 4408: Sender Policy Framework (SPF) (obsoleted by RFC 7208)

SPF records allow domain owners to specify which hosts are authorized to send email on behalf of their domain. The record format is defined in RFC 7208, starting with "v=spf1" followed by mechanisms and modifiers.

IMPORTANT: As per RFC 7208 Section 14.1, the SPF record type is deprecated. SPF records should be published as TXT records, not as SPF type records.

Methods

__construct(ConfigurationManager $config)

No description

validate(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL, mixed ...$args)

Validates SPF record content

Details

__construct(ConfigurationManager $config)

No description

Parameters

ConfigurationManager $config

ValidationResult validate(string $content, string $name, mixed $prio, int|string|null $ttl, int $defaultTTL, mixed ...$args)

Validates SPF record content

Parameters

string $content

The content part of the record

string $name

The name part of the record

mixed $prio

The priority value (if applicable)

int|string|null $ttl

The TTL value

int $defaultTTL

The default TTL to use if not specified

mixed ...$args

Additional validator-specific parameters

Return Value

ValidationResult

ValidationResult containing validated data or error messages