SPF(发送者策略框架)记录的语法结构基于RFC 7208标准规范,该标准于2014年4月发布 [1]。SPF记录必须以v=spf1开头,随后跟空格分隔的术语,系统从左到右依次评估这些术语,直到首次匹配为止 [1]。
SPF记录包含八种机制:all、include、a、mx、ptr、ip4、ip6和exists [1]。在部署时,每个域名必须恰好包含一个SPF记录,多个v=spf1记录会导致PermError错误 [1]。SPF记录必须发布为DNS TXT记录(类型16),不能使用专用SPF记录类型(类型99)[1]。此外,系统对DNS查询设置了10个术语的限制,对void查询设置了2个的限制 [1]。单个字符串受255字节限制,这一限制应用于单个字符串而非整个记录 [1]。
根据同行评审研究,在7,251,736个启用SPF的域名中,仅2.9%存在任何错误,真正的语法错误约占0.5% [1]。
SPF (Sender Policy Framework) records follow a standardized syntax defined by RFC 7208, published in April 2014.[1] Every SPF record must begin with v=spf1 followed by space-separated terms that are evaluated left to right until the first match occurs.[1] Each domain is permitted exactly one SPF record; multiple v=spf1 entries result in a PermError.[1]
The framework employs eight distinct mechanisms to define sender authentication rules: all, include, a, mx, ptr, ip4, ip6, and exists.[1] SPF records must be published as DNS TXT records (type 16) rather than the dedicated SPF record type (type 99).[1] A 255-byte limit applies to individual character strings within the record, not the entire record itself.[1] Additionally, DNS queries are restricted to a maximum of 10 terms, with void queries limited to 2 terms.[1]
Peer-reviewed research shows that among 7,251,736 SPF-enabled domains, only 2.9 percent contained any errors, with genuine syntax errors accounting for approximately 0.5 percent.[1]