SPF macro
A placeholder such as %{i} or %{d} in an SPF record that the receiver replaces with a value from the SMTP session before doing the lookup.
What it means
SPF macros let a record compute the names it queries. The common ones are %{s} (the sender address), %{l} (its local part), %{d} (the domain being checked), %{i} (the connecting IP address) and %{h} (the HELO name). Modifiers reverse or truncate the value, as in %{ir} for the IP address with its parts reversed.
They are used mainly with exists, to ask a DNS server built for the purpose whether one address or one sender may send, and with exp to personalize an explanation.
Macros let the sender put arbitrary text into the receiver's DNS queries, so RFC 7208 tells receivers to expect hostile content, and the queries can tell the domain's DNS server who is mailing whom.
Example
v=spf1 exists:%{ir}.%{l1r+-}._spf.%{d} -allRelated terms
Sources
What this definition rests on. The wording is ours; the facts are theirs.
- RFC 7208: Sender Policy Framework (SPF), section 7rfc-editor.org
- RFC 7208: Sender Policy Framework (SPF), section 11.5.3rfc-editor.org
All 432 terms in the glossaryThe wiki: blocklists and bounce codes