]> git.ipfire.org Git - thirdparty/rspamd.git/log
thirdparty/rspamd.git
3 months 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

3 months 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

3 months 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

3 months 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.

3 months 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.

3 months 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.

3 months 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.

3 months 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

3 months agoFix condition check for training ANN
Dmitriy Alekseev [Fri, 9 Jan 2026 20:40:02 +0000 (21:40 +0100)] 
Fix condition check for training ANN

3 months agoFix condition check for training ANN
Dmitriy Alekseev [Fri, 9 Jan 2026 20:23:22 +0000 (21:23 +0100)] 
Fix condition check for training ANN

3 months ago[Neural] Add default store_set_only value for rule
Dmitriy Alekseev [Fri, 9 Jan 2026 19:41:50 +0000 (20:41 +0100)] 
[Neural] Add default store_set_only value for rule

3 months 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 months ago[Neural] Add option to skip training if store_set_only is true
Dmitriy Alekseev [Fri, 9 Jan 2026 19:23:47 +0000 (20:23 +0100)] 
[Neural] Add option to skip training if store_set_only is true

3 months 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 months 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 months agoMerge branch 'master' into master
Vsevolod Stakhov [Thu, 8 Jan 2026 14:08:12 +0000 (14:08 +0000)] 
Merge branch 'master' into master

3 months 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 months ago[Minor] Update version
Vsevolod Stakhov [Thu, 8 Jan 2026 13:20:48 +0000 (13:20 +0000)] 
[Minor] Update version

3 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months 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 months agoadded changes 5815/head
Prem [Sun, 4 Jan 2026 14:01:19 +0000 (19:31 +0530)] 
added changes

3 months 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 months 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 months 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 months agochanges
Prem [Sat, 3 Jan 2026 17:14:15 +0000 (22:44 +0530)] 
changes

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

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

3 months 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 months 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 months agofixed issue-5799
Prem [Sat, 3 Jan 2026 08:35:02 +0000 (14:05 +0530)] 
fixed issue-5799

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

3 months 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

3 months 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

3 months 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

3 months 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.

3 months 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

3 months 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

3 months 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.

3 months 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.

3 months 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')

3 months 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

3 months 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"

3 months 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"

3 months 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

3 months 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.

3 months 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.

3 months 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 months 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 months 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

4 months 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.

4 months 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.

4 months ago[Fix] Preserve doc from optional wrappers in lua_shape
Vsevolod Stakhov [Thu, 25 Dec 2025 15:24:19 +0000 (15:24 +0000)] 
[Fix] Preserve doc from optional wrappers in lua_shape

When a schema field uses :optional():doc(), the documentation was lost
during table field normalization. Now propagates doc to inner schema.

4 months ago[Fix] Add null checks for task in Redis stat callbacks
Vsevolod Stakhov [Thu, 25 Dec 2025 11:24:13 +0000 (11:24 +0000)] 
[Fix] Add null checks for task in Redis stat callbacks

Prevent crash when task becomes invalid during async Redis
callbacks by checking lua_check_task return value.

4 months ago[Fix] More lua_settop fixes in MIME processing
Vsevolod Stakhov [Tue, 23 Dec 2025 11:15:21 +0000 (11:15 +0000)] 
[Fix] More lua_settop fixes in MIME processing

Fix additional lua_settop(L, 0) calls in rspamd_message_from_data
and rspamd_mime_expr_process that could corrupt the Lua stack.

4 months ago[Fix] Restore Lua stack properly in second-pass MIME detection
Vsevolod Stakhov [Tue, 23 Dec 2025 10:13:43 +0000 (10:13 +0000)] 
[Fix] Restore Lua stack properly in second-pass MIME detection

Fix lua_settop(L, 0) which cleared the entire Lua stack instead
of restoring to the previous state, causing segfaults when
process_message() was called from Lua unit tests.

4 months agoMerge pull request #5803 from rspamd/vstakhov-task-registry
Vsevolod Stakhov [Mon, 22 Dec 2025 18:50:11 +0000 (18:50 +0000)] 
Merge pull request #5803 from rspamd/vstakhov-task-registry

[Feature] Add task registry for safe Lua task reference validation

4 months agoMerge pull request #5804 from fatalbanana/rspamadm_timeouts
Vsevolod Stakhov [Mon, 22 Dec 2025 18:49:29 +0000 (18:49 +0000)] 
Merge pull request #5804 from fatalbanana/rspamadm_timeouts

[Test] Set timeout for rspamadm functional tests

4 months agoMerge pull request #5805 from fatalbanana/fix_confighelp
Vsevolod Stakhov [Mon, 22 Dec 2025 18:49:12 +0000 (18:49 +0000)] 
Merge pull request #5805 from fatalbanana/fix_confighelp

[Minor] confighelp: Lua compatibility, remove bogus elements

4 months ago[Minor] confighelp: Lua compatibility, remove bogus elements 5805/head
Andrew Lewis [Mon, 22 Dec 2025 16:26:07 +0000 (18:26 +0200)] 
[Minor] confighelp: Lua compatibility, remove bogus elements

4 months ago[Test] Set timeout for rspamadm functional tests 5804/head
Andrew Lewis [Mon, 22 Dec 2025 15:26:06 +0000 (17:26 +0200)] 
[Test] Set timeout for rspamadm functional tests

4 months ago[Fix] Use Fibonacci hashing for task pointer hash 5803/head
Vsevolod Stakhov [Mon, 22 Dec 2025 11:53:37 +0000 (11:53 +0000)] 
[Fix] Use Fibonacci hashing for task pointer hash

Use golden ratio multiplication for 64-bit to 32-bit pointer hashing.
This provides good distribution with minimal operations (1 multiply +
1 shift) and works well with kh_int_hash_func which is identity.

4 months ago[Fix] Add logging, preallocation and hash mixing to task registry
Vsevolod Stakhov [Mon, 22 Dec 2025 11:25:49 +0000 (11:25 +0000)] 
[Fix] Add logging, preallocation and hash mixing to task registry

- Log error when detecting use-after-free attempt on task pointer
- Preallocate task set to 16 elements to reduce early rehashing
- Mix pointer bits using multiplicative hash for better distribution

4 months ago[Fix] Use pointer set instead of key map for task validation
Vsevolod Stakhov [Mon, 22 Dec 2025 10:06:19 +0000 (10:06 +0000)] 
[Fix] Use pointer set instead of key map for task validation

Store task pointers in a khash set and validate them on lookup
from Lua. This works with all code paths that create task userdata
directly without going through rspamd_lua_task_push.

4 months ago[Fix] Use rspamd_lua_task_push in all task creation paths
Vsevolod Stakhov [Sun, 21 Dec 2025 22:23:36 +0000 (22:23 +0000)] 
[Fix] Use rspamd_lua_task_push in all task creation paths

Fix load_from_file, load_from_string, and create to use
rspamd_lua_task_push instead of directly creating userdata
with raw task pointer.

4 months ago[Feature] Add task registry for safe Lua task reference validation
Vsevolod Stakhov [Sun, 21 Dec 2025 20:05:27 +0000 (20:05 +0000)] 
[Feature] Add task registry for safe Lua task reference validation

Implement a global task registry that maps unique uint64_t keys to task
pointers. This prevents use-after-free bugs when Lua code holds references
to tasks that may have been freed (e.g., in async Redis callbacks).

Key changes:
- Add lua_key field to rspamd_task struct
- Implement task registry using khash (O(1) lookup)
- Store lua_key in Lua userdata instead of raw pointer
- Lookup via registry when extracting task from Lua
- Remove task from registry FIRST in rspamd_task_free()

The counter-based key approach avoids issues with:
- Pointer reuse after free (memory allocator may reuse addresses)
- Lua number precision (52-bit mantissa is sufficient for counter)
- NaN/subnormal float values that could cause issues

This fixes potential use-after-free in Redis script waitq callbacks
when Redis is unavailable longer than task lifetime.

4 months agoRevert "[Fix] Prevent use-after-free in Redis callbacks after session cleanup"
Vsevolod Stakhov [Fri, 19 Dec 2025 12:28:28 +0000 (12:28 +0000)] 
Revert "[Fix] Prevent use-after-free in Redis callbacks after session cleanup"

This reverts commit 99ba65fc30685e613c138dc1f68acdc51732f86f.

4 months agoRevert "[Fix] Release Redis connection in lua_redis_fin to avoid double-free"
Vsevolod Stakhov [Fri, 19 Dec 2025 12:28:12 +0000 (12:28 +0000)] 
Revert "[Fix] Release Redis connection in lua_redis_fin to avoid double-free"

This reverts commit b8de1b2542dedf8ab92a51e74b6f2a27c8d70e7b.

4 months ago[Minor] Greylist: improve debug logging
Vsevolod Stakhov [Fri, 19 Dec 2025 12:27:53 +0000 (12:27 +0000)] 
[Minor] Greylist: improve debug logging

4 months ago[Fix] Release Redis connection in lua_redis_fin to avoid double-free
Vsevolod Stakhov [Fri, 19 Dec 2025 09:39:59 +0000 (09:39 +0000)] 
[Fix] Release Redis connection in lua_redis_fin to avoid double-free

Also set ud->ctx = NULL so lua_redis_dtor won't try to release again
during Lua GC after the pool may have been destroyed.

4 months ago[Fix] Prevent use-after-free in Redis callbacks after session cleanup
Vsevolod Stakhov [Thu, 18 Dec 2025 16:13:23 +0000 (16:13 +0000)] 
[Fix] Prevent use-after-free in Redis callbacks after session cleanup

Set ud->terminated in lua_redis_fin() so async Redis callbacks
don't access task data after the task pool has been freed.

4 months agoMerge pull request #5762 from rspamd/vstakhov-pdf-text
Vsevolod Stakhov [Wed, 17 Dec 2025 11:47:12 +0000 (11:47 +0000)] 
Merge pull request #5762 from rspamd/vstakhov-pdf-text

[Feature] Implement basic PDF text extraction