summaryrefslogtreecommitdiffstats
path: root/src/libmime/message.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmime/message.c')
-rw-r--r--src/libmime/message.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c
index a07cb6c8d..cb85a512b 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -34,6 +34,7 @@
#include <math.h>
#include <unicode/uchar.h>
+#include <src/libserver/cfg_file_private.h>
#define GTUBE_SYMBOL "GTUBE"
@@ -883,23 +884,23 @@ rspamd_message_process_text_part_maybe (struct rspamd_task *task,
act = rspamd_check_gtube (task, text_part);
if (act != METRIC_ACTION_NOACTION) {
- struct rspamd_metric_result *mres = task->result;
+ struct rspamd_action *action;
gdouble score = NAN;
- if (act == METRIC_ACTION_REJECT) {
- score = rspamd_task_get_required_score (task, mres);
- }
- else {
- score = mres->actions_limits[act];
- }
+ action = rspamd_config_get_action_by_type (task->cfg, act);
- rspamd_add_passthrough_result (task, act, RSPAMD_PASSTHROUGH_CRITICAL,
- score, "Gtube pattern", "GTUBE");
+ if (action) {
+ score = action->threshold;
- if (ucl_object_lookup (task->messages, "smtp_message") == NULL) {
- ucl_object_replace_key (task->messages,
- ucl_object_fromstring ("Gtube pattern"), "smtp_message", 0,
- false);
+ rspamd_add_passthrough_result (task, action,
+ RSPAMD_PASSTHROUGH_CRITICAL,
+ score, "Gtube pattern", "GTUBE");
+
+ if (ucl_object_lookup (task->messages, "smtp_message") == NULL) {
+ ucl_object_replace_key (task->messages,
+ ucl_object_fromstring ("Gtube pattern"),
+ "smtp_message", 0, false);
+ }
}
rspamd_task_insert_result (task, GTUBE_SYMBOL, 0, NULL);