]> source.dussan.org Git - rspamd.git/commitdiff
* Add more debug to comparing parts distance function
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 16 Jul 2010 12:13:43 +0000 (16:13 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 16 Jul 2010 12:13:43 +0000 (16:13 +0400)
* Write action even if message has no symbols

src/expressions.c
src/protocol.c

index 650721b9e28cd03c1fdc4e2d13866c467378ffbf..14ac3d98f719fdb7b6bde327b3e4b2c2c47fe27b 100644 (file)
@@ -924,7 +924,7 @@ rspamd_header_exists (struct worker_task * task, GList * args, void *unused)
 gboolean
 rspamd_parts_distance (struct worker_task * task, GList * args, void *unused)
 {
-       int                             threshold;
+       int                             threshold, diff;
        struct mime_text_part          *p1, *p2;
        GList                          *cur;
        struct expression_argument     *arg;
@@ -952,7 +952,9 @@ rspamd_parts_distance (struct worker_task * task, GList * args, void *unused)
                        return FALSE;
                }
                p2 = cur->data;
-               if (fuzzy_compare_hashes (p1->fuzzy, p2->fuzzy) <= threshold) {
+               diff = fuzzy_compare_hashes (p1->fuzzy, p2->fuzzy);
+               debug_task ("got likeliness between parts of %d%%, threshold is %d%%", diff, threshold);
+               if (diff <= threshold) {
                        return TRUE;
                }
        }
index f4e95b40f8b595453b983150e4b773b279414905..7d26d6c80b6c4d5a41061620f6c8986664aba70e 100644 (file)
@@ -681,9 +681,10 @@ show_metric_result (gpointer metric_name, gpointer metric_value, void *user_data
                        else {
                                r = rspamd_snprintf (outbuf, sizeof (outbuf), "Metric: default; False; 0 / %.2f" CRLF, ms);
                        }
+                       r += rspamd_snprintf (outbuf + r, sizeof (outbuf) - r, "Action: %s" CRLF, str_action_metric (METRIC_ACTION_NOACTION));
                }
         if (!task->is_skipped) {
-                   cd->log_offset += rspamd_snprintf (cd->log_buf + cd->log_offset, cd->log_size - cd->log_offset, "(%s: F: [0/%.2f/%.2f] [", "default", ms, rs);
+                   cd->log_offset += rspamd_snprintf (cd->log_buf + cd->log_offset, cd->log_size - cd->log_offset, "(%s: F (no action): [0/%.2f/%.2f] [", "default", ms, rs);
         }
         else {
                    cd->log_offset += rspamd_snprintf (cd->log_buf + cd->log_offset, cd->log_size - cd->log_offset, "(%s: S: [0/%.2f/%.2f] [", "default", ms, rs);