]> source.dussan.org Git - rspamd.git/commitdiff
Fix output for spamc proto.
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 15 Aug 2011 13:59:52 +0000 (17:59 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Mon, 15 Aug 2011 13:59:52 +0000 (17:59 +0400)
contrib/exim/patch-exim-src_spam.c.diff
src/protocol.c

index 1109874b51dbf1e4b504c12b09aa6e52750468b2..7bae65741eb3cb8f8baa552f2574050baa3efa0f 100644 (file)
@@ -48,7 +48,7 @@
  
    /* dig in the spamd output and put the report in a multiline header, if requested */
 -  if( sscanf(CS spamd_buffer,"SPAMD/%7s 0 EX_OK\r\nContent-length: %*u\r\n\r\n%lf/%lf\r\n%n",
-+  if( sscanf(CS spamd_buffer,"SPAMD/%7s 0 EX_OK\r\n\r\nSpam: %*s ; %lf / %lf\r\nContent-length: %*u\r\n\r\n%n",
++  if( sscanf(CS spamd_buffer,"SPAMD/%7s 0 EX_OK\r\nSpam: %*s ; %lf / %lf\r\nContent-length: %*u\r\n\r\n%n",
               spamd_version,&spamd_score,&spamd_threshold,&spamd_report_offset) != 3 ) {
  
      /* try to fall back to pre-2.50 spamd output */
index c70cae16bcbfe3b897a681a3c031ea2a24c84f63..fe9621e21aa9037732d6d993cbc2aa5774e1a511 100644 (file)
@@ -969,7 +969,7 @@ print_metric_data_rspamc (struct worker_task *task, gchar *outbuf, gsize size,
        if (metric_res == NULL) {
                if (task->proto == SPAMC_PROTO) {
                        r = rspamd_snprintf (outbuf, size,
-                                       "Spam: False ; 0 / %.2f" CRLF, ms);
+                                       "Spam: False ; 0.00 / %.2f" CRLF, ms);
                }
                else {
                        if (task->proto_ver >= 11) {
@@ -1106,6 +1106,10 @@ show_metric_result (gpointer metric_name, gpointer metric_value, void *user_data
                        ms = m->required_score;
                        rs = m->reject_score;
                }
+               else if (metric_res == NULL) {
+                       ms = m->required_score;
+                       rs = m->reject_score;
+               }
 
                if (!task->is_json) {
                        r = print_metric_data_rspamc (task, outbuf, sizeof (outbuf), NULL, m, ms, rs, action);