aboutsummaryrefslogtreecommitdiffstats
path: root/src/libmime
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmime')
-rw-r--r--src/libmime/protocol.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libmime/protocol.c b/src/libmime/protocol.c
index 52336c81c..69d849d52 100644
--- a/src/libmime/protocol.c
+++ b/src/libmime/protocol.c
@@ -780,8 +780,10 @@ rspamd_protocol_write_reply (struct rspamd_task *task)
top = ucl_object_typed_new (UCL_OBJECT);
debug_task ("writing reply to client");
if (task->error_code != 0) {
- msg->code = task->error_code;
- ucl_object_insert_key (top, ucl_object_fromstring (task->last_error), "error", 0, false);
+ msg->code = 500 + task->error_code % 100;
+ msg->status = g_string_new (task->last_error);
+ ucl_object_insert_key (top, ucl_object_fromstring (task->last_error),
+ "error", 0, false);
msg->body = g_string_sized_new (256);
rspamd_ucl_emit_gstring (top, UCL_EMIT_JSON_COMPACT, msg->body);
ucl_object_unref (top);