]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Properly set priority for rules with negative score
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 4 Mar 2016 13:19:58 +0000 (13:19 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 4 Mar 2016 13:19:58 +0000 (13:19 +0000)
src/lua/lua_config.c

index 96b192905ffb051c02ab3ec3bf7b0000288f926a..dd16710932822f001038e5564a475b5b59f53086 100644 (file)
@@ -1034,6 +1034,10 @@ rspamd_register_symbol_fromlua (lua_State *L,
        cd->L = L;
        cd->symbol = rspamd_mempool_strdup (cfg->cfg_pool, name);
 
+       if (priority == 0 && weight < 0) {
+               priority = 1;
+       }
+
        ret = rspamd_symbols_cache_add_symbol (cfg->cache,
                        name,
                        priority,