Contents
https://datatracker.ietf.org/doc/html/rfc7208#section-7
When evaluating an SPF policy record, certain character sequences are intended to be replaced by parameters of the message or of the connection. These character sequences are referred to as "macros".
1. history
7.1. Formal Specification The ABNF description for a macro is as follows: Some special cases: o A literal "%" is expressed by "%%". o "%_" expands to a single " " space. o "%-" expands to a URL-encoded space, viz., "%20". 7.2. Macro Definitions The following macro letters are expanded in term arguments: s = <sender> l = local-part of <sender> o = domain of <sender> d = <domain> i = <ip> p = the validated domain name of <ip> (do not use) v = the string "in-addr" if <ip> is ipv4, or "ip6" if <ip> is ipv6 h = HELO/EHLO domain <domain>, <sender>, and <ip> are defined in Section 4.1. The following macro letters are allowed only in "exp" text: c = SMTP client IP (easily readable format) r = domain name of host performing the check t = current timestamp 7.3. Macro Processing Details
4.1. Arguments The check_host() function takes these arguments: <ip> - the IP address of the SMTP client that is emitting the mail, either IPv4 or IPv6. <domain> - the domain that provides the sought-after authorization information; initially, the domain portion of the "MAIL FROM" or "HELO" identity. <sender> - the "MAIL FROM" or "HELO" identity.