aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libmime/message.c10
-rw-r--r--src/lua/lua_task.c2
2 files changed, 8 insertions, 4 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c
index 333748d16..7c0429c3c 100644
--- a/src/libmime/message.c
+++ b/src/libmime/message.c
@@ -835,9 +835,13 @@ rspamd_message_process_text_part (struct rspamd_task *task,
task->result = mres;
task->pre_result.action = act;
task->pre_result.str = "Gtube pattern";
- ucl_object_insert_key (task->messages,
- ucl_object_fromstring ("Gtube pattern"), "smtp_message", 0,
- false);
+
+ 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);
return;
diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c
index ca10a94e7..944ab9dbd 100644
--- a/src/lua/lua_task.c
+++ b/src/lua/lua_task.c
@@ -1519,7 +1519,7 @@ lua_task_set_pre_result (lua_State * L)
action_str = rspamd_mempool_strdup (task->task_pool,
luaL_checkstring (L, 3));
task->pre_result.str = action_str;
- ucl_object_insert_key (task->messages,
+ ucl_object_replace_key (task->messages,
ucl_object_fromstring (action_str), "smtp_message", 0,
false);
}