aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/protocol.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libserver/protocol.c')
-rw-r--r--src/libserver/protocol.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
index d314d3fdc..a48de05dc 100644
--- a/src/libserver/protocol.c
+++ b/src/libserver/protocol.c
@@ -873,9 +873,8 @@ rspamd_metric_result_ucl (struct rspamd_task *task,
return obj;
}
-static void
-rspamd_ucl_torspamc_output (struct rspamd_task *task,
- ucl_object_t *top,
+void
+rspamd_ucl_torspamc_output (const ucl_object_t *top,
rspamd_fstring_t **out)
{
const ucl_object_t *metric, *score,
@@ -927,12 +926,15 @@ rspamd_ucl_torspamc_output (struct rspamd_task *task,
}
}
- rspamd_printf_fstring (out, "Message-ID: %s\r\n", task->message_id);
+ elt = ucl_object_lookup (top, "message-id");
+ if (elt != NULL) {
+ rspamd_printf_fstring (out, "Message-ID: %s\r\n",
+ ucl_object_tostring (elt));
+ }
}
static void
-rspamd_ucl_tospamc_output (struct rspamd_task *task,
- ucl_object_t *top,
+rspamd_ucl_tospamc_output (const ucl_object_t *top,
rspamd_fstring_t **out)
{
const ucl_object_t *metric, *score,
@@ -1055,10 +1057,10 @@ rspamd_protocol_http_reply (struct rspamd_http_message *msg,
}
else {
if (RSPAMD_TASK_IS_SPAMC (task)) {
- rspamd_ucl_tospamc_output (task, top, &msg->body);
+ rspamd_ucl_tospamc_output (top, &msg->body);
}
else {
- rspamd_ucl_torspamc_output (task, top, &msg->body);
+ rspamd_ucl_torspamc_output (top, &msg->body);
}
}