aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rspamd.com>2024-09-05 13:42:08 +0100
committerVsevolod Stakhov <vsevolod@rspamd.com>2024-09-05 13:42:08 +0100
commit4375176d87c8da705dd40cef763c75e6fa716242 (patch)
treecffbe4e8b9b1edcf9d0f69a4194e1d7ab82ee03a /src/plugins
parent7d355135c9aba53676e974b5a91a06f2da327de8 (diff)
downloadrspamd-4375176d87c8da705dd40cef763c75e6fa716242.tar.gz
rspamd-4375176d87c8da705dd40cef763c75e6fa716242.zip
[Minor] Add `encryption_required` symbol
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/fuzzy_check.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/fuzzy_check.c b/src/plugins/fuzzy_check.c
index dd2347f19..6ca6f3459 100644
--- a/src/plugins/fuzzy_check.c
+++ b/src/plugins/fuzzy_check.c
@@ -51,6 +51,7 @@
#define DEFAULT_SYMBOL "R_FUZZY_HASH"
#define RSPAMD_FUZZY_SYMBOL_FORBIDDEN "FUZZY_FORBIDDEN"
#define RSPAMD_FUZZY_SYMBOL_RATELIMITED "FUZZY_RATELIMITED"
+#define RSPAMD_FUZZY_SYMBOL_ENCRYPTION_REQUIRED "FUZZY_ENCRYPTION_REQUIRED"
#define DEFAULT_IO_TIMEOUT 1.0
#define DEFAULT_RETRANSMITS 3
@@ -1180,6 +1181,18 @@ int fuzzy_check_module_config(struct rspamd_config *cfg, bool validate)
0,
1,
1);
+ rspamd_symcache_add_symbol(cfg->cache,
+ RSPAMD_FUZZY_SYMBOL_ENCRYPTION_REQUIRED, 0, NULL, NULL,
+ SYMBOL_TYPE_VIRTUAL,
+ cb_id);
+ rspamd_config_add_symbol(cfg,
+ RSPAMD_FUZZY_SYMBOL_ENCRYPTION_REQUIRED,
+ 0.0,
+ "Fuzzy encryption is required by a server",
+ "fuzzy",
+ 0,
+ 1,
+ 1);
/*
* Here we can have 2 possibilities:
@@ -2514,6 +2527,7 @@ fuzzy_check_try_read(struct fuzzy_client_session *session)
}
}
else if (rep->v1.value == 403) {
+ /* In fact, it should be 429, but we preserve compatibility */
rspamd_task_insert_result(task, RSPAMD_FUZZY_SYMBOL_RATELIMITED, 1.0,
session->rule->name);
}
@@ -2521,6 +2535,10 @@ fuzzy_check_try_read(struct fuzzy_client_session *session)
rspamd_task_insert_result(task, RSPAMD_FUZZY_SYMBOL_FORBIDDEN, 1.0,
session->rule->name);
}
+ else if (rep->v1.value == 415) {
+ rspamd_task_insert_result(task, RSPAMD_FUZZY_SYMBOL_ENCRYPTION_REQUIRED, 1.0,
+ session->rule->name);
+ }
else if (rep->v1.value == 401) {
if (cmd->cmd != FUZZY_CHECK) {
msg_info_task(