]> git.ipfire.org Git - thirdparty/rspamd.git/log
thirdparty/rspamd.git
6 weeks agoStore TLS opts in lua stack, no strdup/free 5626/head
Justin Dossey [Thu, 25 Sep 2025 16:52:45 +0000 (09:52 -0700)] 
Store TLS opts in lua stack, no strdup/free

- Removed g_strdup/g_free of TLS paths in src/lua/lua_redis.c.
- Now we:
  - Keep TLS values (booleans + strings) on the Lua stack temporarily.
  - Use an absolute table index (so gettable calls aren’t confused by
    the growing stack).
  - Call rspamd_redis_pool_connect_ext while those values are on the
    stack.
  - Pop all postponed values and then the table in one go immediately
    after the connect call.
- The C++ pool still copies into std::string on element creation; we
  only ensure Lua strings live through the call without extra
  allocations.

6 weeks agoUse clang-format-18 to address indentation mismatches
Justin Dossey [Mon, 22 Sep 2025 15:35:16 +0000 (08:35 -0700)] 
Use clang-format-18 to address indentation mismatches

6 weeks agoFix errors found by @vstakhov in #5626
Justin Dossey [Mon, 22 Sep 2025 15:25:46 +0000 (08:25 -0700)] 
Fix errors found by @vstakhov in #5626

- remove redundant `ensure_ssl_inited` function and calls. Core SSL init
  should suffice.
- Refactor TLS initiation into `redis_pool_elt::initiate_tls(...)` to
  eliminate duplication
- Switch TLS flags to `bool` in the public struct
- Fix ephemeral string usage in lua by duplicating the values into
  locals and freeing after connect. Flags are boolean. (it's not super
  likely that Lua will GC the strings before we connect to Redis, but
  this ensures that it won't be a problem)
- Remove the redis TLS options propagation unit test

Build succeeds and C++ unit tests pass.

7 weeks agofeat(redis): add configurable TLS for Redis connections
Justin Dossey [Fri, 19 Sep 2025 17:08:15 +0000 (10:08 -0700)] 
feat(redis): add configurable TLS for Redis connections

- Add TLS options to Redis config schema (ssl, no_ssl_verify, ssl_ca, ssl_ca_dir, ssl_cert, ssl_key, sni)
- Thread TLS options through lua_redis and request helpers
- Implement TLS handshake in redis pool using hiredis SSL (redisCreateSSLContextWithOptions + redisInitiateSSLWithContext)
- Keep plain connections default and support Unix sockets
- Add unit test to validate TLS options propagation (test/lua/unit/redis_tls.lua)

Tested against local TLS Redis on localhost:6379 (PING returns PONG).

7 weeks agoMerge pull request #5623 from rspamd/vstakhov-lua-archive
Vsevolod Stakhov [Thu, 18 Sep 2025 20:49:39 +0000 (02:49 +0600)] 
Merge pull request #5623 from rspamd/vstakhov-lua-archive

[Feature] Add archive module

7 weeks ago[Feature] Add archive module 5623/head
Vsevolod Stakhov [Thu, 18 Sep 2025 13:49:51 +0000 (14:49 +0100)] 
[Feature] Add archive module

7 weeks ago[Minor] Fix non-hyperscan build
Vsevolod Stakhov [Thu, 18 Sep 2025 09:03:39 +0000 (10:03 +0100)] 
[Minor] Fix non-hyperscan build

Issue: #5620

7 weeks ago[Minor] Update version of rspamd to 3.13.1
Vsevolod Stakhov [Thu, 18 Sep 2025 08:59:52 +0000 (09:59 +0100)] 
[Minor] Update version of rspamd to 3.13.1

7 weeks agoMerge pull request #5621 from fatalbanana/maybe_no_arm
Vsevolod Stakhov [Wed, 17 Sep 2025 16:33:41 +0000 (22:33 +0600)] 
Merge pull request #5621 from fatalbanana/maybe_no_arm

[Test] Allow ARM worker to be disabled or replaced

7 weeks ago[Test] Allow ARM worker to be disabled or replaced 5621/head
Andrew Lewis [Wed, 17 Sep 2025 13:52:46 +0000 (15:52 +0200)] 
[Test] Allow ARM worker to be disabled or replaced

7 weeks ago[Minor] Fix naughty warning 3.13.0
Vsevolod Stakhov [Wed, 17 Sep 2025 10:36:36 +0000 (11:36 +0100)] 
[Minor] Fix naughty warning

7 weeks agoRelease 3.13.0
Vsevolod Stakhov [Wed, 17 Sep 2025 07:59:35 +0000 (08:59 +0100)] 
Release 3.13.0

* [Conf] Add defaults
* [Conf] Fix JB IDE damage
* [Feature] Add a signal from main to workers for workers ready state
* [Feature] Add lua_util.fold_header_with_encoding
* [Feature] Add some convenience options to rspamc
* [Feature] Add some more OS utility functions
* [Feature] Add symbols proxy for piecewise changes
* [Feature] Allow lua callback maps to be filled line by line
* [Feature] Allow selectors in regexp maps expressions
* [Feature] Allow to pass expression flags in the regexp plugin
* [Feature] Detect part types in mime parser
* [Feature] Resolve DNS nameservers names using getaddrinfo
* [Fix] Bayes: Try to be bug-to-bug compatible
* [Fix] Check skip_hashes for the returned hashes
* [Fix] Fix DL lists initialisations
* [Fix] Fix double free in the client...
* [Fix] Fix end-to-end proxy compression
* [Fix] Fix l= calculations again
* [Fix] Fix lua state setting ambiguity
* [Fix] Fix order of descriptor closing
* [Fix] Fix probabilities overflow
* [Fix] Fix rules setup
* [Fix] Fix statfiles ordering
* [Fix] Fix various corner cases and tests
* [Fix] Fix whitelist options in the arc module
* [Fix] GPT: Fix occasional damage
* [Fix] GPT: fix processing of messages with no subject
* [Fix] Prevent WebUI crash with empty RRD
* [Fix] Store html attributes that are empty
* [Fix] Try to fix learned order
* [Fix] Use C++20 standard consistently to resolve ODR violations
* [Fix] Use a more straightforward approach for learn cache
* [Fix] fix error check in lua_dkim_tools.lua
* [Project] Add CTA analytics engine
* [Project] Add ability to create custom tokenizers for languages
* [Project] Add controller learn endpoints
* [Project] Add support of granular timeouts to plugins and maps
* [Project] Add tests and fix stuff
* [Project] Add tests for LLM provider, fix various issues with metatokens
* [Project] Apply changes to bayes_expiry plugin
* [Project] Create an isolated API for external tokenizers
* [Project] Extract more features from HTML messages
* [Project] Fix Lua API and some constexpr compatibility
* [Project] Fix binary classification and lua scripts
* [Project] Fix more calculation issues
* [Project] Fix other classification and learning issues
* [Project] Fix scoped compilation again
* [Project] Fix symbols finalisation
* [Project] Fix unlearn stuff
* [Project] Fix various issues
* [Project] Fix various other issues
* [Project] Further updates
* [Project] Implement backoff for upstreams revival
* [Project] Implement more flexible http timeouts
* [Project] Implement scoped compilation
* [Project] Implement scoped regexp cache system
* [Project] Multi-class classification project baseline
* [Project] Rework rspamc to allow training of different neural types
* [Project] Rework system of html tags to allow more tag types
* [Project] Rework tokenizers initialisation
* [Project] Some rework of the CTA defaults
* [Project] Start implementation of the rules maps
* [Project] Start to implement better revive strategy for upstreams
* [Project] Store regexp rules state to avoid incomplete/orphaned rules
* [Project] Support more common html attributes
* [Project] Take button weight into consideration
* [Project] Use re_cache scopes for maps
* [Rework] Fix logger format string mismatch
* [Rework] MIME detection via Lua Magic; enforce cfg in Lua task API
* [Rework] Return back N-ary optimizations for arithmetic-alike expressions
* [Rework] Use GLib agnostic type for words
* [Rework]Refactor MIME detection via Lua Magic; enforce cfg in Lua task API
* [Rules] Make bitcoin expression to use explicit flags

7 weeks agoBump Rspamd version to 3.13.0
Vsevolod Stakhov [Wed, 17 Sep 2025 07:20:45 +0000 (08:20 +0100)] 
Bump Rspamd version to 3.13.0

7 weeks agoMerge pull request #5612 from hunter-nl/master
Vsevolod Stakhov [Tue, 16 Sep 2025 15:38:10 +0000 (21:38 +0600)] 
Merge pull request #5612 from hunter-nl/master

GPT: Refactor model parameters and response handling. Improved prompt.

7 weeks agoMerge pull request #5602 from flesueur/dcc
Vsevolod Stakhov [Tue, 16 Sep 2025 15:28:18 +0000 (21:28 +0600)] 
Merge pull request #5602 from flesueur/dcc

DCC plugin cleanup

7 weeks agoRevert "[Minor] Use modern bayes configuration"
Vsevolod Stakhov [Tue, 16 Sep 2025 15:26:07 +0000 (16:26 +0100)] 
Revert "[Minor] Use modern bayes configuration"

This reverts commit 42ea8dfbdb742c1d94d36b97139a4229104fe08f.

7 weeks agoMerge pull request #5608 from rspamd/vstakhov-html-features
Vsevolod Stakhov [Tue, 16 Sep 2025 10:09:02 +0000 (16:09 +0600)] 
Merge pull request #5608 from rspamd/vstakhov-html-features

[Project] Extract more features from HTML messages

7 weeks agoRemove unnecessary blank lines in gpt.lua 5612/head
hunter-nl [Tue, 16 Sep 2025 09:22:23 +0000 (11:22 +0200)] 
Remove unnecessary blank lines in gpt.lua

7 weeks agoMerge pull request #5619 from rspamd/vstakhov-mime-parser-detection
Vsevolod Stakhov [Tue, 16 Sep 2025 08:43:46 +0000 (14:43 +0600)] 
Merge pull request #5619 from rspamd/vstakhov-mime-parser-detection

[Feature] Detect part types in mime parser

7 weeks agoMerge pull request #5617 from rspamd/vstakhov-lua-symbols-proxy
Vsevolod Stakhov [Tue, 16 Sep 2025 08:43:27 +0000 (14:43 +0600)] 
Merge pull request #5617 from rspamd/vstakhov-lua-symbols-proxy

Lua: Add index to rspamd_config and symbol proxy to enable piecewise symbol updates

7 weeks ago[Minor] Improve logging for mime parser 5619/head
Vsevolod Stakhov [Tue, 16 Sep 2025 08:18:59 +0000 (09:18 +0100)] 
[Minor] Improve logging for mime parser

- Add debug logs for mime parser

7 weeks ago[Rework] MIME detection via Lua Magic; enforce cfg in Lua task API
Vsevolod Stakhov [Mon, 15 Sep 2025 18:44:37 +0000 (19:44 +0100)] 
[Rework] MIME detection via Lua Magic; enforce cfg in Lua task API

- Add rspamd_mime_parser_config on cfg; remove global state and lazy init
- Initialize parser config once per cfg; preload lua_magic.detect_mime_part
- Always run detection after normal part parse; promote .eml/message parts
- Preserve detected_ext/detected_ct/detected_type and NO_TEXT flag
- Remove duplicate detection from message.c; add debug logs
- Restore CTE parsing API and fix call sites
- Enforce cfg requirement in rspamd_task.load_from_string/load_from_file/create
- Fix unit tests to pass rspamd_config to load_from_string

7 weeks ago[Rework]Refactor MIME detection via Lua Magic; enforce cfg in Lua task API
Vsevolod Stakhov [Mon, 15 Sep 2025 14:03:15 +0000 (15:03 +0100)] 
[Rework]Refactor MIME detection via Lua Magic; enforce cfg in Lua task API

- Add rspamd_mime_parser_config on cfg; remove global state and lazy init
- Initialize parser config once per cfg; preload lua_magic.detect_mime_part
- Always run detection after normal part parse; promote .eml/message parts
- Preserve detected_ext/detected_ct/detected_type and NO_TEXT flag
- Remove duplicate detection from message.c; add debug logs
- Restore CTE parsing API and fix call sites
- Enforce cfg requirement in rspamd_task.load_from_string/load_from_file/create
- Fix unit tests to pass rspamd_config to load_from_string

7 weeks ago[Feature] Detect part types in mime parser
Vsevolod Stakhov [Mon, 15 Sep 2025 10:06:14 +0000 (11:06 +0100)] 
[Feature] Detect part types in mime parser

7 weeks ago[Rework] Fix logger format string mismatch 5617/head
Vsevolod Stakhov [Sun, 14 Sep 2025 09:35:17 +0000 (10:35 +0100)] 
[Rework] Fix logger format string mismatch

7 weeks ago[Feature] Add symbols proxy for piecewise changes
Vsevolod Stakhov [Sun, 14 Sep 2025 09:02:41 +0000 (10:02 +0100)] 
[Feature] Add symbols proxy for piecewise changes

7 weeks agoMerge pull request #5614 from rspamd/vstakhov-http-flexible-policies
Vsevolod Stakhov [Sun, 14 Sep 2025 07:43:00 +0000 (13:43 +0600)] 
Merge pull request #5614 from rspamd/vstakhov-http-flexible-policies

[Project] Implement more flexible http timeouts

7 weeks ago[Fix] Fix rules setup
Vsevolod Stakhov [Sat, 13 Sep 2025 13:38:06 +0000 (14:38 +0100)] 
[Fix] Fix rules setup

7 weeks agoMerge pull request #5615 from rspamd/vstakhov-regexp-maps-enchancement
Vsevolod Stakhov [Sat, 13 Sep 2025 06:17:00 +0000 (12:17 +0600)] 
Merge pull request #5615 from rspamd/vstakhov-regexp-maps-enchancement

Multimap: SA-like selector rules with regexp-cache/HS integration

8 weeks ago[Test] Remove occasional change 5615/head
Vsevolod Stakhov [Fri, 12 Sep 2025 15:42:33 +0000 (16:42 +0100)] 
[Test] Remove occasional change

8 weeks ago[Project] Add tests and fix stuff
Vsevolod Stakhov [Fri, 12 Sep 2025 15:33:13 +0000 (16:33 +0100)] 
[Project] Add tests and fix stuff

8 weeks ago[Feature] Allow selectors in regexp maps expressions
Vsevolod Stakhov [Fri, 12 Sep 2025 11:26:12 +0000 (12:26 +0100)] 
[Feature] Allow selectors in regexp maps expressions

8 weeks ago[Conf] Fix JB IDE damage 5614/head
Vsevolod Stakhov [Fri, 12 Sep 2025 09:43:26 +0000 (10:43 +0100)] 
[Conf] Fix JB IDE damage

8 weeks ago[Minor] Fix formatting
Vsevolod Stakhov [Fri, 12 Sep 2025 09:42:02 +0000 (10:42 +0100)] 
[Minor] Fix formatting

8 weeks ago[Conf] Add defaults
Vsevolod Stakhov [Thu, 11 Sep 2025 15:57:31 +0000 (16:57 +0100)] 
[Conf] Add defaults

8 weeks ago[Fix] Fix lua state setting ambiguity
Vsevolod Stakhov [Thu, 11 Sep 2025 15:32:52 +0000 (16:32 +0100)] 
[Fix] Fix lua state setting ambiguity

8 weeks ago[Minor] Optimize timers usage
Vsevolod Stakhov [Thu, 11 Sep 2025 14:34:29 +0000 (15:34 +0100)] 
[Minor] Optimize timers usage

8 weeks ago[Project] Add support of granular timeouts to plugins and maps
Vsevolod Stakhov [Thu, 11 Sep 2025 14:25:43 +0000 (15:25 +0100)] 
[Project] Add support of granular timeouts to plugins and maps

8 weeks ago[Project] Implement more flexible http timeouts
Vsevolod Stakhov [Thu, 11 Sep 2025 13:43:15 +0000 (14:43 +0100)] 
[Project] Implement more flexible http timeouts

Issue: #5611

8 weeks agoMerge pull request #5613 from moisseev/e2e
Vsevolod Stakhov [Thu, 11 Sep 2025 12:22:26 +0000 (18:22 +0600)] 
Merge pull request #5613 from moisseev/e2e

[Test] Relax throughput counter check

8 weeks ago[Minor] Simplify features transition 5608/head
Vsevolod Stakhov [Thu, 11 Sep 2025 11:49:13 +0000 (12:49 +0100)] 
[Minor] Simplify features transition

8 weeks ago[Test] Relax throughput counter check 5613/head
Alexander Moisseev [Thu, 11 Sep 2025 11:16:26 +0000 (14:16 +0300)] 
[Test] Relax throughput counter check

8 weeks ago[Project] Some rework of the CTA defaults
Vsevolod Stakhov [Thu, 11 Sep 2025 09:58:52 +0000 (10:58 +0100)] 
[Project] Some rework of the CTA defaults

8 weeks agoChange model to 'gpt-5-mini' and add model_parameters
hunter-nl [Wed, 10 Sep 2025 14:51:40 +0000 (16:51 +0200)] 
Change model to 'gpt-5-mini' and add model_parameters

Updated model configuration to use 'gpt-5-mini' and added model parameters.

8 weeks agoRefactor model parameters and response handling
hunter-nl [Wed, 10 Sep 2025 14:27:41 +0000 (16:27 +0200)] 
Refactor model parameters and response handling

Model parameters now applied to all models for both AI types.

8 weeks agoMerge branch 'master' into vstakhov-html-features
Vsevolod Stakhov [Tue, 9 Sep 2025 08:03:08 +0000 (14:03 +0600)] 
Merge branch 'master' into vstakhov-html-features

8 weeks ago[Project] Take button weight into consideration
Vsevolod Stakhov [Mon, 8 Sep 2025 17:05:12 +0000 (18:05 +0100)] 
[Project] Take button weight into consideration

8 weeks ago[Project] Add CTA analytics engine
Vsevolod Stakhov [Mon, 8 Sep 2025 16:51:21 +0000 (17:51 +0100)] 
[Project] Add CTA analytics engine

2 months ago[Minor] Fix NULL check
Vsevolod Stakhov [Sat, 6 Sep 2025 13:20:01 +0000 (14:20 +0100)] 
[Minor] Fix NULL check

2 months ago[Minor] Fix build
Vsevolod Stakhov [Sat, 6 Sep 2025 12:56:42 +0000 (13:56 +0100)] 
[Minor] Fix build

2 months ago[Project] Extract more features from HTML messages
Vsevolod Stakhov [Sat, 6 Sep 2025 12:45:02 +0000 (13:45 +0100)] 
[Project] Extract more features from HTML messages

2 months agoMerge pull request #5607 from moisseev/webui 5605/head
Vsevolod Stakhov [Sat, 6 Sep 2025 12:44:50 +0000 (18:44 +0600)] 
Merge pull request #5607 from moisseev/webui

[Minor] Update Bootstrap 5.3.7 → 5.3.8

2 months agoMerge pull request #5606 from moisseev/e2e-scan
Vsevolod Stakhov [Sat, 6 Sep 2025 09:50:49 +0000 (15:50 +0600)] 
Merge pull request #5606 from moisseev/e2e-scan

[Test] Add WebUI E2E scan flow test

2 months ago[Minor] Update Bootstrap 5.3.7 → 5.3.8 5607/head
Alexander Moisseev [Sat, 6 Sep 2025 08:26:33 +0000 (11:26 +0300)] 
[Minor] Update Bootstrap 5.3.7 → 5.3.8

2 months ago[Test] Add WebUI E2E scan flow test 5606/head
Alexander Moisseev [Sun, 31 Aug 2025 14:50:17 +0000 (17:50 +0300)] 
[Test] Add WebUI E2E scan flow test

Covers reading counters before scanning, scanning two test messages,
verifying history, resetting history, and checking updated counters.

2 months ago[Test] Enable history_redis module
Alexander Moisseev [Fri, 5 Sep 2025 17:18:20 +0000 (20:18 +0300)] 
[Test] Enable history_redis module

2 months agoMerge pull request #5604 from rspamd/vstakhov-lua-headers-fold
Vsevolod Stakhov [Fri, 5 Sep 2025 10:55:29 +0000 (16:55 +0600)] 
Merge pull request #5604 from rspamd/vstakhov-lua-headers-fold

Unify folding for the headers

2 months agoMerge pull request #5553 from dragoangel/patch-13
Vsevolod Stakhov [Fri, 5 Sep 2025 10:04:38 +0000 (16:04 +0600)] 
Merge pull request #5553 from dragoangel/patch-13

Disable invalid mime from and rcpt in case of 8bit and enable_mime_utf

2 months ago[Minor] Update plugins that are using headers modifications 5604/head
Vsevolod Stakhov [Fri, 5 Sep 2025 10:00:13 +0000 (11:00 +0100)] 
[Minor] Update plugins that are using headers modifications

2 months ago[Feature] Add lua_util.fold_header_with_encoding
Vsevolod Stakhov [Fri, 5 Sep 2025 09:44:10 +0000 (10:44 +0100)] 
[Feature] Add lua_util.fold_header_with_encoding

2 months agoMerge branch 'master' into dcc 5602/head
Francois Lesueur [Fri, 5 Sep 2025 06:51:09 +0000 (08:51 +0200)] 
Merge branch 'master' into dcc

2 months agolua linter, closer to master code
Francois Lesueur [Fri, 5 Sep 2025 06:47:21 +0000 (08:47 +0200)] 
lua linter, closer to master code

2 months agoMerge pull request #5603 from rspamd/vstakhov-upstream-revive-rework
Vsevolod Stakhov [Thu, 4 Sep 2025 20:23:19 +0000 (02:23 +0600)] 
Merge pull request #5603 from rspamd/vstakhov-upstream-revive-rework

Improve upstream resilience: add probe mode and remove force-revive

2 months ago[Project] Implement backoff for upstreams revival 5603/head
Vsevolod Stakhov [Thu, 4 Sep 2025 16:22:48 +0000 (17:22 +0100)] 
[Project] Implement backoff for upstreams revival

2 months ago[Project] Start to implement better revive strategy for upstreams
Vsevolod Stakhov [Thu, 4 Sep 2025 15:58:40 +0000 (16:58 +0100)] 
[Project] Start to implement better revive strategy for upstreams

2 months agoMerge pull request #5601 from rspamd/vstakhov-dns-resolving
Vsevolod Stakhov [Thu, 4 Sep 2025 15:14:57 +0000 (21:14 +0600)] 
Merge pull request #5601 from rspamd/vstakhov-dns-resolving

[Feature] Resolve DNS nameservers names using getaddrinfo

2 months ago[Minor] Optimise re-resolving for known IPs 5601/head
Vsevolod Stakhov [Thu, 4 Sep 2025 14:58:32 +0000 (15:58 +0100)] 
[Minor] Optimise re-resolving for known IPs

2 months agooutput rep if present
Francois Lesueur [Thu, 4 Sep 2025 08:35:03 +0000 (10:35 +0200)] 
output rep if present

2 months agoMerge pull request #5596 from moisseev/webui
Vsevolod Stakhov [Wed, 3 Sep 2025 18:18:46 +0000 (00:18 +0600)] 
Merge pull request #5596 from moisseev/webui

[Fix] Prevent WebUI crash with empty RRD

2 months agoMerge pull request #5598 from fatalbanana/de_cgp
Vsevolod Stakhov [Wed, 3 Sep 2025 18:15:43 +0000 (00:15 +0600)] 
Merge pull request #5598 from fatalbanana/de_cgp

[Minor] Remove cgp.inc from configuration

2 months ago[Feature] Resolve DNS nameservers names using getaddrinfo
Vsevolod Stakhov [Wed, 3 Sep 2025 17:44:55 +0000 (18:44 +0100)] 
[Feature] Resolve DNS nameservers names using getaddrinfo

2 months agoremove unexpected results
Francois Lesueur [Wed, 3 Sep 2025 15:01:08 +0000 (17:01 +0200)] 
remove unexpected results

2 months agodcc cleanup
Francois Lesueur [Wed, 3 Sep 2025 14:50:05 +0000 (16:50 +0200)] 
dcc cleanup

2 months agoMerge pull request #5600 from flesueur/master
Vsevolod Stakhov [Wed, 3 Sep 2025 12:22:28 +0000 (18:22 +0600)] 
Merge pull request #5600 from flesueur/master

Fix score calculation for dcc  - Fixes #5451

2 months agoFix score calculation for dcc 5600/head
Francois Lesueur [Wed, 3 Sep 2025 08:33:55 +0000 (10:33 +0200)] 
Fix score calculation for dcc

2 months ago[Minor] Remove cgp.inc from configuration 5598/head
Andrew Lewis [Tue, 2 Sep 2025 11:27:46 +0000 (13:27 +0200)] 
[Minor] Remove cgp.inc from configuration

2 months ago[Fix] Prevent WebUI crash with empty RRD 5596/head
Alexander Moisseev [Tue, 2 Sep 2025 10:51:34 +0000 (13:51 +0300)] 
[Fix] Prevent WebUI crash with empty RRD

on Throughput tab switching

2 months agoMerge pull request #5579 from rspamd/vstakhov-neural-rework
Vsevolod Stakhov [Mon, 1 Sep 2025 14:21:05 +0000 (20:21 +0600)] 
Merge pull request #5579 from rspamd/vstakhov-neural-rework

Neural module rework: provider-based feature fusion, LLM embeddings, normalization, and v3 schema

2 months agoMerge pull request #5593 from rspamd/vstakhov-dkim-canon-rework
Vsevolod Stakhov [Sat, 30 Aug 2025 11:46:32 +0000 (17:46 +0600)] 
Merge pull request #5593 from rspamd/vstakhov-dkim-canon-rework

Fix DKIM relaxed body canonicalization and optimize performance

2 months ago[Fix] Fix l= calculations again 5593/head
Vsevolod Stakhov [Fri, 29 Aug 2025 13:57:12 +0000 (14:57 +0100)] 
[Fix] Fix l= calculations again

2 months agoFix DKIM relaxed body canonicalization and optimize performance
Vsevolod Stakhov [Fri, 29 Aug 2025 12:38:01 +0000 (13:38 +0100)] 
Fix DKIM relaxed body canonicalization and optimize performance

This PR addresses critical issues in DKIM relaxed body canonicalization and modernizes the codebase by replacing GLib types with standard C types.

- **RFC Compliance**: Fixed incorrect canonicalization of lines containing only whitespace. Previously, such lines were not properly handled according to RFC 6376, which could lead to DKIM signature verification failures.
- **Memory Safety**: Fixed incorrect pointer dereference in `rspamd_dkim_skip_empty_lines` that could cause undefined behavior.

- **Zero-copy Optimization**: Reimplemented `rspamd_dkim_relaxed_body_step` to avoid unnecessary memory copies. The new implementation:
  - Processes input data directly without intermediate buffers
  - Reduces the number of `EVP_DigestUpdate` calls by processing larger chunks
  - Improves CPU cache efficiency
  - Results in significantly better performance for large email bodies

- Replaced all GLib types with standard C equivalents:
  - `gsize` → `size_t`
  - `gssize` → `ssize_t`
  - `gboolean` → `bool`
  - `TRUE/FALSE` → `true/false`
  - And other GLib-specific types
- Added necessary standard headers (`stdbool.h`, `stdint.h`, `limits.h`)

- Added comprehensive debug logging for:
  - Chunk processing with size information
  - Empty line detection and skipping
  - Space collapsing operations

Issue: #5590

2 months agoMerge pull request #5581 from rekup/fix/dkim-vault
Vsevolod Stakhov [Fri, 29 Aug 2025 09:50:48 +0000 (15:50 +0600)] 
Merge pull request #5581 from rekup/fix/dkim-vault

[Fix] fix error check in lua_dkim_tools.lua

2 months agoMerge pull request #5580 from fatalbanana/rearm_ci
Vsevolod Stakhov [Fri, 29 Aug 2025 09:49:18 +0000 (15:49 +0600)] 
Merge pull request #5580 from fatalbanana/rearm_ci

[Test] Run CI on ARM again

2 months agoMerge pull request #5585 from heptalium/meissner-update-maps
Vsevolod Stakhov [Fri, 29 Aug 2025 09:49:04 +0000 (15:49 +0600)] 
Merge pull request #5585 from heptalium/meissner-update-maps

Update included fallback maps with data from maps.rspamd.com

2 months agoMerge pull request #5592 from arkamar/unify-cxx-standard
Vsevolod Stakhov [Fri, 29 Aug 2025 09:48:31 +0000 (15:48 +0600)] 
Merge pull request #5592 from arkamar/unify-cxx-standard

[Fix] Use C++20 standard consistently to resolve ODR violations

2 months ago[Fix] Use C++20 standard consistently to resolve ODR violations 5592/head
Petr Vaněk [Fri, 29 Aug 2025 08:31:24 +0000 (10:31 +0200)] 
[Fix] Use C++20 standard consistently to resolve ODR violations

This commit resolves an ODR violations when compiling with -flto and
-Werror=odr [1]. The main project used a newer C++20 standard, while the
backward-cpp and simdutf libraries used an older C++11 standard. This
difference caused the linker to fail.

Setting C++20 standard in both libraries resolves the ODR issue.

Link: https://bugs.gentoo.org/962041
2 months ago[Minor] Pet luacheck 5579/head
Vsevolod Stakhov [Thu, 28 Aug 2025 15:44:09 +0000 (16:44 +0100)] 
[Minor] Pet luacheck

2 months ago[Project] Add tests for LLM provider, fix various issues with metatokens
Vsevolod Stakhov [Thu, 28 Aug 2025 15:32:16 +0000 (16:32 +0100)] 
[Project] Add tests for LLM provider, fix various issues with metatokens

2 months ago[Project] Fix various other issues
Vsevolod Stakhov [Thu, 28 Aug 2025 12:57:02 +0000 (13:57 +0100)] 
[Project] Fix various other issues

2 months ago[Project] Rework rspamc to allow training of different neural types
Vsevolod Stakhov [Thu, 28 Aug 2025 11:32:16 +0000 (12:32 +0100)] 
[Project] Rework rspamc to allow training of different neural types

2 months ago[Fix] GPT: Fix occasional damage
Vsevolod Stakhov [Thu, 28 Aug 2025 11:30:54 +0000 (12:30 +0100)] 
[Fix] GPT: Fix occasional damage

2 months agoMerge pull request #5583 from fatalbanana/el10_fix
Vsevolod Stakhov [Thu, 21 Aug 2025 12:01:51 +0000 (18:01 +0600)] 
Merge pull request #5583 from fatalbanana/el10_fix

[Minor] Further RPM changes for EL10

2 months agoUpdate included fallback maps with data from maps.rspamd.com 5585/head
Jens Meißner [Thu, 21 Aug 2025 09:17:47 +0000 (11:17 +0200)] 
Update included fallback maps with data from maps.rspamd.com

2 months ago[Minor] Further RPM changes for EL10 5583/head
Andrew Lewis [Wed, 20 Aug 2025 10:02:12 +0000 (12:02 +0200)] 
[Minor] Further RPM changes for EL10

2 months ago[Fix] fix error check in lua_dkim_tools.lua 5581/head
Reto Kupferschmid [Tue, 19 Aug 2025 16:01:15 +0000 (18:01 +0200)] 
[Fix] fix error check in lua_dkim_tools.lua

2 months ago[Test] Run CI on ARM again 5580/head
Andrew Lewis [Tue, 19 Aug 2025 15:18:48 +0000 (17:18 +0200)] 
[Test] Run CI on ARM again

2 months ago[Project] Add controller learn endpoints
Vsevolod Stakhov [Tue, 19 Aug 2025 12:14:43 +0000 (13:14 +0100)] 
[Project] Add controller learn endpoints

2 months ago[Minor] Move common stuff to a separate function
Vsevolod Stakhov [Mon, 18 Aug 2025 22:07:39 +0000 (23:07 +0100)] 
[Minor] Move common stuff to a separate function

2 months ago[Minor] Don't use coroutines
Vsevolod Stakhov [Mon, 18 Aug 2025 12:58:39 +0000 (13:58 +0100)] 
[Minor] Don't use coroutines

2 months agoNeural module rework: provider-based feature fusion, LLM embeddings, normalization...
Vsevolod Stakhov [Mon, 18 Aug 2025 12:42:53 +0000 (13:42 +0100)] 
Neural module rework: provider-based feature fusion, LLM embeddings, normalization, and v3 schema

This PR evolves the neural module from a symbols-only scorer into a general feature-fusion classifier with pluggable providers. It adds an LLM embedding provider, introduces trained normalization and metadata persistence, and isolates new models via a schema/prefix bump.

- The existing neural module is limited to metatokens and symbols.
- We want to combine multiple feature sources (LLM embeddings now; Bayes/FastText later).
- Ensure consistent train/infer behavior with stored normalization and provider metadata.
- Improve operability with caching, digest checks, and safer rollouts.

- Provider architecture
  - Provider registry and fusion: `collect_features(task, rule)` concatenates provider vectors with optional weights.
  - New LLM provider: `lualib/plugins/neural/providers/llm.lua` using `rspamd_http` and `lua_cache` for Redis-backed embedding caching.
  - Symbols provider extracted: `lualib/plugins/neural/providers/symbols.lua`.
- Normalization and PCA
  - Configurable fusion normalization: none/unit/zscore.
  - Trained normalization stats computed during training and applied at inference.
  - Existing global PCA preserved; loaded/saved alongside ANN.
- Schema and compatibility
  - `plugin_ver` bumped to '3' to isolate from earlier profiles.
  - Redis save/load extended:
    - Profiles include `providers_digest`.
    - ANN hash can include `providers_meta`, `norm_stats`, `pca`, `roc_thresholds`, `ann`.
  - ANN load validates provider digest and skips apply on mismatch.
- Performance and reliability
  - LLM embeddings cached in Redis (content+model keyed).
  - Graceful fallback to symbols if providers not configured or fail.
  - Basic provider configuration validation.

- `lualib/plugins/neural.lua`: provider registry, fusion, normalization helpers, profile digests, training pipeline updates.
- `src/plugins/lua/neural.lua`: integrates fusion into inference/learning, loads new metadata, applies normalization, validates digest.
- `lualib/plugins/neural/providers/llm.lua`: LLM embeddings with Redis cache.
- `lualib/plugins/neural/providers/symbols.lua`: legacy symbols provider wrapper.
- `lualib/redis_scripts/neural_save_unlock.lua`: stores `providers_meta` and `norm_stats` in ANN hash.
- `NEURAL_REWORK_PLAN.md`: design and phased TODO.

- Enable LLM alongside symbols:
```ucl
neural {
  rules {
    default {
      providers = [
        { type = "symbols"; weight = 0.5; },
        { type = "llm"; model = "text-embed-1"; url = "https://api.openai.com/v1/embeddings";
          cache_ttl = 86400; weight = 1.0; }
      ];
      fusion { normalization = "zscore"; }
      roc_enabled = true;
      max_inputs = 256; # optional PCA
    }
  }
}
```
- LLM provider uses `gpt` block for defaults if present (e.g., API key). You can override `model`, `url`, `timeout`, and cache parameters per provider entry.

- Existing (v2) neural profiles remain unaffected (new `plugin_ver = '3'` prefixes).
- New profiles embed `providers_digest`; incompatible provider sets won’t be applied.
- No immediate cleanup required; TTL-based cleanup keeps old keys around until expiry.

- Validated: provider digest checks, ANN load/save roundtrip, normalization application at inference, LLM caching paths, symbols fallback.
- Please test with/without LLM provider and with `fusion.normalization = none|unit|zscore`.

- LLM latency/cost is mitigated by Redis caching; timeouts are configurable per provider.
- Privacy: use trusted endpoints; no content leaves unless configured.
- Failure behavior: missing/failed providers degrade to others; training/inference can proceed with partial features.

- Rules without `providers` continue to use symbols-only behavior.
- Existing command surface unchanged; future PR will introduce `rspamc learn_neural:*` and controller endpoints.

- [x] Provider registry and fusion
- [x] LLM provider with Redis caching
- [x] Symbols provider split
- [x] Normalization (unit/zscore) with trained stats
- [x] Redis schema v3 additions and profile digest
- [x] Inference uses trained normalization
- [x] Basic provider validation and fallbacks
- [x] Plan document
- [ ] Per-provider budgets/metrics and circuit breaker for LLM
- [ ] Expand providers: Bayes and FastText/subword vectors
- [ ] Per-provider PCA and learned fusion
- [ ] New CLI (`rspamc learn_neural`) and status/invalidate endpoints
- [ ] Documentation expansion under `docs/modules/neural.md`