GString *out)
{
const ucl_object_t *metric, *score,
- *required_score, *is_spam, *elt;
+ *required_score, *is_spam, *elt, *cur;
ucl_object_iter_t iter = NULL;
metric = ucl_object_find_key (top, DEFAULT_METRIC);
ucl_object_tostring (elt));
}
}
+
+ elt = ucl_object_find_key (top, "messages");
+ if (elt != NULL) {
+ iter = NULL;
+ while ((cur = ucl_iterate_object (elt, &iter, true)) != NULL) {
+ if (cur->type == UCL_STRING) {
+ g_string_append_printf (out, "Message: %s\r\n",
+ ucl_object_tostring (cur));
+ }
+ }
+ }
+
g_string_append_printf (out, "Message-ID: %s\r\n", task->message_id);
}
ucl_object_insert_key (top, obj, h, 0, false);
}
- if (task->pre_result.str != NULL) {
- ucl_object_insert_key (top, ucl_object_fromstring (task->pre_result.str),
- "reason", 0, false);
- }
-
if (task->messages != NULL) {
ucl_object_insert_key (top, rspamd_str_list_ucl (
task->messages), "messages", 0, false);
action_str = rspamd_mempool_strdup (task->task_pool,
luaL_checkstring (L, 3));
task->pre_result.str = action_str;
+ task->messages = g_list_prepend (task->messages, action_str);
}
else {
task->pre_result.str = "unknown";