From: Andrew Lewis Date: Sat, 2 Jan 2016 21:41:47 +0000 (+0200) Subject: SURBL: Allow fallthrough to default symbol X-Git-Tag: 1.1.0~150^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a7a64fa87ef027bf477f5094c4882c2c70c6ae70;p=rspamd.git SURBL: Allow fallthrough to default symbol --- diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index baa125422..d9e8517e5 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -643,7 +643,7 @@ surbl_module_config (struct rspamd_config *cfg) } } - if (!has_subsymbols) { + if (new_suffix->symbol) { /* Register just a symbol itself */ rspamd_symbols_cache_add_symbol (cfg->cache, new_suffix->symbol, @@ -980,6 +980,7 @@ process_dns_results (struct rspamd_task *task, guint32 addr) { guint i; + gboolean got_result = FALSE; struct surbl_bit_item *bit; if (suffix->ips && g_hash_table_size (suffix->ips) > 0) { @@ -993,6 +994,7 @@ process_dns_results (struct rspamd_task *task, rspamd_task_insert_result (task, bit->symbol, 1, g_list_prepend (NULL, rspamd_mempool_strdup (task->task_pool, url))); + got_result = TRUE; } } else if (suffix->bits != NULL && suffix->bits->len > 0) { @@ -1008,13 +1010,14 @@ process_dns_results (struct rspamd_task *task, url, suffix->suffix, bit->bit); if (((gint)bit->bit & (gint)ntohl (addr)) != 0) { + got_result = TRUE; rspamd_task_insert_result (task, bit->symbol, 1, g_list_prepend (NULL, rspamd_mempool_strdup (task->task_pool, url))); } } } - else { + else if (!got_result) { msg_info_task ("<%s> domain [%s] is in surbl %s", task->message_id, url, suffix->suffix);