git: 10a6f99f5955 - main - mail/rspamd: Update to 3.11.1

From: Vsevolod Stakhov <vsevolod_at_FreeBSD.org>
Date: Mon, 10 Mar 2025 15:02:04 UTC
The branch main has been updated by vsevolod:

URL: https://cgit.FreeBSD.org/ports/commit/?id=10a6f99f59553c16a04a2d3c2b60acbca5fb86bd

commit 10a6f99f59553c16a04a2d3c2b60acbca5fb86bd
Author:     Vsevolod Stakhov <vsevolod@FreeBSD.org>
AuthorDate: 2025-03-10 15:01:16 +0000
Commit:     Vsevolod Stakhov <vsevolod@FreeBSD.org>
CommitDate: 2025-03-10 15:01:44 +0000

    mail/rspamd: Update to 3.11.1
    
    Release changes:        https://github.com/rspamd/rspamd/releases/tag/3.11.1
---
 mail/rspamd/Makefile                            |   3 +-
 mail/rspamd/distinfo                            |   6 +-
 mail/rspamd/files/patch-bundle_libfmt           | 391 ++++++++++++++++++++++++
 mail/rspamd/files/patch-contrib_xxhash_xxhash.h |   4 +-
 mail/rspamd/files/patch-src_rspamd.c            |  29 --
 mail/rspamd/pkg-plist                           |   2 +
 6 files changed, 399 insertions(+), 36 deletions(-)

diff --git a/mail/rspamd/Makefile b/mail/rspamd/Makefile
index ada87612a07c..2accb51be825 100644
--- a/mail/rspamd/Makefile
+++ b/mail/rspamd/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	rspamd
-PORTVERSION=	3.11.0
-PORTREVISION=	1
+PORTVERSION=	3.11.1
 CATEGORIES=	mail
 
 MAINTAINER=	vsevolod@FreeBSD.org
diff --git a/mail/rspamd/distinfo b/mail/rspamd/distinfo
index f2bdcc1666d2..9522a7724533 100644
--- a/mail/rspamd/distinfo
+++ b/mail/rspamd/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1734363357
-SHA256 (rspamd-rspamd-3.11.0_GH0.tar.gz) = 6dbe6fc7df4079a64f59cd6e8e996400d02d946d808140a1f30060cea76088a6
-SIZE (rspamd-rspamd-3.11.0_GH0.tar.gz) = 6440612
+TIMESTAMP = 1741617534
+SHA256 (rspamd-rspamd-3.11.1_GH0.tar.gz) = 09c3b90397142539052c826763de4ed8c502976843b5ea9d7ebdc603e23d253b
+SIZE (rspamd-rspamd-3.11.1_GH0.tar.gz) = 6455199
diff --git a/mail/rspamd/files/patch-bundle_libfmt b/mail/rspamd/files/patch-bundle_libfmt
new file mode 100644
index 000000000000..bd3ef595dcf3
--- /dev/null
+++ b/mail/rspamd/files/patch-bundle_libfmt
@@ -0,0 +1,391 @@
+diff --git CMakeLists.txt CMakeLists.txt
+index 882a3a88a2..f3fa193cc8 100644
+--- CMakeLists.txt
++++ CMakeLists.txt
+@@ -63,7 +63,6 @@ OPTION(ENABLE_LUA_REPL "Enables Lua repl (requires C++11 compiler) [default: ON]
+ OPTION(ENABLE_FASTTEXT "Link with FastText library [default: OFF]" OFF)
+ OPTION(ENABLE_BACKWARD "Build rspamd with backward-cpp stacktrace [default: ON]" ON)
+ OPTION(SYSTEM_ZSTD "Use system zstd instead of bundled one [default: OFF]" OFF)
+-OPTION(SYSTEM_FMT "Use system fmt instead of bundled one [default: OFF]" OFF)
+ OPTION(SYSTEM_DOCTEST "Use system doctest instead of bundled one [default: OFF]" OFF)
+ OPTION(SYSTEM_XXHASH "Use system xxhash instead of bundled one [default: OFF]" OFF)
+ 
+@@ -655,11 +654,6 @@ IF (BACKWARD_LIBRARIES)
+     message(STATUS "Backward-cpp libraries: ${BACKWARD_LIBRARIES}")
+ ENDIF ()
+ 
+-IF (SYSTEM_FMT MATCHES "OFF")
+-    INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/contrib/fmt/include")
+-ELSE ()
+-    find_package(fmt)
+-ENDIF ()
+ IF (SYSTEM_DOCTEST MATCHES "OFF")
+     ADD_SUBDIRECTORY(contrib/doctest)
+     INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/contrib/doctest")
+diff --git src/client/rspamc.cxx src/client/rspamc.cxx
+index 31a4aaf241..4043598773 100644
+--- src/client/rspamc.cxx
++++ src/client/rspamc.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -35,8 +35,8 @@
+ 
+ #include "frozen/string.h"
+ #include "frozen/unordered_map.h"
+-#include "fmt/format.h"
+-#include "fmt/color.h"
++#include "contrib/fmt/include/fmt/format.h"
++#include "contrib/fmt/include/fmt/color.h"
+ #include "libutil/cxx/file_util.hxx"
+ #include "libutil/cxx/util.hxx"
+ 
+diff --git src/libmime/lang_detection_fasttext.cxx src/libmime/lang_detection_fasttext.cxx
+index 89916151f3..8ea2706e66 100644
+--- src/libmime/lang_detection_fasttext.cxx
++++ src/libmime/lang_detection_fasttext.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -20,7 +20,7 @@
+ #include "fasttext/fasttext.h"
+ #include "libserver/cfg_file.h"
+ #include "libserver/logger.h"
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ #include "stat_api.h"
+ #include <exception>
+ #include <string_view>
+diff --git src/libserver/backtrace.cxx src/libserver/backtrace.cxx
+index c24e619369..5ebde677ed 100644
+--- src/libserver/backtrace.cxx
++++ src/libserver/backtrace.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -19,7 +19,7 @@
+ #ifdef BACKWARD_ENABLE
+ 
+ #include "contrib/backward-cpp/backward.hpp"
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ #include "logger.h"
+ 
+ namespace rspamd {
+diff --git src/libserver/cfg_rcl.cxx src/libserver/cfg_rcl.cxx
+index 6ea8945abc..f383669080 100644
+--- src/libserver/cfg_rcl.cxx
++++ src/libserver/cfg_rcl.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -34,7 +34,7 @@
+ #include <algorithm>// for std::transform
+ #include <memory>
+ #include "contrib/ankerl/unordered_dense.h"
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ #include "libutil/cxx/util.hxx"
+ #include "libutil/cxx/file_util.hxx"
+ #include "frozen/unordered_set.h"
+diff --git src/libserver/cfg_utils.cxx src/libserver/cfg_utils.cxx
+index 9612cdae46..dfbdc6bee2 100644
+--- src/libserver/cfg_utils.cxx
++++ src/libserver/cfg_utils.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -65,7 +65,7 @@
+ #include <string>
+ #include <string_view>
+ #include <vector>
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ #include "cxx/util.hxx"
+ #include "frozen/unordered_map.h"
+ #include "frozen/string.h"
+diff --git src/libserver/css/css_parser.cxx src/libserver/css/css_parser.cxx
+index 11fa830f07..ade499ba40 100644
+--- src/libserver/css/css_parser.cxx
++++ src/libserver/css/css_parser.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -20,7 +20,7 @@
+ #include "css_rule.hxx"
+ #include "css_util.hxx"
+ #include "css.hxx"
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ 
+ #include <vector>
+ #include <unicode/utf8.h>
+diff --git src/libserver/css/css_selector.cxx src/libserver/css/css_selector.cxx
+index d2ae093cbb..527b123774 100644
+--- src/libserver/css/css_selector.cxx
++++ src/libserver/css/css_selector.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -17,7 +17,7 @@
+ #include "css_selector.hxx"
+ #include "css.hxx"
+ #include "libserver/html/html.hxx"
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ #define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL
+ #include "doctest/doctest.h"
+ 
+diff --git src/libserver/css/css_value.cxx src/libserver/css/css_value.cxx
+index f2ff553638..52a61d3b64 100644
+--- src/libserver/css/css_value.cxx
++++ src/libserver/css/css_value.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -20,7 +20,7 @@
+ #include "frozen/string.h"
+ #include "libutil/util.h"
+ #include "contrib/ankerl/unordered_dense.h"
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ 
+ #define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL
+ #include "doctest/doctest.h"
+diff --git src/libserver/html/html.cxx src/libserver/html/html.cxx
+index 0fe31c2a30..93d1fdf91b 100644
+--- src/libserver/html/html.cxx
++++ src/libserver/html/html.cxx
+@@ -1,11 +1,11 @@
+-/*-
+- * Copyright 2021 Vsevolod Stakhov
++/*
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+  * You may obtain a copy of the License at
+  *
+- *   http://www.apache.org/licenses/LICENSE-2.0
++ *    http://www.apache.org/licenses/LICENSE-2.0
+  *
+  * Unless required by applicable law or agreed to in writing, software
+  * distributed under the License is distributed on an "AS IS" BASIS,
+@@ -35,9 +35,9 @@
+ #include "html_tag.hxx"
+ #include "html_url.hxx"
+ 
+-#include <frozen/unordered_map.h>
+-#include <frozen/string.h>
+-#include <fmt/core.h>
++#include "contrib/frozen/include/frozen/unordered_map.h"
++#include "contrib/frozen/include/frozen/string.h"
++#include "contrib/fmt/include/fmt/core.h"
+ 
+ #include <unicode/uversion.h>
+ 
+diff --git src/libserver/html/html_tests.cxx src/libserver/html/html_tests.cxx
+index 00595feaaa..3be836a2d5 100644
+--- src/libserver/html/html_tests.cxx
++++ src/libserver/html/html_tests.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -19,7 +19,7 @@
+ #include "libserver/task.h"
+ 
+ #include <vector>
+-#include <fmt/core.h>
++#include "contrib/fmt/include/fmt/core.h"
+ 
+ 
+ #define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL
+diff --git src/libserver/hyperscan_tools.cxx src/libserver/hyperscan_tools.cxx
+index 5035bee2c6..75863bf39b 100644
+--- src/libserver/hyperscan_tools.cxx
++++ src/libserver/hyperscan_tools.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -21,7 +21,7 @@
+ #include <filesystem>
+ #include "contrib/ankerl/unordered_dense.h"
+ #include "contrib/ankerl/svector.h"
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ #include "libutil/cxx/file_util.hxx"
+ #include "libutil/cxx/error.hxx"
+ #include "hs.h"
+diff --git src/libserver/symcache/symcache_impl.cxx src/libserver/symcache/symcache_impl.cxx
+index 7159555d2c..4d17348c20 100644
+--- src/libserver/symcache/symcache_impl.cxx
++++ src/libserver/symcache/symcache_impl.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -21,7 +21,7 @@
+ #include "unix-std.h"
+ #include "libutil/cxx/file_util.hxx"
+ #include "libutil/cxx/util.hxx"
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ #include "contrib/t1ha/t1ha.h"
+ 
+ #ifdef __has_include
+diff --git src/libserver/symcache/symcache_item.cxx src/libserver/symcache/symcache_item.cxx
+index 233e8113aa..f58332ea5f 100644
+--- src/libserver/symcache/symcache_item.cxx
++++ src/libserver/symcache/symcache_item.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -17,7 +17,7 @@
+ #include "lua/lua_common.h"
+ #include "symcache_internal.hxx"
+ #include "symcache_item.hxx"
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ #include "libserver/task.h"
+ #include "libutil/cxx/util.hxx"
+ #include <numeric>
+diff --git src/libstat/backends/cdb_backend.cxx src/libstat/backends/cdb_backend.cxx
+index bd05e8ef8c..0f55a725c4 100644
+--- src/libstat/backends/cdb_backend.cxx
++++ src/libstat/backends/cdb_backend.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -28,7 +28,7 @@
+ #include <optional>
+ #include "contrib/expected/expected.hpp"
+ #include "contrib/ankerl/unordered_dense.h"
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ 
+ namespace rspamd::stat::cdb {
+ 
+diff --git src/libstat/backends/redis_backend.cxx src/libstat/backends/redis_backend.cxx
+index 06842b078f..7137904e99 100644
+--- src/libstat/backends/redis_backend.cxx
++++ src/libstat/backends/redis_backend.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -19,7 +19,7 @@
+ #include "stat_internal.h"
+ #include "upstream.h"
+ #include "libserver/mempool_vars_internal.h"
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ 
+ #include "libutil/cxx/error.hxx"
+ 
+diff --git src/libutil/cxx/file_util.cxx src/libutil/cxx/file_util.cxx
+index 2f031f076e..bc5dcdf3ba 100644
+--- src/libutil/cxx/file_util.cxx
++++ src/libutil/cxx/file_util.cxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2023 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -14,7 +14,7 @@
+  * limitations under the License.
+  */
+ #include "file_util.hxx"
+-#include <fmt/core.h>
++#include "contrib/fmt/include/fmt/core.h"
+ #include "libutil/util.h"
+ #include "libutil/unix-std.h"
+ 
+diff --git src/lua/lua_shingles.cxx src/lua/lua_shingles.cxx
+index 4682ef74f5..7d4b277fc4 100644
+--- src/lua/lua_shingles.cxx
++++ src/lua/lua_shingles.cxx
+@@ -17,7 +17,7 @@
+ #include "lua_common.h"
+ #include "lua_classnames.h"
+ #include "shingles.h"
+-#include "fmt/format.h"
++#include "contrib/fmt/include/fmt/format.h"
+ 
+ /***
+  * @module rspamd_shingle
+diff --git test/rspamd_cxx_unit_dkim.hxx test/rspamd_cxx_unit_dkim.hxx
+index d445c3800d..d501aaedd8 100644
+--- test/rspamd_cxx_unit_dkim.hxx
++++ test/rspamd_cxx_unit_dkim.hxx
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright 2024 Vsevolod Stakhov
++ * Copyright 2025 Vsevolod Stakhov
+  *
+  * Licensed under the Apache License, Version 2.0 (the "License");
+  * you may not use this file except in compliance with the License.
+@@ -21,7 +21,7 @@
+ 
+ #define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL
+ #include "doctest/doctest.h"
+-#include "fmt/base.h"
++#include "contrib/fmt/include/fmt/base.h"
+ #include "libserver/dkim.h"
+ 
+ #include <vector>
diff --git a/mail/rspamd/files/patch-contrib_xxhash_xxhash.h b/mail/rspamd/files/patch-contrib_xxhash_xxhash.h
index ffd646edb20a..c067d2871d27 100644
--- a/mail/rspamd/files/patch-contrib_xxhash_xxhash.h
+++ b/mail/rspamd/files/patch-contrib_xxhash_xxhash.h
@@ -1,6 +1,6 @@
---- contrib/xxhash/xxhash.h.orig	2021-03-31 12:18:19 UTC
+--- contrib/xxhash/xxhash.h.orig	2024-12-16 14:04:14 UTC
 +++ contrib/xxhash/xxhash.h
-@@ -2409,6 +2409,7 @@ XXH_PUBLIC_API XXH64_hash_t XXH64_hashFromCanonical(co
+@@ -3062,6 +3062,7 @@ enum XXH_VECTOR_TYPE /* fake enum */ {
  #    if defined(__GNUC__) && !defined(__APPLE_ALTIVEC__)
  #      define __APPLE_ALTIVEC__
  #    endif
diff --git a/mail/rspamd/files/patch-src_rspamd.c b/mail/rspamd/files/patch-src_rspamd.c
deleted file mode 100644
index 9b40b9da918e..000000000000
--- a/mail/rspamd/files/patch-src_rspamd.c
+++ /dev/null
@@ -1,29 +0,0 @@
-From ccb45df90df60fae36b9438cfb2b0088e590306b Mon Sep 17 00:00:00 2001
-From: Vsevolod Stakhov <vsevolod@rspamd.com>
-Date: Tue, 17 Dec 2024 13:37:54 +0000
-Subject: [PATCH] [Fix] Fix crash on FreeBSD when Rspamd is built without
- hyperscan
-
----
- src/rspamd.c | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git src/rspamd.c src/rspamd.c
-index 088bfba49..dafd9aebe 100644
---- src/rspamd.c
-+++ src/rspamd.c
-@@ -56,9 +56,10 @@
- 
- #ifdef WITH_HYPERSCAN
- #include "libserver/hyperscan_tools.h"
--#include "rspamd_simdutf.h"
- #endif
- 
-+#include "rspamd_simdutf.h"
-+
- /* 2 seconds to fork new process in place of dead one */
- #define SOFT_FORK_TIME 2
- 
--- 
-2.47.1
-
diff --git a/mail/rspamd/pkg-plist b/mail/rspamd/pkg-plist
index f97e58fd1abd..7982c06703a7 100644
--- a/mail/rspamd/pkg-plist
+++ b/mail/rspamd/pkg-plist
@@ -164,6 +164,7 @@ share/man/man8/rspamd.8.gz
 %%DATADIR%%/lualib/lpegre.lua
 %%DATADIR%%/lualib/lua_auth_results.lua
 %%DATADIR%%/lualib/lua_aws.lua
+%%DATADIR%%/lualib/lua_cache.lua
 %%DATADIR%%/lualib/lua_bayes_learn.lua
 %%DATADIR%%/lualib/lua_bayes_redis.lua
 %%DATADIR%%/lualib/lua_cfg_transform.lua
@@ -335,6 +336,7 @@ share/man/man8/rspamd.8.gz
 %%DATADIR%%/rules/regexp/headers.lua
 %%DATADIR%%/rules/regexp/misc.lua
 %%DATADIR%%/rules/regexp/upstream_spam_filters.lua
+%%DATADIR%%/rules/regexp/urls.lua
 %%DATADIR%%/rules/rspamd.lua
 %%DATADIR%%/rules/subject_checks.lua
 %%DATADIR%%/www/README.md