]> git.ipfire.org Git - thirdparty/rspamd.git/commit
[Feature] Add SPF flattening tool with macro preservation
authorVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 20 Nov 2025 11:43:40 +0000 (11:43 +0000)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Thu, 20 Nov 2025 11:52:39 +0000 (11:52 +0000)
commit030af71ef52ee916bafa160a50129a85bf7ce460
tree8964f8fd04ce11030ee0ea6bd3249aec7d9f3908
parent8ed7c2e3d188742dde896b447a2ed33dd42a9680
[Feature] Add SPF flattening tool with macro preservation

- Add new 'spf-flatten' command to dns_tool for optimizing SPF records
- Introduce RSPAMD_SPF_FLAG_MACRO_UNRESOLVED flag to preserve SPF macros
- Prevent macro expansion when sender IP is unavailable (flatten mode)
- SPF elements with macros (exists:, a:, mx:, ptr:) now preserved correctly
- Add multiple output formats: default, json, compact (BIND-style)
- Optimize IP addresses by removing default /32 and /128 masks
- Automatically split large SPF records into multiple includes
- Preserve qualifiers and 'all' mechanism in flattened records
lualib/rspamadm/dns_tool.lua
src/libserver/spf.c
src/libserver/spf.h