From: Vsevolod Stakhov Date: Sat, 31 Jul 2010 15:22:33 +0000 (+0400) Subject: * Output message id in rspamc reply X-Git-Tag: 0.3.2~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2efbf8d0cbe6c3cc3fa97a2c80d0887a87b5a2a5;p=thirdparty%2Frspamd.git * Output message id in rspamc reply --- diff --git a/src/protocol.c b/src/protocol.c index 297aaa9226..63b1bee5b5 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -519,7 +519,7 @@ show_url_header (struct worker_task *task) c = *(host.begin + host.len); *(host.begin + host.len) = '\0'; debug_task ("write url: %s", host.begin); - r += rspamd_snprintf (outbuf + r, sizeof (outbuf) - r, "%s" CRLF, host.begin); + r += rspamd_snprintf (outbuf + r, sizeof (outbuf) - r, "%s", host.begin); *(host.begin + host.len) = c; } } @@ -528,6 +528,8 @@ show_url_header (struct worker_task *task) if (r == 0) { return TRUE; } + r += rspamd_snprintf (outbuf + r, sizeof (outbuf) - r, CRLF); + return rspamd_dispatcher_write (task->dispatcher, outbuf, r, FALSE, FALSE); } @@ -883,8 +885,11 @@ write_check_reply (struct worker_task *task) write_hashes_to_log (task, logbuf, cd.log_offset, cd.log_size); msg_info ("%s", logbuf); - if (! rspamd_dispatcher_write (task->dispatcher, CRLF, sizeof (CRLF) - 1, FALSE, TRUE)) { - return FALSE; + if (task->proto_ver >= 12) { + r = rspamd_snprintf (outbuf, sizeof (outbuf), "Message-ID: %s" CRLF CRLF, task->message_id); + if (! rspamd_dispatcher_write (task->dispatcher, outbuf, r, FALSE, FALSE)) { + return FALSE; + } } task->worker->srv->stat->messages_scanned++;