octodns.processor.spf

exception octodns.processor.spf.SpfValueException[source]

Bases: ProcessorException

exception octodns.processor.spf.SpfDnsLookupException[source]

Bases: ProcessorException

class octodns.processor.spf.SpfDnsLookupProcessor(name)[source]

Bases: BaseProcessor

Validate that SPF values in TXT records are valid.

Example usage:

processors:
spf:

class: octodns.processor.spf.SpfDnsLookupProcessor

zones:
example.com.:
sources:
  • config

processors:
  • spf

targets:
  • route53

The validation can be skipped for specific records by setting the lenient flag, e.g.

_spf:
octodns:

lenient: true

ttl: 86400 type: TXT value: v=spf1 ptr ~all

log = <Logger SpfDnsLookupProcessor (INFO)>
__init__(name)[source]
_get_spf_from_txt_values(record: Record, values: List[str]) str | None[source]
Parameters:
  • record (Record)

  • values (List[str])

Return type:

str | None

_process_answer(answer: Answer) List[str][source]
Parameters:

answer (Answer)

Return type:

List[str]

_check_dns_lookups(record: Record, values: List[str], lookups: int = 0) int[source]
Parameters:
  • record (Record)

  • values (List[str])

  • lookups (int)

Return type:

int

process_source_zone(zone, *args, **kwargs)[source]

Called after all sources have completed populate. Provides an opportunity for the processor to modify the desired Zone that targets will receive.

  • Will see desired after any modifications done by Provider._process_desired_zone and processors configured to run before this one.

  • May modify desired directly.

  • Must return desired which will normally be the desired param.

  • Must not modify records directly, record.copy should be called, the results of which can be modified, and then Zone.add_record may be used with replace=True.

  • May call Zone.remove_record to remove records from desired.

  • Sources may be empty, as will be the case for aliased zones.