aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-09-23 16:57:38 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-09-23 16:57:38 +0100
commitc132cd323144a4977d2df16b4d180008663a88cd (patch)
treea6b672bbe1df47d920b97021a497afeaf625fe50 /src/libserver
parenta59114820efe8abfc606da71b8e94c1759ceedab (diff)
downloadrspamd-c132cd323144a4977d2df16b4d180008663a88cd.tar.gz
rspamd-c132cd323144a4977d2df16b4d180008663a88cd.zip
Use messages for pre-results.
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/protocol.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index 7dadc65ec..726da9118 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -725,7 +725,7 @@ rspamd_ucl_tolegacy_output (struct rspamd_task *task,
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);
@@ -761,6 +761,18 @@ rspamd_ucl_tolegacy_output (struct rspamd_task *task,
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);
}
@@ -809,11 +821,6 @@ rspamd_protocol_http_reply (struct rspamd_http_message *msg,
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);