]> source.dussan.org Git - rspamd.git/commitdiff
* Fix awfull bug in classifying when first statfile has twice weight than second...
authorVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 14 May 2010 13:12:55 +0000 (17:12 +0400)
committerVsevolod Stakhov <vsevolod@rambler-co.ru>
Fri, 14 May 2010 13:12:55 +0000 (17:12 +0400)
* Fix undisclosed recipients detection

conf/lua/regexp/headers.lua
src/classifiers/winnow.c

index b775f72a915d430b6dd6d073ec330e4a924ae434..07f9a785c540f6b8a7e79c5d11122cff7f0108c5 100644 (file)
@@ -33,7 +33,7 @@ reconf['R_BAD_CTE_7BIT'] = string.format('(%s) & (%s) & (%s)', r_ctype_text, r_c
 reconf['MISSING_TO']= '!header_exists(To)';
 
 -- Detects undisclosed recipients
-local undisc_rcpt = 'To=/^<?undisclosed-recipient/Hi'
+local undisc_rcpt = 'To=/^<?undisclosed[- ]recipient/Hi'
 reconf['R_UNDISC_RCPT'] = string.format('(%s) | (%s)', reconf['MISSING_TO'], undisc_rcpt)
 
 -- Detects missing Message-Id
index f1551fb6ef563cf8d46ba53671631536d5a447ef..a5e7b3cf8bb3e424ba35df0445e772efed5946da 100644 (file)
@@ -138,8 +138,6 @@ winnow_classify (struct classifier_ctx *ctx, statfile_pool_t * pool, GTree * inp
        g_assert (ctx != NULL);
 
        data.pool = pool;
-       data.sum = 0;
-       data.count = 0;
        data.now = time (NULL);
        data.ctx = ctx;
     
@@ -167,6 +165,8 @@ winnow_classify (struct classifier_ctx *ctx, statfile_pool_t * pool, GTree * inp
     }
        while (cur) {
                st = cur->data;
+               data.sum = 0;
+               data.count = 0;
                if ((data.file = statfile_pool_is_open (pool, st->path)) == NULL) {
                        if ((data.file = statfile_pool_open (pool, st->path, st->size, FALSE)) == NULL) {
                                msg_warn ("cannot open %s, skip it", st->path);