]> git.ipfire.org Git - thirdparty/rspamd.git/log
thirdparty/rspamd.git
2 days ago[Fix] Handle connection errors with io_uring backend in HTTP client master
Vsevolod Stakhov [Fri, 12 Dec 2025 20:24:26 +0000 (20:24 +0000)] 
[Fix] Handle connection errors with io_uring backend in HTTP client

When using io_uring, POLLERR is reported as both EV_READ and EV_WRITE.
This caused connection failures (e.g., ECONNREFUSED) to be misinterpreted
as early server responses. Check SO_ERROR before attempting to read when
the connection hasn't been established yet.

3 days agoMerge pull request #5793 from fatalbanana/lua54
Vsevolod Stakhov [Thu, 11 Dec 2025 12:46:59 +0000 (12:46 +0000)] 
Merge pull request #5793 from fatalbanana/lua54

Use PUC-Rio Lua in packages

3 days ago[Minor] Unbreak build on focal 5793/head
Andrew Lewis [Thu, 11 Dec 2025 12:21:14 +0000 (14:21 +0200)] 
[Minor] Unbreak build on focal

3 days agoMerge pull request #5791 from moisseev/webui
Vsevolod Stakhov [Thu, 11 Dec 2025 11:45:37 +0000 (11:45 +0000)] 
Merge pull request #5791 from moisseev/webui

[Fix] Correct symbols column index in history and scan tables

3 days ago[Minor] Update version
Vsevolod Stakhov [Thu, 11 Dec 2025 11:44:26 +0000 (11:44 +0000)] 
[Minor] Update version

3 days ago[Fix] Correct symbols column index in history and scan tables 5791/head
Alexander Moisseev [Thu, 11 Dec 2025 08:49:38 +0000 (11:49 +0300)] 
[Fix] Correct symbols column index in history and scan tables

Fixes regression introduced in 62b136a where sorting fails with
"can't access property 'sortValue', val.options is undefined" on
the History tab, and symbol reordering doesn't work on the Scan tab.

The "file" column addition shifted the symbols column index, but
history.js and upload.js were not updated, causing symbol reordering
to target wrong columns.

Issue: #5789

4 days agoRelease 3.14.2 3.14.2
Vsevolod Stakhov [Wed, 10 Dec 2025 18:23:29 +0000 (18:23 +0000)] 
Release 3.14.2

Features:
- DMARC: Add --recheck-rua option for RUA filtering at send time
- Metadata exporter: Add multipart and msgpack formatters
- Milter headers: Add remove_ar_from option for selective A-R removal

Fixes:
- Security: Backport security fixes from libucl 0.9.3
- HTTP: Handle early server responses during request write
- MIME: Prevent splitting UTF-8 sequences in header encoding
- URL: Normalize URLs with multiple slashes between host and path
- Aliases: Enable plugin by default to restore plus-addressing
- Multiple Lua 5.4 compatibility fixes
- Build: FreeBSD 15 inotify compatibility
- Build: Remove deprecated OpenSSL engine.h include
- Various plugin fixes (DCC, Neural, Reputation, Milter headers)

4 days agoMerge pull request #5787 from rspamd/vstakhov-meta-exporter-http-rework
Vsevolod Stakhov [Wed, 10 Dec 2025 10:40:23 +0000 (10:40 +0000)] 
Merge pull request #5787 from rspamd/vstakhov-meta-exporter-http-rework

[Feature] Add multipart and msgpack formatters to metadata_exporter

5 days ago[Feature] Add multipart and msgpack formatters to metadata_exporter 5787/head
Vsevolod Stakhov [Tue, 9 Dec 2025 13:36:54 +0000 (13:36 +0000)] 
[Feature] Add multipart and msgpack formatters to metadata_exporter

- Add multipart formatter for HTTP export using form-data with separate
  metadata (JSON) and message (rfc822) parts
- Add msgpack formatter for efficient binary serialization
- Add json_with_message formatter for JSON with base64-encoded message
- Deprecate meta_headers option (broken by design for complex data)
- HTTP pusher now auto-detects multipart boundary from formatter

5 days ago[Fix] Backport security fixes from libucl 0.9.3
Vsevolod Stakhov [Tue, 9 Dec 2025 20:03:55 +0000 (20:03 +0000)] 
[Fix] Backport security fixes from libucl 0.9.3

Backported critical fixes from upstream libucl:
- Fix heap-buffer-overflow in ucl_parse_multiline_string
- Fix heap-buffer-overflow in ucl_maybe_parse_number
- Fix Use-After-Free in ucl_parser_process_object_element
- Fix C-style comment parser bugs
- Fix invalid JSON emission when merging objects
- Add API misuse detection in ucl_object_emit_streamline_start_container

5 days ago[Fix] Prevent splitting UTF-8 sequences in MIME header encoding
Vsevolod Stakhov [Tue, 9 Dec 2025 12:28:16 +0000 (12:28 +0000)] 
[Fix] Prevent splitting UTF-8 sequences in MIME header encoding

5 days agoMerge pull request #5785 from rspamd/vstakhov-http-race-fix
Vsevolod Stakhov [Tue, 9 Dec 2025 10:18:21 +0000 (10:18 +0000)] 
Merge pull request #5785 from rspamd/vstakhov-http-race-fix

[Fix] Handle HTTP early server responses during request write

6 days ago[Fix] Only apply early response handling for HTTP clients 5785/head
Vsevolod Stakhov [Mon, 8 Dec 2025 22:04:03 +0000 (22:04 +0000)] 
[Fix] Only apply early response handling for HTTP clients

The early response detection logic should not run for server-side
connections, as it incorrectly modifies wr_pos state when the server
reads incoming requests. This was breaking spamc protocol handling.

6 days ago[Fix] Handle HTTP early server responses during request write
Vsevolod Stakhov [Mon, 8 Dec 2025 17:21:03 +0000 (17:21 +0000)] 
[Fix] Handle HTTP early server responses during request write

Fix HTTP client to properly handle early server responses (e.g., 413
Too Large) that arrive before the client has finished sending the
request body. This is allowed by HTTP/1.1 (RFC 7230 Section 6.5).

- Use bitwise AND for event flag checks to handle combined EV_READ|EV_WRITE
- Watch for both READ and WRITE events during write phase
- Check for early response on write errors (EPIPE, ECONNRESET)
- Add RSPAMD_HTTP_CONN_FLAG_EARLY_RESPONSE flag to track state

6 days agoMerge pull request #5784 from rspamd/vstakhov-ar-removal-improvements
Vsevolod Stakhov [Mon, 8 Dec 2025 11:20:22 +0000 (11:20 +0000)] 
Merge pull request #5784 from rspamd/vstakhov-ar-removal-improvements

Add remove_ar_from option for selective AR header removal

6 days ago[Fix] Fix hierarchical domain matching in remove_ar_from map lookups 5784/head
Vsevolod Stakhov [Mon, 8 Dec 2025 10:22:12 +0000 (10:22 +0000)] 
[Fix] Fix hierarchical domain matching in remove_ar_from map lookups

6 days ago[Feature] Add remove_ar_from option for selective Authentication-Results header removal
Vsevolod Stakhov [Mon, 8 Dec 2025 09:10:46 +0000 (09:10 +0000)] 
[Feature] Add remove_ar_from option for selective Authentication-Results header removal

6 days agoMerge pull request #5783 from moisseev/patch-contrib
Vsevolod Stakhov [Mon, 8 Dec 2025 08:51:23 +0000 (08:51 +0000)] 
Merge pull request #5783 from moisseev/patch-contrib

[Fix] FreeBSD 15 inotify build compatibility

6 days ago[Fix] FreeBSD 15 inotify build compatibility 5783/head
Alexander Moisseev [Mon, 8 Dec 2025 08:02:08 +0000 (11:02 +0300)] 
[Fix] FreeBSD 15 inotify build compatibility

FreeBSD 15.0 introduced native inotify support, which causes
libev to enable EV_USE_INOTIFY. On FreeBSD, struct statfs is
defined in <sys/mount.h> rather than <sys/statfs.h>.

Note: This fix obsoletes the corresponding patch file in the
FreeBSD `mail/rspamd` and `mail/rspamd-devel` ports.

7 days ago[Fix] Handle nil opts in DCC plugin initialization
Vsevolod Stakhov [Sun, 7 Dec 2025 16:00:20 +0000 (16:00 +0000)] 
[Fix] Handle nil opts in DCC plugin initialization

Fixes #5751: The plugin crashed when configured with only 'enabled = false'
because get_all_opt returns nil for empty/disabled config sections.

7 days ago[Fix] Allow default_headers_order to be configured in milter_headers
Vsevolod Stakhov [Sun, 7 Dec 2025 15:05:13 +0000 (15:05 +0000)] 
[Fix] Allow default_headers_order to be configured in milter_headers

Fixes #5781: The default_headers_order setting was defined in the plugin
but never read from the configuration file. Add schema validation and
config loading for this option.

7 days ago[Fix] Fix other places of 5.4 rounding issues
Vsevolod Stakhov [Sun, 7 Dec 2025 15:00:05 +0000 (15:00 +0000)] 
[Fix] Fix other places of 5.4 rounding issues

8 days ago[Fix] Fix Lua 5.4 compatibility issues in neural plugin
Vsevolod Stakhov [Sat, 6 Dec 2025 18:30:09 +0000 (18:30 +0000)] 
[Fix] Fix Lua 5.4 compatibility issues in neural plugin

This commit addresses several Lua 5.4 compatibility issues that caused
the neural LLM tests to fail:

1. Redis TTL must be integer (lua_cache.lua):
   - Lua 5.4's tostring() produces "4.0" for floats instead of "4"
   - Redis SETEX/EXPIRE commands require integer TTL values
   - Fixed by using math.floor() before tostring()

2. Version number format in ANN keys (lualib/plugins/neural.lua):
   - Changed string format from %s to %d for version numbers
   - Ensures integer format "1" instead of potential "1.0"

3. Iterator vs table handling (src/plugins/lua/neural.lua):
   - fun.map() returns an iterator, not a table
   - In Lua 5.4, # operator on iterators returns 0
   - Fixed by wrapping with fun.totable() to get a proper table

4. Nil values in table arguments (lualib/plugins/neural.lua):
   - Lua 5.4 handles nil values in tables differently
   - Tables like {a, b, nil, nil} have undefined length behavior
   - Fixed by using empty string defaults for optional parameters

5. Redis script nil checks (neural_save_unlock.lua):
   - Added empty string checks alongside nil checks
   - Ensures optional fields are only set when truly provided

6. Test infrastructure improvements:
   - Added logging to dummy_llm.py for debugging
   - Added proper error handling and diagnostics
   - Updated rspamd.robot with better dummy_llm startup logging

8 days ago[Test] Fix TCP tests for HTTP/1.1 compliance
Vsevolod Stakhov [Sat, 6 Dec 2025 14:44:34 +0000 (14:44 +0000)] 
[Test] Fix TCP tests for HTTP/1.1 compliance

- Add required Host header to all HTTP/1.1 requests in tcp.lua
- Bind dummy servers to 127.0.0.1 instead of localhost to avoid
  IPv6/IPv4 mismatch on systems where localhost resolves to ::1

8 days ago[Fix] Handle Lua 5.4 require returning two values
Vsevolod Stakhov [Sat, 6 Dec 2025 14:18:20 +0000 (14:18 +0000)] 
[Fix] Handle Lua 5.4 require returning two values

Lua 5.4's require() returns both the module and the file path, while
LuaJIT returns only the module. Save stack top before luaL_dostring
and restore to top+1 after to keep only the first return value.

8 days ago[Fix] Use ipairs for ordered iteration in header checks
Vsevolod Stakhov [Sat, 6 Dec 2025 14:00:31 +0000 (14:00 +0000)] 
[Fix] Use ipairs for ordered iteration in header checks

pairs() does not guarantee iteration order for numeric keys. In Lua 5.4
this caused RCVD_COUNT, HAS_X_PRIO, and RCPT_COUNT symbols to select
wrong thresholds when the table was iterated in non-ascending order.

8 days ago[Fix] Use math.floor for Lua 5.4 integer division compatibility
Vsevolod Stakhov [Sat, 6 Dec 2025 13:42:00 +0000 (13:42 +0000)] 
[Fix] Use math.floor for Lua 5.4 integer division compatibility

In Lua 5.4, the / operator always returns a float (2/2 = 1.0), while
LuaJIT returns an integer (2/2 = 1). This caused test dependency
registration to fail as tostring(i/2) produced "1.0" instead of "1".

8 days ago[Fix] Improve loadstring error handling for Lua 5.4 compatibility
Vsevolod Stakhov [Sat, 6 Dec 2025 11:09:03 +0000 (11:09 +0000)] 
[Fix] Improve loadstring error handling for Lua 5.4 compatibility

Ensure loadstring results are checked for nil (syntax errors) before
passing to pcall. This prevents errors when running with Lua 5.4
compatibility where load behavior differs slightly or when handling
invalid Lua chunks.

8 days ago[Fix] Use userdata __gc for UCL objects in all Lua versions
Vsevolod Stakhov [Sat, 6 Dec 2025 10:03:01 +0000 (10:03 +0000)] 
[Fix] Use userdata __gc for UCL objects in all Lua versions

Use userdata __gc instead of table __gc for UCL object garbage
collection in all Lua versions. Table __gc in Lua 5.2+ can cause
use-after-free crashes due to GC ordering issues when UCL objects
reference each other or config objects.

8 days ago[Fix] Use locale-independent patterns in URL encoding
Vsevolod Stakhov [Sat, 6 Dec 2025 09:51:14 +0000 (09:51 +0000)] 
[Fix] Use locale-independent patterns in URL encoding

Replace %w with explicit A-Za-z0-9 ranges in URL encoding functions.
The %w pattern is locale-dependent and incorrectly matches high bytes
(0xE4, 0xE5, 0xE6) as word characters in UTF-8 locales like en_GB.UTF-8,
breaking URL encoding of non-ASCII characters.

8 days ago[Test] Add diagnostic logging to dummy_http.py
Vsevolod Stakhov [Sat, 6 Dec 2025 09:37:32 +0000 (09:37 +0000)] 
[Test] Add diagnostic logging to dummy_http.py

- Add startup progress messages to stderr
- Capture exceptions with full traceback
- Write PID only after successful server start
- Log output on failure in robot tests

8 days ago[Test] Fix Python 3.12+ compatibility in dummy_http.py
Vsevolod Stakhov [Sat, 6 Dec 2025 09:02:13 +0000 (09:02 +0000)] 
[Test] Fix Python 3.12+ compatibility in dummy_http.py

Replace deprecated asyncio.get_event_loop() with asyncio.run() to fix functional test failures on Fedora with newer Python.

8 days ago[Test] Fix selector tests to work with both LuaJIT and Lua 5.4
Vsevolod Stakhov [Sat, 6 Dec 2025 08:49:57 +0000 (08:49 +0000)] 
[Test] Fix selector tests to work with both LuaJIT and Lua 5.4

Use tostring() for expected values so they match the runtime's
float-to-string conversion (LuaJIT: "1", Lua 5.4: "1.0")

8 days ago[Test] Fix additional Lua 5.4 compatibility issues in fuzz tests
Vsevolod Stakhov [Sat, 6 Dec 2025 08:47:32 +0000 (08:47 +0000)] 
[Test] Fix additional Lua 5.4 compatibility issues in fuzz tests

- base32.lua: Add cdata_to_number helper for size_t conversion
- rfc2047.lua: Use math.floor for string.sub indices (Lua 5.4 requires integers)

9 days ago[Test] Fix Lua 5.4 and cffi-lua compatibility issues
Vsevolod Stakhov [Fri, 5 Dec 2025 20:43:20 +0000 (20:43 +0000)] 
[Test] Fix Lua 5.4 and cffi-lua compatibility issues

- Fix rspamd_memspn to handle empty character set without crash
- Add unpack compatibility shim for Lua 5.2+ (table.unpack)
- Replace deprecated table.maxn with # operator
- Fix cffi-lua strict type checking (char* vs unsigned char*)
- Add helpers for cdata-to-number conversion (64-bit integers)
- Add proper NULL pointer detection for cffi-lua
- Fix lua_resume to use coroutine threads in Lua 5.4
- Update test expectations for Lua 5.4 tostring(float) behavior

9 days ago[Test] Fix cffi-lua compatibility issues
Vsevolod Stakhov [Fri, 5 Dec 2025 17:27:55 +0000 (17:27 +0000)] 
[Test] Fix cffi-lua compatibility issues

- base32: Use tostring() for size_t values in format strings
- expressions: Use %s instead of %d for float values (Lua 5.4 strict)
- fpconv: Skip variadic function tests on cffi-lua (not supported)

9 days ago[Test] Fix FFI string-to-pointer conversions for cffi-lua
Vsevolod Stakhov [Fri, 5 Dec 2025 17:22:22 +0000 (17:22 +0000)] 
[Test] Fix FFI string-to-pointer conversions for cffi-lua

cffi-lua is stricter than LuaJIT FFI and requires explicit conversion
of Lua strings to C pointers. Use ffi.new/ffi.copy for the conversion.

9 days ago[CI] Fix cffi-lua install prefix to /usr/lib64
Vsevolod Stakhov [Fri, 5 Dec 2025 17:13:22 +0000 (17:13 +0000)] 
[CI] Fix cffi-lua install prefix to /usr/lib64

9 days ago[CI] Build cffi-lua from source to avoid clock skew
Vsevolod Stakhov [Fri, 5 Dec 2025 17:09:05 +0000 (17:09 +0000)] 
[CI] Build cffi-lua from source to avoid clock skew

Luarocks install fails due to clock skew in CI containers.
Build from source with touch to fix file timestamps.

9 days ago[CI] Add meson to cffi-lua build dependencies
Vsevolod Stakhov [Fri, 5 Dec 2025 17:03:31 +0000 (17:03 +0000)] 
[CI] Add meson to cffi-lua build dependencies

9 days ago[CI] Install luarocks and dependencies for cffi-lua
Vsevolod Stakhov [Fri, 5 Dec 2025 16:58:33 +0000 (16:58 +0000)] 
[CI] Install luarocks and dependencies for cffi-lua

The Fedora CI image doesn't have luarocks pre-installed, so we need
to install it along with lua-devel and libffi-devel before we can
install cffi-lua via luarocks.

9 days ago[Test] Use size ranges for gzip tests to support zlib-ng
Vsevolod Stakhov [Fri, 5 Dec 2025 16:31:16 +0000 (16:31 +0000)] 
[Test] Use size ranges for gzip tests to support zlib-ng

Fedora 40+ uses zlib-ng which produces slightly different compressed
sizes than standard zlib. Instead of checking exact sizes, use
reasonable ranges that accommodate both implementations.

9 days ago[Test] Support cffi-lua as FFI fallback for Lua 5.4
Vsevolod Stakhov [Fri, 5 Dec 2025 16:18:20 +0000 (16:18 +0000)] 
[Test] Support cffi-lua as FFI fallback for Lua 5.4

Unit tests now try LuaJIT's ffi first, falling back to cffi-lua for
standard Lua 5.4. CI installs cffi-lua via luarocks for Fedora builds.

9 days ago[Fix] Remove deprecated OpenSSL engine.h include
Vsevolod Stakhov [Fri, 5 Dec 2025 14:32:37 +0000 (14:32 +0000)] 
[Fix] Remove deprecated OpenSSL engine.h include

OpenSSL ENGINE API was deprecated in 3.0 and the header is removed
in newer versions. In dkim.c it was unused; in ssl_util.c we now
conditionally include it only for OpenSSL versions that need it.

9 days ago[CI] Use Lua 5.4 for Fedora, LuaJIT for Ubuntu
Vsevolod Stakhov [Fri, 5 Dec 2025 11:31:40 +0000 (11:31 +0000)] 
[CI] Use Lua 5.4 for Fedora, LuaJIT for Ubuntu

This ensures we test both Lua implementations in CI:
- Fedora: Lua 5.4 (ENABLE_LUAJIT=OFF)
- Ubuntu: LuaJIT (ENABLE_LUAJIT=ON, default)

9 days ago[Fix] Fix reputation whitelist schema and selector-aware checking
Vsevolod Stakhov [Fri, 5 Dec 2025 11:13:47 +0000 (11:13 +0000)] 
[Fix] Fix reputation whitelist schema and selector-aware checking

- lua_maps_expressions.schema: Change rules from array to key-value
  table to match actual UCL config format (fixes #5780)
- reputation.lua: Make simple whitelist maps selector-aware instead
  of always assuming IP-based whitelists

Closes #5780

10 days ago[Minor] Use PUC-Rio Lua instead of LuaJIT
Andrew Lewis [Thu, 4 Dec 2025 17:10:47 +0000 (19:10 +0200)] 
[Minor] Use PUC-Rio Lua instead of LuaJIT

10 days agoMerge pull request #5778 from zdAlexM/master
Vsevolod Stakhov [Thu, 4 Dec 2025 16:55:11 +0000 (16:55 +0000)] 
Merge pull request #5778 from zdAlexM/master

[Fix] null-terminate the log tag when copying the header

10 days agoavoid off-by-one when at the maximum tag length 5778/head
Alex Maestas [Thu, 4 Dec 2025 16:25:31 +0000 (08:25 -0800)] 
avoid off-by-one when at the maximum tag length

10 days ago[Fix] Avoid repeated simdutf implementation detection on each call
Vsevolod Stakhov [Thu, 4 Dec 2025 15:41:56 +0000 (15:41 +0000)] 
[Fix] Avoid repeated simdutf implementation detection on each call

The previous code stored a pointer to simdutf's proxy singleton instead
of the actual implementation, causing detect_best_supported() to be
called on every UTF-8 validation operation.

10 days ago[Minor] Remove bogus `false` from log messages
Vsevolod Stakhov [Thu, 4 Dec 2025 14:55:30 +0000 (14:55 +0000)] 
[Minor] Remove bogus `false` from log messages

10 days agoMerge pull request #5779 from fatalbanana/debian_noasan
Vsevolod Stakhov [Thu, 4 Dec 2025 11:57:42 +0000 (11:57 +0000)] 
Merge pull request #5779 from fatalbanana/debian_noasan

[Minor] debian: allow skipping ASAN build

10 days ago[Minor] debian: allow skipping ASAN build 5779/head
Andrew Lewis [Thu, 4 Dec 2025 11:26:54 +0000 (13:26 +0200)] 
[Minor] debian: allow skipping ASAN build

10 days ago[Fix] null-terminate the log tag when copying the header
Alex Maestas [Wed, 3 Dec 2025 23:45:56 +0000 (15:45 -0800)] 
[Fix] null-terminate the log tag when copying the header

This avoids leaking uninitialized heap memory.

11 days ago[Fix] Normalize URLs with multiple slashes between host and path
Vsevolod Stakhov [Wed, 3 Dec 2025 21:45:19 +0000 (21:45 +0000)] 
[Fix] Normalize URLs with multiple slashes between host and path

Fixes #5773: URLs like https://example.com//path were not being
normalized. The extra slashes between host and path are now collapsed
to a single slash during URL parsing.

11 days agoMerge pull request #5776 from rspamd/vstakhov-dmarc-rua-recheck
Vsevolod Stakhov [Wed, 3 Dec 2025 16:43:16 +0000 (16:43 +0000)] 
Merge pull request #5776 from rspamd/vstakhov-dmarc-rua-recheck

[Feature] Add --recheck-rua option to dmarc_report

11 days ago[Fix] Use double type for rspamd_scan_time_average Prometheus metric
Vsevolod Stakhov [Wed, 3 Dec 2025 13:33:14 +0000 (13:33 +0000)] 
[Fix] Use double type for rspamd_scan_time_average Prometheus metric

The metric was always 0 because rspamd_metrics_add_integer() truncated
the avg_scan_time double value (typically fractions of a second) to
integer. Added rspamd_metrics_add_double() helper and use it for
avg_scan_time.

11 days ago[Feature] Add --recheck-rua option to dmarc_report for RUA filtering at send time 5776/head
Vsevolod Stakhov [Wed, 3 Dec 2025 13:16:01 +0000 (13:16 +0000)] 
[Feature] Add --recheck-rua option to dmarc_report for RUA filtering at send time

- Add -r/--recheck-rua flag to rspamadm dmarc_report to re-check RUA
  addresses against exclude_rua_addresses map before sending reports
- Extend lua_maps to support rspamadm context for external map queries,
  enabling coroutine-based synchronous HTTP requests
- Works with both local maps and external (HTTP) maps
- Checks both full email address and domain-only against the map

Addresses #5750
Related to #5735

11 days agoMerge pull request #5772 from rspamd/sync-public-suffix-list
Vsevolod Stakhov [Wed, 3 Dec 2025 08:59:56 +0000 (08:59 +0000)] 
Merge pull request #5772 from rspamd/sync-public-suffix-list

[Minor] Update public suffix list

11 days agoMerge pull request #5774 from arkamar/lua5.1-compat
Vsevolod Stakhov [Wed, 3 Dec 2025 08:59:46 +0000 (08:59 +0000)] 
Merge pull request #5774 from arkamar/lua5.1-compat

[Fix] Use 0 instead of LUA_OK for lua_pcall result comparison

12 days ago[Fix] Use 0 instead of LUA_OK for lua_pcall result comparison 5774/head
Petr Vaněk [Tue, 2 Dec 2025 21:06:16 +0000 (22:06 +0100)] 
[Fix] Use 0 instead of LUA_OK for lua_pcall result comparison

Lua 5.1 does not define LUA_OK, so the result of lua_pcall is compared
to 0 instead, which is consistent with the rest of the codebase.

Link: https://bugs.gentoo.org/967009
12 days ago[Fix] Enable aliases plugin by default to restore plus-addressing
Vsevolod Stakhov [Tue, 2 Dec 2025 14:52:18 +0000 (14:52 +0000)] 
[Fix] Enable aliases plugin by default to restore plus-addressing

Fixes #5768: Settings lookup was broken for subaddressed recipients
(e.g., user+folder@example.com) because the aliases plugin was
disabled by default after it was moved from rules/misc.lua in 3.14.

This restores the pre-3.14 behavior where plus-tags are stripped
and virtual recipients are created for settings matching.

12 days ago[Minor] Some more instructions for Claude Code
Vsevolod Stakhov [Tue, 2 Dec 2025 13:24:53 +0000 (13:24 +0000)] 
[Minor] Some more instructions for Claude Code

13 days ago[Minor] Update version to 3.14.2
Vsevolod Stakhov [Mon, 1 Dec 2025 15:22:51 +0000 (15:22 +0000)] 
[Minor] Update version to 3.14.2

13 days agoMerge pull request #5771 from fatalbanana/el10_use_toolset
Vsevolod Stakhov [Mon, 1 Dec 2025 12:43:54 +0000 (12:43 +0000)] 
Merge pull request #5771 from fatalbanana/el10_use_toolset

[Minor] Use gcc toolset at EL10

13 days agoRelease 3.14.1 3.14.1
Vsevolod Stakhov [Mon, 1 Dec 2025 11:16:55 +0000 (11:16 +0000)] 
Release 3.14.1

* [Feature] Composites: Add inverted index for fast composite rule evaluation
* [Feature] Composites: Add bloom filter for fast negative symbol lookups
* [Feature] Composites: Add statistics tracking and control protocol command
* [Feature] Composites: Precompute atom types at config time
* [Feature] Multimap: Add combinator option for selector rules
* [Feature] SPF: Add rspamadm spf_flatten tool with macro preservation
* [Feature] URL: Add deep processing architecture with C-to-Lua filter consultation
* [Feature] URL: Add obfuscated URL detection to url_suspect plugin
* [Feature] URL: Add rspamd_util.decode_html_entities for HTML entity decoding
* [Feature] lua_shape: Add new validation library as tableshape replacement
* [Feature] lua_shape: Add T.callable() type for function validation
* [Feature] lua_shape: Add callable defaults support
* [Feature] Whitelist: Auto-mark symbols with SYMBOL_TYPE_FINE flag
* [Fix] url_suspect: Fix plugin causing massive false positives
* [Fix] url_suspect: Optimize for high URL volume messages
* [Fix] Network: Prevent infinite loop in split_networks_into_chunks()
* [Fix] Memory: Fix leak in custom tokenizer result handling
* [Fix] Composites: Fix group matchers handling in inverted index
* [Fix] Composites: Improve atom polarity detection in inverted index
* [Fix] Composites: Copy expression string to memory pool for Lua composites
* [Fix] lua_shape: Fix transform logic and tableshape compatibility
* [Fix] lua_shape: Fix registry to recursively resolve nested schemas
* [Fix] lua_shape: Improve error safety
* [Fix] Settings: Keep groups_*/symbols_* fields for runtime processing
* [Fix] URL: Encode redirect URLs to handle unencoded spaces and special characters
* [Fix] external_relay: Fix mixins and confighelp
* [Fix] RBL: Fix plugin transform schemas
* [WebUI] Update D3 libs with bug fixes and validation
* [WebUI] Restore hover colors for symbols
* [WebUI] Fix hover behavior outside status tables
* [Minor] Whitelist: Use contemporary API for maps
* [Minor] Migrate all plugins and libraries from tableshape to lua_shape
* [Minor] Simplify configuration by removing use_*_map flags
* [Minor] Add plugins registry with reworked mixins
* [Test] Add comprehensive tests for URL deep processing
* [Test] Isolate url_suspect tests with symbols_enabled

13 days agoMerge pull request #5770 from moisseev/patch-1
Andrew Lewis [Mon, 1 Dec 2025 10:20:12 +0000 (12:20 +0200)] 
Merge pull request #5770 from moisseev/patch-1

[Test] Restrict public suffix sync workflow to upstream repository

13 days ago[Minor] Use gcc toolset at EL10 5771/head
Andrew Lewis [Mon, 1 Dec 2025 10:10:14 +0000 (12:10 +0200)] 
[Minor] Use gcc toolset at EL10

13 days agoMerge pull request #5769 from rspamd/vstakhov-symcache-ordering
Vsevolod Stakhov [Mon, 1 Dec 2025 09:11:34 +0000 (09:11 +0000)] 
Merge pull request #5769 from rspamd/vstakhov-symcache-ordering

[Feature] Auto-mark whitelist symbols with SYMBOL_TYPE_FINE flag

13 days ago[Test] Restrict public suffix sync workflow to upstream repository 5770/head
Alexander Moisseev [Mon, 1 Dec 2025 05:34:53 +0000 (08:34 +0300)] 
[Test] Restrict public suffix sync workflow to upstream repository

Restrict the scheduled/public-dispatch sync job so it runs only in the upstream repository (rspamd/rspamd) and not in forks. This prevents automated PRs from being opened in forks.

13 days ago[Minor] Update public suffix list 5772/head
github-actions[bot] [Mon, 1 Dec 2025 00:33:37 +0000 (00:33 +0000)] 
[Minor] Update public suffix list

2 weeks ago[Feature] Auto-mark whitelist symbols with SYMBOL_TYPE_FINE flag 5769/head
Vsevolod Stakhov [Sat, 29 Nov 2025 14:24:36 +0000 (14:24 +0000)] 
[Feature] Auto-mark whitelist symbols with SYMBOL_TYPE_FINE flag

This change ensures that symbols with negative weight and symbols used
in whitelist composites (composites with negative score) will always
execute regardless of whether the reject threshold has been reached.

Previously, when the early-stop optimization kicked in after reaching
the reject score, whitelist symbols could be skipped, leading to
potential false positives where emails should have been whitelisted.

Changes:
- Symbols with negative weight are automatically marked as FINE during
  config validation in symcache::validate()
- New rspamd_composites_mark_whitelist_deps() function traverses all
  composites with negative score and marks their constituent symbols
  as FINE (with transitive expansion for nested composites)
- New C API rspamd_symcache_set_symbol_fine() to programmatically set
  the FINE flag with proper parent/child propagation
- FINE flag is properly synchronized between virtual symbols and their
  parent symbols

2 weeks agoMerge pull request #5767 from fatalbanana/el10_gcc
Vsevolod Stakhov [Fri, 28 Nov 2025 12:10:28 +0000 (12:10 +0000)] 
Merge pull request #5767 from fatalbanana/el10_gcc

Use GCC on EL10 again

2 weeks agoRevert "[Minor] Use clang for build on EL10" 5767/head
Andrew Lewis [Fri, 28 Nov 2025 09:46:16 +0000 (11:46 +0200)] 
Revert "[Minor] Use clang for build on EL10"

This reverts commit ac4c6ec4210b97886327f2c526957207ca9d8030.

2 weeks agoMerge pull request #5766 from rspamd/vstakhov-multimap-selectors-combinators
Vsevolod Stakhov [Fri, 28 Nov 2025 09:37:57 +0000 (09:37 +0000)] 
Merge pull request #5766 from rspamd/vstakhov-multimap-selectors-combinators

[Feature] Add combinator option for multimap selector rules

2 weeks ago[Feature] Add combinator option for multimap selector rules 5766/head
Vsevolod Stakhov [Thu, 27 Nov 2025 15:37:47 +0000 (15:37 +0000)] 
[Feature] Add combinator option for multimap selector rules

This change adds support for structured data output from selectors in
multimap rules. Previously, selectors always produced concatenated
strings which made it impossible to send structured JSON data to
external map services.

New 'combinator' option for selector-type multimap rules:
- 'string' (default): concatenate results with delimiter (existing behavior)
- 'array': flatten all results into a flat array
- 'object': convert pairs of selectors into key-value object

Example configuration for external JSON API:
  multimap {
    MY_EXTERNAL_CHECK {
      type = "selector";
      selector = "id('from');from('smtp'):addr;id('ip');ip";
      combinator = "object";  # produces {"from": "...", "ip": "..."}
      map = {
        external = true;
        backend = "http://api.example.com/check";
        method = "body";
        encode = "json";
      };
    }
  }

Changes:
- lua_selectors: Added combinator registry and helper functions
  - get_combinator(name): returns combinator function by name
  - list_combinators(): returns available combinator names
  - create_selector_closure_with_combinator(): creates closure with named combinator
- multimap: Added 'combinator' option support for selector and redis+selector maps

2 weeks agoMerge pull request #5764 from rspamd/vstakhov-composites-opt
Vsevolod Stakhov [Thu, 27 Nov 2025 13:26:35 +0000 (13:26 +0000)] 
Merge pull request #5764 from rspamd/vstakhov-composites-opt

[Project] Composites processing optimization

2 weeks agoMerge pull request #5765 from moisseev/webui
Vsevolod Stakhov [Thu, 27 Nov 2025 10:41:59 +0000 (10:41 +0000)] 
Merge pull request #5765 from moisseev/webui

[Fix] Update D3 libs: bug fixes & validation

2 weeks ago[Feature] Add control protocol command for composites statistics 5764/head
Vsevolod Stakhov [Thu, 27 Nov 2025 10:39:54 +0000 (10:39 +0000)] 
[Feature] Add control protocol command for composites statistics

- Add RSPAMD_CONTROL_COMPOSITES_STATS command to control protocol
- Add /compositesstats endpoint to control socket
- Add 'rspamadm control compositesstats' command
- Aggregate statistics from all workers with per-worker breakdown
- Remove composites stats from controller /stat (use control socket instead)
- Statistics always collected, timing sampled 1/256 (configurable)

2 weeks ago[Feature] Add composites statistics and config options
Vsevolod Stakhov [Wed, 26 Nov 2025 21:35:57 +0000 (21:35 +0000)] 
[Feature] Add composites statistics and config options

- Add config options: composites_inverted_index (default: true),
  composites_stats_always (default: false for 1/256 sampling)
- Add EMA-based timing statistics using rspamd_counter_data
- Export stats via /stat endpoint in "composites" section:
  checked_slow, checked_fast, matched counts and timing with mean/stddev
- Allow toggling inverted index for performance comparison

2 weeks ago[Fix] Update D3 libs: bug fixes & validation 5765/head
Alexander Moisseev [Wed, 26 Nov 2025 14:39:14 +0000 (17:39 +0300)] 
[Fix] Update D3 libs: bug fixes & validation

- D3Evolution 2.0.3 → 2.0.4:
  * Fix hover highlight regression after D3 v7 migration
  * Fix memory leaks in destroy() method
  * Optimize hover performance (replace DOM traversal)
  * Fix legend circle flickering on interaction
  * Fix potential negative index in cursor positioning

- rspamd-D3Pie 1.1.1 → 1.1.2:
  * Fix crash when rapidly updating with different datasets
  * Fix data array corruption during quick dataset changes
  * Add comprehensive options validation with constraints
  * Add ID format validation and duplicate label detection
  * Improve error handling and descriptive messages
  * Add donut mask support for inner radius > 0
  * Fix memory leaks with event handler cleanup
  * Improve transition interruption detection

2 weeks ago[Feature] Precompute composite atom types at config time
Vsevolod Stakhov [Wed, 26 Nov 2025 12:33:26 +0000 (12:33 +0000)] 
[Feature] Precompute composite atom types at config time

Resolve ATOM_COMPOSITE vs ATOM_PLAIN for all composite atoms during
configuration phase instead of lazy evaluation at runtime. This
eliminates repeated hash lookups during expression evaluation.

- Add rspamd_composites_resolve_atom_types() function
- Call after process_dependencies() and before build_inverted_index()
- Sets comp_type and ncomp pointer for each atom upfront

2 weeks ago[Fix] Copy expression string to memory pool for Lua composites
Vsevolod Stakhov [Wed, 26 Nov 2025 11:45:58 +0000 (11:45 +0000)] 
[Fix] Copy expression string to memory pool for Lua composites

When composites are added via Lua API (rspamd_config:add_composite),
the expression string was not copied to the memory pool. The expression
parser stores pointers (atom->str) into the original string, which
became invalid after Lua garbage collected the string.

This caused the inverted index to extract garbage symbol names,
breaking composite evaluation for dynamically added composites
like MISSING_MID_ALLOWED and INVALID_MSGID_ALLOWED from mid.lua.

2 weeks ago[Fix] Handle group matchers in composites inverted index
Vsevolod Stakhov [Wed, 26 Nov 2025 09:59:50 +0000 (09:59 +0000)] 
[Fix] Handle group matchers in composites inverted index

Composites that use group matchers (g:, g+:, g-:) cannot be
efficiently indexed because we don't know which symbols will
match until runtime. Add these composites to not_only_composites
list so they are always evaluated.

2 weeks ago[Fix] Improve atom polarity detection in composites inverted index
Vsevolod Stakhov [Wed, 26 Nov 2025 09:18:26 +0000 (09:18 +0000)] 
[Fix] Improve atom polarity detection in composites inverted index

Count NOT operations from atom to root instead of just checking direct
parent. This correctly handles nested negations like !(A & B) where
atoms A and B are both under negation even though their direct parent
is AND, not NOT.

- Even number of NOTs = positive atom (must be true)
- Odd number of NOTs = negative atom (must be false)

2 weeks ago[Feature] Add bloom filter for fast negative symbol lookups
Vsevolod Stakhov [Tue, 25 Nov 2025 17:50:48 +0000 (17:50 +0000)] 
[Feature] Add bloom filter for fast negative symbol lookups

Add an inline bloom filter (1024 bits) to rspamd_scan_result structure
for O(1) negative lookups in rspamd_task_find_symbol_result().

This optimization benefits composites evaluation where most symbol
lookups are negative (symbol not present in results). The bloom filter
is updated when symbols are inserted and checked before the hash lookup.

For 50 symbols, the false positive rate is approximately 0.5%, meaning
99.5% of negative lookups will be rejected without hash table access.

2 weeks ago[Feature] Add inverted index for composites optimization
Vsevolod Stakhov [Tue, 25 Nov 2025 17:13:19 +0000 (17:13 +0000)] 
[Feature] Add inverted index for composites optimization

Build an inverted index mapping symbol names to composites that contain
those symbols as positive (non-negated) atoms. This allows filtering out
composites that cannot possibly match during the first pass evaluation.

- Add rspamd_expression_atom_foreach_ex() to traverse expression atoms
  with access to AST nodes (needed to detect negated atoms)
- Add rspamd_expression_node_is_op() to check if a node is an operator
- Build inverted index in composites_manager during config processing
- Track composites with only negated atoms separately (they must always
  be evaluated)
- Use inverted index in composites_metric_callback for first pass to
  evaluate only potentially matching composites

For configurations with many composites (4000+), this reduces the number
of composites evaluated per message from all to only those that have at
least one matching symbol present.

2 weeks agoMerge pull request #5761 from rspamd/vstakhov-urls-heuristics
Vsevolod Stakhov [Mon, 24 Nov 2025 18:32:03 +0000 (18:32 +0000)] 
Merge pull request #5761 from rspamd/vstakhov-urls-heuristics

[Feature] Add obfuscated URL detection to url_suspect plugin

2 weeks agoMerge pull request #5763 from dragoangel/patch-16
Vsevolod Stakhov [Mon, 24 Nov 2025 18:31:44 +0000 (18:31 +0000)] 
Merge pull request #5763 from dragoangel/patch-16

Cover more possible use cases of task:set_milter_reply

2 weeks agoUpdate milter reply settings in lua_task.c 5763/head
Dmitriy Alekseev [Mon, 24 Nov 2025 17:31:50 +0000 (18:31 +0100)] 
Update milter reply settings in lua_task.c

3 weeks ago[Feature] Add rspamd_util.decode_html_entities and improve obfuscated URL detection 5761/head
Vsevolod Stakhov [Sun, 23 Nov 2025 11:38:18 +0000 (11:38 +0000)] 
[Feature] Add rspamd_util.decode_html_entities and improve obfuscated URL detection

- Add Lua binding for HTML entity decoding (rspamd_util.decode_html_entities)
  wrapping rspamd_html_decode_entitles_inplace C function
- Switch obfuscated URL detection from regexp module to rspamd_trie
  for Hyperscan-accelerated multi-pattern matching
- Fix URL flag passing (use url.create with flags table instead of add_flag)
- Fix inject_url usage (doesn't return value)
- Add functional tests for obfuscated URL detection

3 weeks ago[Fix] Replace lua_util.table_len with #re_parts
Vsevolod Stakhov [Sat, 22 Nov 2025 14:45:05 +0000 (14:45 +0000)] 
[Fix] Replace lua_util.table_len with #re_parts

3 weeks ago[Feature] Add obfuscated URL detection to url_suspect plugin
Vsevolod Stakhov [Sat, 22 Nov 2025 13:46:55 +0000 (13:46 +0000)] 
[Feature] Add obfuscated URL detection to url_suspect plugin

Detect URLs hidden in message text using various obfuscation techniques:
- Spaced protocols (h t t p s : / /)
- hxxp variants (hxxp://)
- Bracket dots (example[.]com)
- Word dots (example dot com)
- HTML entities (&#46; for dots)

Features:
- Hyperscan-based prefiltering for performance
- Normalization and URL extraction from obfuscated text
- URL injection with 'obscured' flag for further analysis
- Configurable via built-in settings or external maps
- DoS protection with strict limits

New symbol: URL_OBFUSCATED_TEXT (score: 5.0)

3 weeks agoMerge pull request #5760 from moisseev/webui
Vsevolod Stakhov [Sat, 22 Nov 2025 13:33:35 +0000 (13:33 +0000)] 
Merge pull request #5760 from moisseev/webui

[Test] Update dev dependencies

3 weeks ago[Test] Update dev dependencies 5760/head
Alexander Moisseev [Sat, 22 Nov 2025 06:14:34 +0000 (09:14 +0300)] 
[Test] Update dev dependencies

- @stylistic/eslint-plugin: 5.5.0 → 5.6.1
- stylelint: 16.25.0 → 16.26.0
- js-yaml: 4.1.0 → 4.1.1 (fixes #5759)

3 weeks agoMerge pull request #5758 from rspamd/vstakhov-suspect-url-fix
Vsevolod Stakhov [Fri, 21 Nov 2025 12:57:11 +0000 (12:57 +0000)] 
Merge pull request #5758 from rspamd/vstakhov-suspect-url-fix

[Fix] Fix url_suspect plugin causing massive false positives

3 weeks ago[Test] Isolate url_suspect tests with symbols_enabled 5758/head
Vsevolod Stakhov [Fri, 21 Nov 2025 11:58:11 +0000 (11:58 +0000)] 
[Test] Isolate url_suspect tests with symbols_enabled

Use symbols_enabled setting to test only specific url_suspect symbols,
preventing interference from other rules like greylist.

3 weeks ago[Performance] Optimize url_suspect for high URL volume messages
Vsevolod Stakhov [Fri, 21 Nov 2025 11:31:14 +0000 (11:31 +0000)] 
[Performance] Optimize url_suspect for high URL volume messages

Performance improvements for messages with many URLs:

1. O(1) TLD lookups: Convert builtin_suspicious list to hash set on init,
   eliminates O(n*m) iteration (500k+ checks for 100k URLs × 5 TLDs)

2. Use rspamd_text for URL checks: get_text(true) returns opaque rspamd_text
   without string copying, use text:find() for RTL detection

3. Use rspamd_ip API: parse_addr() + is_local() for IP checks instead of
   pattern matching

4. Add max_urls limit (10000) for DoS protection

These optimizations significantly reduce memory allocation and CPU usage.

3 weeks ago[Fix] Fix url_suspect plugin causing massive false positives
Vsevolod Stakhov [Fri, 21 Nov 2025 11:12:55 +0000 (11:12 +0000)] 
[Fix] Fix url_suspect plugin causing massive false positives

The url_suspect plugin had multiple critical issues:

1. R_SUSPICIOUS_URL triggered on every message with URLs, adding 25 points
   due to incorrect dynamic score usage (5.0 * 5.0 instead of 1.0 * 5.0)

2. Broken compat_mode inserted R_SUSPICIOUS_URL without URL info whenever
   ANY url check triggered, making it impossible to debug

3. Symbol names were unnecessarily configurable, adding complexity

4. url_suspect_group.conf was not included in groups.conf, so scores
   were not loaded at all

Fixed by:
- Removed R_SUSPICIOUS_URL and compat_mode completely
- Fixed all insert_result() calls to use 1.0 dynamic weight
- Made symbol names hardcoded constants
- Added url group to groups.conf with max_score = 9.0
- Cleaned up score configuration parameters

3 weeks agoMerge pull request #5754 from rspamd/vstakhov-rework-tableshape
Vsevolod Stakhov [Thu, 20 Nov 2025 13:09:01 +0000 (13:09 +0000)] 
Merge pull request #5754 from rspamd/vstakhov-rework-tableshape

[Feature] Add lua_shape validation library as tableshape replacement