]> git.ipfire.org Git - thirdparty/rspamd.git/log
thirdparty/rspamd.git
2 weeks ago[Fix] ratelimit: fix compatibility with old records 5842/head
Andrew Lewis [Thu, 15 Jan 2026 15:33:46 +0000 (17:33 +0200)] 
[Fix] ratelimit: fix compatibility with old records

2 weeks ago[Fix] Propagate control request ids in replies
Vsevolod Stakhov [Wed, 14 Jan 2026 22:48:06 +0000 (22:48 +0000)] 
[Fix] Propagate control request ids in replies

Ensure workers include cmd->id in control replies to avoid 'unknown request id 0' warnings. Update functional control tests and make RSPAMD_TMPDIR visible to child suites.

2 weeks ago[Feature] Route all hyperscan cache operations through Lua backend
Vsevolod Stakhov [Wed, 14 Jan 2026 14:29:32 +0000 (14:29 +0000)] 
[Feature] Route all hyperscan cache operations through Lua backend

- Route file backend through Lua for consistency with redis/http
- Add zstd compression support with magic byte detection for backward
  compatibility (reads both .hs and .hs.zst files)
- Fix rspamd_util.stat() return value handling (returns err, stat tuple)
- Fix timer management for synchronous Lua callbacks to prevent early
  termination of re_cache compilation
- Fix use-after-free in load path by pre-counting pending items
- Add priority queue for re_cache compilation (short lists first)
- Add ev_run() flush before blocking hyperscan compilations to ensure
  busy notifications are sent
- Add hyperscan_notice_known() and hyperscan_get_platform_id() Lua APIs

2 weeks ago[Feature] Add ASCII85 decode support for PDF text extraction
Vsevolod Stakhov [Wed, 14 Jan 2026 10:30:51 +0000 (10:30 +0000)] 
[Feature] Add ASCII85 decode support for PDF text extraction

PDFs may use ASCII85Decode filter for content streams. This was causing
text extraction to fail for such PDFs, resulting in missed URLs and emails.

- Add rspamd_decode_ascii85_buf() in str_util.c
- Add rspamd_util.decode_ascii85() Lua binding
- Add ASCII85Decode filter support in pdf.lua
- Add --raw flag to rspamadm mime urls command

2 weeks ago[Fix] Refactor control socket to use ID-based request/reply matching
Vsevolod Stakhov [Tue, 13 Jan 2026 21:52:13 +0000 (21:52 +0000)] 
[Fix] Refactor control socket to use ID-based request/reply matching

Replace the serialization-based control command handling with an ID-based
approach using khash, mirroring the existing rspamd_srv_requests pattern.

Key changes:
- Add uint64_t id field to control command/reply structs
- Use khash for O(1) request lookup by ID instead of GHashTable
- Add rspamd_control_reply_handler() for centralized reply processing
- Add rspamd_control_pending_new/destroy/remove_all() API functions
- Add control_ev watcher to worker struct for reply monitoring
- Call rspamd_srv_pipe_cleanup() on worker shutdown to prevent leaks
- Handle ID collisions gracefully (warn and free old entry)

This fixes hash table iterator corruption crashes that occurred when
modifying the hash during iteration, and provides more robust concurrent
command handling.

2 weeks ago[Feature] Disable periodic recompile timer for file cache backend
Vsevolod Stakhov [Tue, 13 Jan 2026 14:19:53 +0000 (14:19 +0000)] 
[Feature] Disable periodic recompile timer for file cache backend

The periodic recompile timer (default 60s) is only useful for shared
backends (Redis, HTTP, Lua) where another rspamd instance might have
compiled new hyperscan databases.

For file backend, recompilation is already triggered by:
- Config reload (forks new hs_helper process)
- Explicit RECOMPILE command (sent on map updates)

This eliminates unnecessary periodic checks for file-based deployments.

2 weeks ago[Fix] Fix re_cache hyperscan file tracking and buffer size
Vsevolod Stakhov [Tue, 13 Jan 2026 13:56:27 +0000 (13:56 +0000)] 
[Fix] Fix re_cache hyperscan file tracking and buffer size

Two fixes for hyperscan cache file handling:

1. Increase hyperscan_cache_file.filename buffer from 64 to 80 bytes
   to accommodate full filenames (64 hex hash + ".hs.unser" = 73 chars)

2. Add rspamd_hyperscan_notice_known() call in re_cache.c after loading
   hyperscan databases. Without this, re_cache files weren't registered
   as "known" and would be deleted by cleanup_maybe() on restart,
   causing unnecessary recompilation.

2 weeks agoMerge pull request #5837 from rspamd/vstakhov-control-async
Vsevolod Stakhov [Tue, 13 Jan 2026 11:46:03 +0000 (11:46 +0000)] 
Merge pull request #5837 from rspamd/vstakhov-control-async

[Fix] Refactor control pipe to prevent deadlocks and crashes

2 weeks ago[Cleanup] Remove unused CONTROL_PATHLEN macro 5837/head
Vsevolod Stakhov [Tue, 13 Jan 2026 11:25:28 +0000 (11:25 +0000)] 
[Cleanup] Remove unused CONTROL_PATHLEN macro

No longer used after reducing hyperscan_cache_file to fixed 64-byte
filename field.

2 weeks ago[Fix] Fix fd leaks and double-free in srv_pipe error handling
Vsevolod Stakhov [Tue, 13 Jan 2026 11:02:09 +0000 (11:02 +0000)] 
[Fix] Fix fd leaks and double-free in srv_pipe error handling

- Close attached_fd before freeing request data when sendmsg fails
- Fix double-free in rspamd_srv_pipe_ctx_destroy: items in send_queue
  are also in the hash table, so only iterate hash to free
- Close attached_fd for unsent requests during shutdown

2 weeks ago[Fix] Reduce hyperscan_cache_file command from CONTROL_PATHLEN to 64 bytes
Vsevolod Stakhov [Tue, 13 Jan 2026 10:44:42 +0000 (10:44 +0000)] 
[Fix] Reduce hyperscan_cache_file command from CONTROL_PATHLEN to 64 bytes

Send only the filename (hash.hs) instead of the full path in the
hyperscan cache notification. Main process reconstructs the full
path using cfg->hs_cache_dir.

This is the last CONTROL_PATHLEN field in rspamd_srv_command.

2 weeks ago[Fix] Refactor srv_pipe to use queue-based architecture with ID dispatch
Vsevolod Stakhov [Tue, 13 Jan 2026 10:20:58 +0000 (10:20 +0000)] 
[Fix] Refactor srv_pipe to use queue-based architecture with ID dispatch

Replace per-request ev_io watchers with a single watcher using khash
for ID-based reply matching. This fixes potential deadlocks when multiple
commands are queued rapidly (e.g., during hyperscan compilation).

Changes:
- Add rspamd_srv_pipe_ctx with single watcher, send queue, and ID hash
- Make srv_pipe non-blocking on both ends with proper EAGAIN handling
- Add EAGAIN handling to main process write path
- Remove cache_dir from hs_loaded commands (available from config)

2 weeks ago[Fix] Reduce control message size to prevent sendmsg crash
Vsevolod Stakhov [Mon, 12 Jan 2026 16:25:30 +0000 (16:25 +0000)] 
[Fix] Reduce control message size to prevent sendmsg crash

The rspamd_srv_command and rspamd_control_command structures grew too
large (~8KB) due to multiple CONTROL_PATHLEN fields in mp_loaded and
re_map_loaded, exceeding socket buffer limits and causing crashes in
sendmsg during worker startup.

Fix by:
- Removing redundant cache_dir fields (all processes know it from config)
- Using consistent name[64] for both mp_loaded and re_map_loaded
- Getting cache_dir from cfg->hs_cache_dir at receive time instead

2 weeks ago[Fix] Correct CSS duplicate property handling to use last declaration
Vsevolod Stakhov [Mon, 12 Jan 2026 12:56:57 +0000 (12:56 +0000)] 
[Fix] Correct CSS duplicate property handling to use last declaration

Fix two bugs in CSS property handling that caused text to be incorrectly
marked as invisible:

1. Fixed isset() macro misuse in override_values() - was passing a bitmask
   instead of a bit index, causing the override to never find matching values

2. Changed add_rule() to call override_values() instead of merge_values()
   when duplicate properties with normal priority are encountered, ensuring
   later CSS declarations properly override earlier ones per CSS spec

This fixes an issue where HTML emails with duplicate color declarations
(e.g., "color:#FFFFFF;color:#232333") would have text incorrectly filtered
as invisible, since only the first color was being used.

Added test case for duplicate color property handling.

2 weeks ago[Fix] Include content URLs in rspamadm mime urls output
Vsevolod Stakhov [Mon, 12 Jan 2026 12:18:33 +0000 (12:18 +0000)] 
[Fix] Include content URLs in rspamadm mime urls output

Change get_urls(true) to get_urls_filtered() to include URLs
extracted from content (e.g., PDF attachments) in the output.

The get_urls() function excludes RSPAMD_URL_FLAG_CONTENT URLs
by default for backward compatibility, but get_urls_filtered()
with no arguments returns all URLs including content URLs.

2 weeks ago[Fix] Add defensive checks to PDF parser for malformed input
Vsevolod Stakhov [Mon, 12 Jan 2026 12:17:32 +0000 (12:17 +0000)] 
[Fix] Add defensive checks to PDF parser for malformed input

Add pcall wrappers and type checks throughout pdf.lua to handle
malformed PDFs from untrusted sources without crashing:

- Add nil checks for stream objects before accessing fields
- Wrap grammar matches in pcall to catch parsing errors
- Add type validation before ipairs calls on trie match results
- Wrap span extractions in pcall to handle invalid offsets
- Add defensive checks in processor functions (trailer, suspicious)
- Wrap URL creation in pcall for malformed URI strings

Errors are logged via debugm for diagnosis while allowing
processing to continue gracefully.

2 weeks ago[Fix] Prevent infinite loop in fuzzy_check config transform
Vsevolod Stakhov [Mon, 12 Jan 2026 08:39:46 +0000 (08:39 +0000)] 
[Fix] Prevent infinite loop in fuzzy_check config transform

When transforming max_score -> hits_limit for backward compatibility,
directly assigning UCL object references between fields can corrupt
the internal linked list pointers (next/prev become self-referential).

This caused an infinite loop in ucl_object_lua_push_array() when the
C code tried to push the config object to Lua via LL_FOREACH macro.

Fix by using tonumber() to extract the numeric value instead of
copying the UCL object reference.

Reported-by: User via GDB backtrace showing hang at lua_ucl.c:240
Fixes: 7fd47dad2f9 ("[Feature] Rename fuzzy_check max_score to hits_limit for clarity")
2 weeks agoMerge pull request #5832 from rspamd/vstakhov-ct-management
Vsevolod Stakhov [Mon, 12 Jan 2026 08:32:06 +0000 (08:32 +0000)] 
Merge pull request #5832 from rspamd/vstakhov-ct-management

[Feature] Add HTTP content negotiation framework

2 weeks ago[Fix] Use base name for OpenMetrics counter TYPE declarations 5832/head
Vsevolod Stakhov [Sun, 11 Jan 2026 20:23:55 +0000 (20:23 +0000)] 
[Fix] Use base name for OpenMetrics counter TYPE declarations

OpenMetrics specification requires counter metrics to have _total suffix
on the metric value, but HELP and TYPE declarations must use the base
name without the suffix.

Before: # TYPE rspamd_scanned_total counter
After:  # TYPE rspamd_scanned counter

This fixes parser rejections due to name clashes when metrics scrapers
see _total in the TYPE line and append another _total.

2 weeks ago[Feature] Add content negotiation for /stat endpoint and zstd compression
Vsevolod Stakhov [Sun, 11 Jan 2026 20:08:49 +0000 (20:08 +0000)] 
[Feature] Add content negotiation for /stat endpoint and zstd compression

- Update /stat handler to use rspamd_controller_send_ucl_negotiated
  for Accept header content-type negotiation (JSON/msgpack)
- Add zstd compression support to rspamd_controller_maybe_compress,
  preferred over gzip when client supports it
- Add functional robot tests for content negotiation covering:
  - OpenMetrics/text/plain Accept headers for /metrics
  - JSON/msgpack Accept headers for /stat
  - gzip/zstd Accept-Encoding compression
  - Quality factor parsing

2 weeks ago[Feature] Add HTTP content negotiation framework
Vsevolod Stakhov [Sun, 11 Jan 2026 18:08:02 +0000 (18:08 +0000)] 
[Feature] Add HTTP content negotiation framework

Add content type negotiation based on Accept header for HTTP responses.
This allows clients like DataDog's OpenMetrics scraper to receive
responses with Content-Type matching their Accept header preferences.

- Add http_content_negotiation.c/h with Accept header parsing
- Support quality factors (q=) in Accept header
- Parse Accept-Encoding for gzip/zstd/deflate support
- Add rspamd_controller_send_openmetrics_negotiated()
- Update /metrics endpoint to negotiate Content-Type
- Fallback to text/plain for Prometheus 0.0.4 compatibility

2 weeks agoMerge pull request #5813 from rspamd/vstakhov-pluggable-hs-cache
Vsevolod Stakhov [Sun, 11 Jan 2026 17:18:36 +0000 (17:18 +0000)] 
Merge pull request #5813 from rspamd/vstakhov-pluggable-hs-cache

Add pluggable hyperscan cache storage infrastructure

2 weeks ago[Fix] Include TLD patterns in ACISM fallback 5813/head
Vsevolod Stakhov [Sun, 11 Jan 2026 16:39:46 +0000 (16:39 +0000)] 
[Fix] Include TLD patterns in ACISM fallback

2 weeks ago[Fix] Fix pattern duplication in multipattern without hyperscan
Vsevolod Stakhov [Sun, 11 Jan 2026 16:37:24 +0000 (16:37 +0000)] 
[Fix] Fix pattern duplication in multipattern without hyperscan

2 weeks ago[Fix] Support building hs_cache_backend without Hyperscan
Vsevolod Stakhov [Sun, 11 Jan 2026 15:47:29 +0000 (15:47 +0000)] 
[Fix] Support building hs_cache_backend without Hyperscan

2 weeks ago[Conf] Add Redis backend example to hs_helper worker config
Vsevolod Stakhov [Sun, 11 Jan 2026 15:04:28 +0000 (15:04 +0000)] 
[Conf] Add Redis backend example to hs_helper worker config

2 weeks ago[Minor] Add state machine diagram to hs_helper.c
Vsevolod Stakhov [Sun, 11 Jan 2026 11:51:41 +0000 (11:51 +0000)] 
[Minor] Add state machine diagram to hs_helper.c

2 weeks ago[Minor] Remove .factory from version control
Vsevolod Stakhov [Sun, 11 Jan 2026 11:40:58 +0000 (11:40 +0000)] 
[Minor] Remove .factory from version control

2 weeks ago[Fix] Enable FALLBACK mode for RE multipatterns (stop words)
Vsevolod Stakhov [Sun, 11 Jan 2026 11:38:22 +0000 (11:38 +0000)] 
[Fix] Enable FALLBACK mode for RE multipatterns (stop words)

- Create pats array for all multipatterns, not just TLD
- Use rspamd_multipattern_build_acism() for proper RE fallback
- Add regex fallback path in lookup while HS is compiling
- Clean up mp->res in destructor for hyperscan path

This fixes stop words multipatterns which use RSPAMD_MULTIPATTERN_RE
to properly use FALLBACK mode instead of falling through to SYNC mode
and creating .hs files during config loading.

2 weeks ago[Feature] Use async hyperscan compilation for language detection stop words
Vsevolod Stakhov [Sun, 11 Jan 2026 09:54:53 +0000 (09:54 +0000)] 
[Feature] Use async hyperscan compilation for language detection stop words

Use FALLBACK mode for stop words - build ACISM trie first for immediate use,
then queue for async hyperscan compilation via hs_helper.

This is the same approach used for TLD/publicsuffix patterns.

2 weeks ago[Feature] Compile small hyperscan databases in memory without file caching
Vsevolod Stakhov [Sat, 10 Jan 2026 21:18:21 +0000 (21:18 +0000)] 
[Feature] Compile small hyperscan databases in memory without file caching

For small pattern sets (< 100 patterns), compile hyperscan databases
synchronously in memory without saving to file or Redis cache.
These databases are shared with workers via fork() COW semantics.

Large pattern sets (like TLD with 10000+ patterns) continue to use
async compilation via hs_helper with Redis caching.

This eliminates unnecessary .hs files in /var/lib/rspamd for small
databases while maintaining the async path for expensive compilations.

2 weeks ago[Fix] Ensure stable re_cache class hashes independent of other classes
Vsevolod Stakhov [Sat, 10 Jan 2026 17:19:32 +0000 (17:19 +0000)] 
[Fix] Ensure stable re_cache class hashes independent of other classes

Previously, the global regexp index `i` was included in per-class hashes,
which caused class B's hash to change when class A got new regexps
(because indices shift). This made Redis caching ineffective as databases
were constantly being recompiled.

Now the global index is only included in the global hash, not in per-class
hashes, ensuring each class hash depends only on its own regexps.

2 weeks ago[Feature] Enhance hyperscan cache debug logging and correlation
Vsevolod Stakhov [Sat, 10 Jan 2026 15:58:40 +0000 (15:58 +0000)] 
[Feature] Enhance hyperscan cache debug logging and correlation

- Add entity_name parameter to async cache API for better traceability
- Correlate cache requests with callbacks (show entity/key in both)
- Use rspamd_zhs prefix by default for compressed Redis data
- Switch to idiomatic lua_util.debugm for Lua debug logging
- Log Redis backend config (prefix, ttl, compression) on creation

2 weeks ago[Feature] Pluggable async hyperscan cache backend
Vsevolod Stakhov [Fri, 9 Jan 2026 19:38:37 +0000 (19:38 +0000)] 
[Feature] Pluggable async hyperscan cache backend

3 weeks ago[Fix] Properly terminate hs_helper during shutdown
Vsevolod Stakhov [Thu, 8 Jan 2026 22:40:38 +0000 (22:40 +0000)] 
[Fix] Properly terminate hs_helper during shutdown

Add RSPAMD_SRV_BUSY command to allow hs_helper to notify main process
when busy with long-running hyperscan compilation. Main skips heartbeat
checks while worker is busy and logs busy reason during shutdown.

Key fixes:
- Prevent notifications being sent after worker receives termination signal
- Propagate ev_break through rspamd_worker_set_busy to properly exit event loop
- Add shutdown monitor timer to log pending workers during termination
- Pass worker pointer to re_cache compile functions for termination checks

3 weeks ago[Conf] Add configuration support for hs_helper worker
Vsevolod Stakhov [Thu, 8 Jan 2026 15:04:17 +0000 (15:04 +0000)] 
[Conf] Add configuration support for hs_helper worker

Add worker-hs_helper.conf and worker-hs_helper.inc config files that are
only installed when hyperscan support is enabled. The main rspamd.conf
uses try=true to gracefully handle missing config on non-hyperscan builds.

3 weeks agoMerge branch 'master' into vstakhov-pluggable-hs-cache
Vsevolod Stakhov [Thu, 8 Jan 2026 14:02:47 +0000 (14:02 +0000)] 
Merge branch 'master' into vstakhov-pluggable-hs-cache

3 weeks ago[Minor] Update version
Vsevolod Stakhov [Thu, 8 Jan 2026 13:20:48 +0000 (13:20 +0000)] 
[Minor] Update version

3 weeks agoRelease 3.14.3 3.14.3
Vsevolod Stakhov [Thu, 8 Jan 2026 13:17:41 +0000 (13:17 +0000)] 
Release 3.14.3

* [Feature] Add task registry for safe Lua task reference validation
* [Feature] Add text quality analysis for PDF garbage filtering
* [Feature] Implement basic PDF text extraction with UTF-16 detection
* [Feature] Add extra tables API for clickhouse plugin
* [Feature] Add confighelp documentation for RBL module
* [Feature] WebUI: add backend API interaction error log
* [Fix] Neural: by default include symbols with no flags
* [Fix] Symcache: make FINE propagation deterministic
* [Fix] URL: Prevent false positives from numeric IP regeneration in mailto URLs
* [Fix] Settings: Allow spaces in selector regexps
* [Fix] Prevent use-after-free in Redis callbacks after session cleanup
* [Fix] Lua 5.4 compatibility in clickhouse and elastic plugins
* [Fix] Use exact map lookup for DKIM key_table instead of glob
* [Fix] Handle connection errors with io_uring backend in HTTP client
* [Minor] Update public suffix list

3 weeks ago[Fix] Neural: by default *include* symbols with no flags
Vsevolod Stakhov [Wed, 7 Jan 2026 14:46:04 +0000 (14:46 +0000)] 
[Fix] Neural: by default *include* symbols with no flags

3 weeks ago[Fix] Symcache: make FINE propagation deterministic (#5825)
Vsevolod Stakhov [Wed, 7 Jan 2026 14:36:20 +0000 (14:36 +0000)] 
[Fix] Symcache: make FINE propagation deterministic (#5825)

3 weeks agoMerge branch 'master' into vstakhov-pluggable-hs-cache
Vsevolod Stakhov [Wed, 7 Jan 2026 10:41:49 +0000 (10:41 +0000)] 
Merge branch 'master' into vstakhov-pluggable-hs-cache

3 weeks agoMerge pull request #5824 from rspamd/sync-public-suffix-list
Vsevolod Stakhov [Wed, 7 Jan 2026 10:40:02 +0000 (10:40 +0000)] 
Merge pull request #5824 from rspamd/sync-public-suffix-list

[Minor] Update public suffix list

3 weeks agoMerge pull request #5828 from fatalbanana/tame_test
Vsevolod Stakhov [Wed, 7 Jan 2026 10:39:51 +0000 (10:39 +0000)] 
Merge pull request #5828 from fatalbanana/tame_test

[Test] See that merged test cases use settings

3 weeks agoMerge pull request #5829 from fatalbanana/fix_dns_test
Vsevolod Stakhov [Wed, 7 Jan 2026 10:39:41 +0000 (10:39 +0000)] 
Merge pull request #5829 from fatalbanana/fix_dns_test

[Test] Suppress bogus lookup

3 weeks ago[Test] Suppress bogus lookup 5829/head
Andrew Lewis [Wed, 7 Jan 2026 10:09:45 +0000 (12:09 +0200)] 
[Test] Suppress bogus lookup

3 weeks ago[Test] See that merged test cases use settings 5828/head
Andrew Lewis [Wed, 7 Jan 2026 09:38:52 +0000 (11:38 +0200)] 
[Test] See that merged test cases use settings

3 weeks ago[Fix] Use free() for hyperscan-allocated buffers in lua_hyperscan
Vsevolod Stakhov [Wed, 7 Jan 2026 09:09:48 +0000 (09:09 +0000)] 
[Fix] Use free() for hyperscan-allocated buffers in lua_hyperscan

hs_serialize_database() uses the standard C allocator, so the returned
buffer must be freed with free(), not g_free(). Mixing allocators
causes memory corruption when hiredis is configured to use glib.

3 weeks ago[Fix] URL: Prevent false positives from numeric IP regeneration in mailto URLs
Vsevolod Stakhov [Tue, 6 Jan 2026 18:21:36 +0000 (18:21 +0000)] 
[Fix] URL: Prevent false positives from numeric IP regeneration in mailto URLs

Fixes #5823 - Google Fonts URLs containing wght@0 parameter were incorrectly triggering URL_NUMERIC_IP and URL_BACKSLASH_PATH due to the @ symbol being interpreted as an email pattern and "0" being expanded to "0.0.0.0".

Also fix URL_BACKSLASH_PATH to actually check for backslashes instead of relying on the ambiguous obscured flag.

3 weeks ago[Fix] Settings: Allow spaces in selector regexps
Vsevolod Stakhov [Tue, 6 Jan 2026 17:01:12 +0000 (17:01 +0000)] 
[Fix] Settings: Allow spaces in selector regexps

3 weeks agoMerge branch 'master' into vstakhov-pluggable-hs-cache
Vsevolod Stakhov [Tue, 6 Jan 2026 16:19:37 +0000 (16:19 +0000)] 
Merge branch 'master' into vstakhov-pluggable-hs-cache

3 weeks agoMerge pull request #5826 from fatalbanana/tame_timeout
Vsevolod Stakhov [Tue, 6 Jan 2026 16:19:20 +0000 (16:19 +0000)] 
Merge pull request #5826 from fatalbanana/tame_timeout

[Test] Reduce DNS timeout, retransmits

3 weeks ago[Test] Add some fake records
Vsevolod Stakhov [Tue, 6 Jan 2026 16:18:56 +0000 (16:18 +0000)] 
[Test] Add some fake records

3 weeks ago[Test] Nuke static nameservers 5826/head
Andrew Lewis [Tue, 6 Jan 2026 14:44:10 +0000 (16:44 +0200)] 
[Test] Nuke static nameservers

3 weeks ago[Test] Reduce DNS timeout, retransmits
Andrew Lewis [Tue, 6 Jan 2026 13:17:14 +0000 (15:17 +0200)] 
[Test] Reduce DNS timeout, retransmits

3 weeks ago[Minor] Skip ACISM fallback build when file cache hit
Vsevolod Stakhov [Tue, 6 Jan 2026 12:47:20 +0000 (12:47 +0000)] 
[Minor] Skip ACISM fallback build when file cache hit

In FALLBACK mode, try loading from file cache first. If successful,
skip building the ACISM trie to save memory. ACISM is only built on
cache miss (when async compilation is needed).

3 weeks ago[Fix] Prevent hs_helper from deleting multipattern cache files
Vsevolod Stakhov [Tue, 6 Jan 2026 12:41:33 +0000 (12:41 +0000)] 
[Fix] Prevent hs_helper from deleting multipattern cache files

Add rspamd_hyperscan_is_file_known() API to check if a file is in the
known hyperscan files cache. Modify hs_helper cleanup to skip files
that are known (e.g., multipattern TLD cache files) even if they
aren't part of the re_cache.

3 weeks ago[Fix] Fix ACISM fallback for multipattern async compilation
Vsevolod Stakhov [Tue, 6 Jan 2026 11:19:33 +0000 (11:19 +0000)] 
[Fix] Fix ACISM fallback for multipattern async compilation

- Add per-pattern is_tld flag instead of checking multipattern-level flag
- Store pattern ID in ACISM wrapper struct for correct callback reporting
- Use ACISM-specific escaping for all patterns in fallback array
- Fix callback to use per-pattern TLD boundary check
- Set FALLBACK mode for URL scanner TLD trie

3 weeks agoMerge pull request #5821 from moisseev/webui
Vsevolod Stakhov [Tue, 6 Jan 2026 08:34:54 +0000 (08:34 +0000)] 
Merge pull request #5821 from moisseev/webui

[Feature] WebUI: add backend API interaction error log

3 weeks ago[Feature] Add async multipattern compilation infrastructure
Vsevolod Stakhov [Mon, 5 Jan 2026 20:44:47 +0000 (20:44 +0000)] 
[Feature] Add async multipattern compilation infrastructure

Add deferred hyperscan compilation for multipatterns (TLD patterns):
- Build ACISM fallback immediately during pre-fork (fast)
- Queue multipatterns for async HS compilation by hs_helper
- Workers hot-swap from ACISM to hyperscan when compilation completes

IPC additions:
- RSPAMD_SRV_MULTIPATTERN_LOADED: hs_helper → main
- RSPAMD_CONTROL_MULTIPATTERN_LOADED: main → workers

Bug fixes:
- Use per-pattern TLD flags instead of multipattern-level flags
- Add word boundary check in ACISM callback for TLD matching

3 weeks ago[Minor] Fix cleanup function in error log clipboard fallback 5821/head
Alexander Moisseev [Mon, 5 Jan 2026 17:41:02 +0000 (20:41 +0300)] 
[Minor] Fix cleanup function in error log clipboard fallback

Fix cleanup function to remove passed element instead of hardcoded textarea

3 weeks ago[Feature] WebUI: add backend API interaction error log
Alexander Moisseev [Mon, 5 Jan 2026 17:03:48 +0000 (20:03 +0300)] 
[Feature] WebUI: add backend API interaction error log

Add an error log modal with a responsive table providing:
- tracking of the last 50 errors using a circular buffer
- an "unseen since last view" counter on the badge in bottom-right corner
- copy-to-clipboard support with execCommand fallback for HTTP connections
- color-coded error types
- automatic column hiding on smaller screens

3 weeks ago[Minor] Add clear logging for multipattern compilation states
Vsevolod Stakhov [Mon, 5 Jan 2026 15:21:45 +0000 (15:21 +0000)] 
[Minor] Add clear logging for multipattern compilation states

- Log when ACISM fallback trie is built
- Log when hyperscan cache hit/miss occurs
- Log when hot-swap to hyperscan completes
- Remove misleading "start compiling" message from url.c

3 weeks ago[Fix] Add RSPAMD_MULTIPATTERN_TLD flag to search_trie_full creation
Vsevolod Stakhov [Mon, 5 Jan 2026 14:58:23 +0000 (14:58 +0000)] 
[Fix] Add RSPAMD_MULTIPATTERN_TLD flag to search_trie_full creation

The TLD flag must be present at multipattern creation time for the
ACISM fallback to work. Without this flag, mp->pats array is not
created and ACISM patterns are not stored, causing fallback to fail
when Hyperscan cache is not available.

3 weeks ago[Fix] Refactor multipattern to use per-multipattern TLD flag
Vsevolod Stakhov [Mon, 5 Jan 2026 11:35:05 +0000 (11:35 +0000)] 
[Fix] Refactor multipattern to use per-multipattern TLD flag

This commit fixes the multipattern implementation to properly support
per-multipattern TLD flag instead of per-pattern flags.

Key changes:
- Remove acism_id_offset field - no longer needed since TLD is now
  per-multipattern, not per-pattern
- Fix hyperscan TLD pattern suffix: use (?:[^a-zA-Z0-9]|$) instead
  of (:?\b|$) because \b requires HS_FLAG_UCP which causes issues
- Initialize pats array in create functions when TLD flag is set
- Add TLD patterns to pats array at start of add_pattern_len for
  ACISM fallback during hyperscan compilation
- Simplify ACISM callback - strnum IS the pattern ID for TLD patterns

For TLD multipatterns, the system now builds BOTH:
- ACISM patterns (for fallback during HS compilation or when unavailable)
- Hyperscan patterns (when available)

At lookup time: use Hyperscan if ready, fall back to ACISM otherwise.

3 weeks ago[Fix] Fix multipattern cache file cleanup and ACISM fallback
Vsevolod Stakhov [Mon, 5 Jan 2026 10:10:08 +0000 (10:10 +0000)] 
[Fix] Fix multipattern cache file cleanup and ACISM fallback

- Register multipattern cache files with rspamd_hyperscan_notice_known()
  to prevent hs_helper from cleaning them up during cache cleanup
- Fix ACISM pattern ID offset for mixed multipatterns (static + TLD):
  when ACISM callback returns strnum, add acism_id_offset to get the
  actual pattern ID that the URL scanner expects

3 weeks ago[Feature] Add multipattern state machine for async compilation support
Vsevolod Stakhov [Mon, 5 Jan 2026 09:52:59 +0000 (09:52 +0000)] 
[Feature] Add multipattern state machine for async compilation support

Add state machine (INIT/COMPILING/COMPILED/FALLBACK) to multipattern
for future async hyperscan compilation. Build ACISM fallback for TLD-only
patterns to allow matching while HS compiles. Mixed TLD/non-TLD patterns
use sync compile. Also update cache format to unified .hs extension.

3 weeks ago[Fix] Use correct .hs extension in multipattern fpath
Vsevolod Stakhov [Sun, 4 Jan 2026 18:03:14 +0000 (18:03 +0000)] 
[Fix] Use correct .hs extension in multipattern fpath

3 weeks agoMerge pull request #5815 from Premkumar-2004/issue-5670
Vsevolod Stakhov [Sun, 4 Jan 2026 15:09:10 +0000 (15:09 +0000)] 
Merge pull request #5815 from Premkumar-2004/issue-5670

GPT: Improve prompt to avoid ambiguity

Issue: #5670

3 weeks agoadded changes 5815/head
Prem [Sun, 4 Jan 2026 14:01:19 +0000 (19:31 +0530)] 
added changes

3 weeks ago[Feature] Unified hyperscan cache format for multipattern
Vsevolod Stakhov [Sun, 4 Jan 2026 09:15:12 +0000 (09:15 +0000)] 
[Feature] Unified hyperscan cache format for multipattern

Add C helper functions for serializing/deserializing hyperscan databases
with the unified format (magic, platform, CRC). Migrate multipattern from
raw .hsmp files to the unified .hs format compatible with re_cache.

- Add rspamd_hyperscan_serialize_with_header() and load_from_header()
- Update multipattern to use unified format with platform validation
- Fix CRC calculation in Lua bindings to match re_cache format

3 weeks agoMerge pull request #5817 from Premkumar-2004/issue-5799-clean
Vsevolod Stakhov [Sun, 4 Jan 2026 08:59:21 +0000 (08:59 +0000)] 
Merge pull request #5817 from Premkumar-2004/issue-5799-clean

Add diacritics flag to Thai language

Issue: #5799

3 weeks agoMerge branch 'master' into issue-5799-clean 5817/head
Vsevolod Stakhov [Sat, 3 Jan 2026 17:15:39 +0000 (17:15 +0000)] 
Merge branch 'master' into issue-5799-clean

3 weeks agochanges
Prem [Sat, 3 Jan 2026 17:14:15 +0000 (22:44 +0530)] 
changes

3 weeks agomodified as suggested
Prem [Sat, 3 Jan 2026 11:35:13 +0000 (17:05 +0530)] 
modified as suggested

3 weeks agomodified as suggested
Prem [Sat, 3 Jan 2026 11:26:04 +0000 (16:56 +0530)] 
modified as suggested

3 weeks agoMerge pull request #5818 from moisseev/license
Vsevolod Stakhov [Sat, 3 Jan 2026 11:10:13 +0000 (11:10 +0000)] 
Merge pull request #5818 from moisseev/license

[Minor] Remove MIT license references from WebUI files

3 weeks ago[Minor] Remove MIT license references from WebUI files 5818/head
Copilot [Sat, 3 Jan 2026 10:33:57 +0000 (13:33 +0300)] 
[Minor] Remove MIT license references from WebUI files

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: moisseev <2275981+moisseev@users.noreply.github.com>
3 weeks agofixed issue-5799
Prem [Sat, 3 Jan 2026 08:35:02 +0000 (14:05 +0530)] 
fixed issue-5799

3 weeks agofixed issue-5670
Prem [Sat, 3 Jan 2026 07:14:30 +0000 (12:44 +0530)] 
fixed issue-5670

3 weeks ago[Feature] Add Lua hyperscan compilation bindings and orchestration module
Vsevolod Stakhov [Fri, 2 Jan 2026 17:54:10 +0000 (17:54 +0000)] 
[Feature] Add Lua hyperscan compilation bindings and orchestration module

- Add rspamd_hyperscan Lua module with compile/serialize/deserialize/validate
- Create lua_hs_compile.lua orchestration module for unified compilation
- Support pluggable cache backends via lua_hs_cache integration
- Use unified file format with magic, platform info, CRC validation

4 weeks ago[Feature] Add pluggable hyperscan cache storage infrastructure
Vsevolod Stakhov [Fri, 2 Jan 2026 09:37:44 +0000 (09:37 +0000)] 
[Feature] Add pluggable hyperscan cache storage infrastructure

This commit adds infrastructure for pluggable hyperscan cache storage
backends and FD-based shared memory distribution:

- Add platform ID function (rspamd_hyperscan_get_platform_id) for
  platform-aware cache keys
- Create lua_hs_cache.lua with file, Redis, and HTTP backends
- Add FD-based loading APIs (rspamd_hyperscan_from_fd,
  rspamd_hyperscan_create_shared_unser)
- Add fd_size field to control messages for FD passing
- Update worker to handle attached FDs in hyperscan notifications
- Add cache_backend configuration option to hs_helper

4 weeks agoMerge pull request #5811 from moisseev/webui
Vsevolod Stakhov [Thu, 1 Jan 2026 15:58:38 +0000 (15:58 +0000)] 
Merge pull request #5811 from moisseev/webui

[Minor] Add WebUI architecture documentation

4 weeks ago[Minor] Add WebUI architecture documentation 5811/head
Alexander Moisseev [Thu, 1 Jan 2026 13:14:03 +0000 (16:14 +0300)] 
[Minor] Add WebUI architecture documentation

Create interface/ARCHITECTURE.md to help developers and AI agents
navigate the codebase.

4 weeks ago[Minor] Update public suffix list 5824/head
github-actions[bot] [Thu, 1 Jan 2026 00:32:16 +0000 (00:32 +0000)] 
[Minor] Update public suffix list

4 weeks agoMerge pull request #5810 from rspamd/vstakhov-clickhouse-extra-tables
Vsevolod Stakhov [Wed, 31 Dec 2025 11:43:37 +0000 (11:43 +0000)] 
Merge pull request #5810 from rspamd/vstakhov-clickhouse-extra-tables

[Feature] Add extra tables API for clickhouse plugin

4 weeks ago[Feature] Add extra tables API for clickhouse plugin 5810/head
Vsevolod Stakhov [Wed, 31 Dec 2025 10:54:55 +0000 (10:54 +0000)] 
[Feature] Add extra tables API for clickhouse plugin

Allow other plugins to dynamically register custom Clickhouse tables
via rspamd_plugins['clickhouse'].register_extra_table(). Supports
per-table schemas, row callbacks (single or multiple rows), and
independent retention settings.

4 weeks agoRevert "[Fix] Use exact map lookup for DKIM key_table instead of glob"
Vsevolod Stakhov [Wed, 31 Dec 2025 11:21:10 +0000 (11:21 +0000)] 
Revert "[Fix] Use exact map lookup for DKIM key_table instead of glob"

This reverts commit 0dadf30f5f52b3a89a859dfdc947954bff612e8c.

4 weeks ago[Fix] Use exact map lookup for DKIM key_table instead of glob
Vsevolod Stakhov [Wed, 31 Dec 2025 09:46:31 +0000 (09:46 +0000)] 
[Fix] Use exact map lookup for DKIM key_table instead of glob

Fixes #5806 - key_table was using glob matching which caused
prefix collisions (e.g., 'bvv' matching 'bvvvolley')

4 weeks ago[Fix] Add Homebrew LLVM libc++ library path on macOS
Vsevolod Stakhov [Tue, 30 Dec 2025 11:09:18 +0000 (11:09 +0000)] 
[Fix] Add Homebrew LLVM libc++ library path on macOS

4 weeks agoMerge pull request #5809 from rspamd/revert-5793-lua54
Vsevolod Stakhov [Tue, 30 Dec 2025 11:23:15 +0000 (11:23 +0000)] 
Merge pull request #5809 from rspamd/revert-5793-lua54

Revert "Use PUC-Rio Lua in packages"

4 weeks agoRevert "Use PUC-Rio Lua in packages" 5809/head
Vsevolod Stakhov [Tue, 30 Dec 2025 09:47:39 +0000 (09:47 +0000)] 
Revert "Use PUC-Rio Lua in packages"

4 weeks ago[Fix] Fix replxx build with LLVM 21+
Vsevolod Stakhov [Mon, 29 Dec 2025 22:28:40 +0000 (22:28 +0000)] 
[Fix] Fix replxx build with LLVM 21+

- Simplify CMakeLists.txt to use CMAKE_CXX_STANDARD 20
- Replace std::unordered_map with std::map to avoid libc++ ABI issues
- Add operator< to UnicodeString for std::map compatibility

4 weeks ago[Project] Update fmt library to 12.1.0
Vsevolod Stakhov [Mon, 29 Dec 2025 22:13:25 +0000 (22:13 +0000)] 
[Project] Update fmt library to 12.1.0

Also restore doctest/scripts/version.txt removed in previous commit.

4 weeks ago[Project] Remove documentation files from contrib dependencies
Vsevolod Stakhov [Mon, 29 Dec 2025 18:22:57 +0000 (18:22 +0000)] 
[Project] Remove documentation files from contrib dependencies

Keep only essential files: sources, headers, build system, and licenses.

4 weeks ago[Fix] Avoid SDK headers in include path when package ROOT is specified
Vsevolod Stakhov [Sun, 28 Dec 2025 21:20:12 +0000 (21:20 +0000)] 
[Fix] Avoid SDK headers in include path when package ROOT is specified

- Add NO_DEFAULT_PATH to FIND_PATH when PKG_ROOT is set to prevent
  macOS SDK C headers from polluting include paths before libc++
- Fix typo: {RSPAMD_DEFAULT_INCLUDE_PATHS} -> ${...}
- Remove obsolete paths (/opt/csw, /sw), add /opt/homebrew for macOS

4 weeks ago[Feature] Rename fuzzy_check max_score to hits_limit for clarity
Vsevolod Stakhov [Sun, 28 Dec 2025 18:45:05 +0000 (18:45 +0000)] 
[Feature] Rename fuzzy_check max_score to hits_limit for clarity

The option name max_score was confusing as it doesn't refer to the
symbol score but rather the number of fuzzy hash hits at which the
normalized score reaches ~1.0 (formula: tanh(e * hits / hits_limit)).

- Rename max_score -> hits_limit in fuzzy_check.c and default config
- Add backward compatibility: max_score is still accepted as an alias
- Add lua_cfg_transform to handle legacy configs (max_score overrides
  hits_limit to ensure local.d overrides work correctly)
- Add explanatory comments in config and documentation

4 weeks ago[Fix] Add resilience to lua_cfg_transform
Vsevolod Stakhov [Sat, 27 Dec 2025 10:59:05 +0000 (10:59 +0000)] 
[Fix] Add resilience to lua_cfg_transform

- Check :type() before indexing UCL objects to handle null values
- Wrap transform sections in pcall to prevent one bad config section
  from breaking the entire configuration load
- Log errors with section name for easier debugging

5 weeks ago[Fix] Load rbl_common early for confighelp schema registration
Vsevolod Stakhov [Thu, 25 Dec 2025 15:37:37 +0000 (15:37 +0000)] 
[Fix] Load rbl_common early for confighelp schema registration

Move require of plugins/rbl before confighelp check so the schema
gets registered even in confighelp mode.

5 weeks ago[Feature] Add confighelp documentation for RBL module
Vsevolod Stakhov [Thu, 25 Dec 2025 15:26:07 +0000 (15:26 +0000)] 
[Feature] Add confighelp documentation for RBL module

Add schema documentation for all RBL rule and plugin options.
Register schemas with plugin registry for rspamadm confighelp.