diff options
-rw-r--r-- | conf/metrics.conf | 25 | ||||
-rw-r--r-- | conf/modules.d/rbl.conf | 156 | ||||
-rw-r--r-- | conf/modules.d/surbl.conf | 157 | ||||
-rw-r--r-- | src/plugins/surbl.c | 7 |
4 files changed, 186 insertions, 159 deletions
diff --git a/conf/metrics.conf b/conf/metrics.conf index 230ee2794..0940721bb 100644 --- a/conf/metrics.conf +++ b/conf/metrics.conf @@ -858,18 +858,33 @@ metric { } symbol { + weight = 0.0; + name = "SEM_URIBL"; + description = "Spameatingmonkey uribl: unknown result"; + } + symbol { weight = 3.5; name = "SEM_URIBL"; description = "Spameatingmonkey uribl"; } symbol { + weight = 0.0; + name = "SEM_URIBL_FRESH15_UNKNOWN"; + description = "Spameatingmonkey Fresh15 uribl: unknown result"; + } + symbol { weight = 3.0; name = "SEM_URIBL_FRESH15"; description = "Spameatingmonkey uribl. Domains registered in the last 15 days (.AERO,.BIZ,.COM,.INFO,.NAME,.NET,.PRO,.SK,.TEL,.US)"; } symbol { + weight = 0.0; + description = "DBL unknown result"; + name = "DBL"; + } + symbol { weight = 6.5; description = "DBL uribl spam"; name = "DBL_SPAM"; @@ -920,6 +935,11 @@ metric { name = "DBL_PROHIBIT"; } symbol { + weight = 0.0; + description = "uribl.com: unrecognised result"; + name = "URIBL_MULTI"; + } + symbol { weight = 7.5; description = "uribl.com black url"; name = "URIBL_BLACK"; @@ -941,6 +961,11 @@ metric { } symbol { + weight = 0.0; + description = "ZEN URIBL: Filtered result"; + name = "ZEN_URIBL"; + } + symbol { weight = 6.5; description = "Spamhaus SBL dnsbl"; name = "URIBL_SBL"; diff --git a/conf/modules.d/rbl.conf b/conf/modules.d/rbl.conf new file mode 100644 index 000000000..8b150371b --- /dev/null +++ b/conf/modules.d/rbl.conf @@ -0,0 +1,156 @@ +rbl { + + default_from = true; + default_received = false; + default_exclude_users = true; + + private_ips = "127.0.0.0/8 10.0.0.0/8 192.168.0.0/16 169.254.0.0/16 172.16.0.0/12 100.64.0.0/10 fc00::/7 fe80::/10 fec0::/10 ::1"; + + rbls { + + spamhaus { + symbol = "RBL_SPAMHAUS"; + rbl = "zen.spamhaus.org"; + ipv6 = true; + unknown = true; + returncodes { + RBL_SPAMHAUS_SBL = "127.0.0.2"; + RBL_SPAMHAUS_CSS = "127.0.0.3"; + RBL_SPAMHAUS_XBL = "127.0.0.4"; + RBL_SPAMHAUS_XBL = "127.0.0.5"; + RBL_SPAMHAUS_XBL = "127.0.0.6"; + RBL_SPAMHAUS_XBL = "127.0.0.7"; + RBL_SPAMHAUS_PBL = "127.0.0.10"; + RBL_SPAMHAUS_PBL = "127.0.0.11"; + } + } + + spamhaus_xbl { + symbol = "RECEIVED_SPAMHAUS_XBL"; + rbl = "xbl.spamhaus.org"; + ipv6 = true; + received = true; + from = false; + ignore_whitelists = true; + } + + spamhaus_swl { + symbol = "RWL_SPAMHAUS_WL"; + rbl = "swl.spamhaus.org"; + ipv6 = true; + is_whitelist = true; + unknown = true; + whitelist_exception = "RWL_SPAMHAUS_WL"; + returncodes { + RWL_SPAMHAUS_WL_IND = "127.0.2.2"; + RWL_SPAMHAUS_WL_TRANS = "127.0.2.3"; + RWL_SPAMHAUS_WL_IND_EXP = "127.0.2.102"; + RWL_SPAMHAUS_WL_TRANS_EXP = "127.0.2.103"; + } + } + + mailspike_bl { + symbol = "RBL_MAILSPIKE"; + unknown = true; + rbl = "bl.mailspike.net"; + returncodes { + RBL_MAILSPIKE_ZOMBIE = "127.0.0.2"; + RBL_MAILSPIKE_WORST = "127.0.0.10"; + RBL_MAILSPIKE_VERYBAD = "127.0.0.11"; + RBL_MAILSPIKE_BAD = "127.0.0.12"; + } + } + + mailspike_wl { + symbol = "RWL_MAILSPIKE"; + rbl = "wl.mailspike.net"; + is_whitelist = true; + unknown = true; + whitelist_exception = "RWL_MAILSPIKE"; + whitelist_exception = "RWL_MAILSPIKE_GOOD"; + whitelist_exception = "RWL_MAILSPIKE_POSSIBLE"; + returncodes { + RWL_MAILSPIKE_POSSIBLE = "127.0.0.17"; + RWL_MAILSPIKE_GOOD = "127.0.0.18"; + RWL_MAILSPIKE_VERYGOOD = "127.0.0.19"; + RWL_MAILSPIKE_EXCELLENT = "127.0.0.20"; + } + } + + senderscore { + symbol = "RBL_SENDERSCORE"; + rbl = "bl.score.senderscore.com"; + } + + abusech { + symbol = "RBL_ABUSECH"; + rbl = "spam.abuse.ch"; + } + + uceprotect1 { + symbol = "RBL_UCEPROTECT_LEVEL1"; + rbl = "dnsbl-1.uceprotect.net"; + } + + sorbs { + symbol = "RBL_SORBS"; + rbl = "dnsbl.sorbs.net"; + unknown = true; + returncodes { + # http:// www.sorbs.net/general/using.shtml + RBL_SORBS_HTTP = "127.0.0.2"; + RBL_SORBS_SOCKS = "127.0.0.3"; + RBL_SORBS_MISC = "127.0.0.4"; + RBL_SORBS_SMTP = "127.0.0.5"; + RBL_SORBS_RECENT = "127.0.0.6"; + RBL_SORBS_WEB = "127.0.0.7"; + RBL_SORBS_DUL = "127.0.0.10"; + RBL_SORBS_BLOCK = "127.0.0.8"; + RBL_SORBS_ZOMBIE = "127.0.0.9"; + } + } + + sem { + symbol = "RBL_SEM"; + rbl = "bl.spameatingmonkey.net"; + } + + semIPv6 { + symbol = "RBL_SEM_IPV6"; + rbl = "bl.ipv6.spameatingmonkey.net"; + ipv4 = false; + ipv6 = true; + } + + dnswl { + symbol = "RCVD_IN_DNSWL"; + rbl = "list.dnswl.org"; + ipv6 = true; + is_whitelist = true; + unknown = true; + whitelist_exception = "RCVD_IN_DNSWL"; + whitelist_exception = "RCVD_IN_DNSWL_NONE"; + whitelist_exception = "RCVD_IN_DNSWL_LOW"; + whitelist_exception = "DNSWL_BLOCKED"; + returncodes { + RCVD_IN_DNSWL_NONE = "127.0.%d+.0"; + RCVD_IN_DNSWL_LOW = "127.0.%d+.1"; + RCVD_IN_DNSWL_MED = "127.0.%d+.2"; + RCVD_IN_DNSWL_HI = "127.0.%d+.3"; + DNSWL_BLOCKED = "127.0.0.255"; + } + } + + rambleremails { + symbol = RAMBLER_EMAILBL; + rbl = "email-bl.rambler.ru"; + from = false; + emails = true; + exclude_users = false; + exclude_private_ips = false; + exclude_local = false; + ignore_whitelists = true; + } + + } +} diff --git a/conf/modules.d/surbl.conf b/conf/modules.d/surbl.conf index 7bb56b364..ed233ea9e 100644 --- a/conf/modules.d/surbl.conf +++ b/conf/modules.d/surbl.conf @@ -80,160 +80,3 @@ surbl { no_ip = true; } } - -rbl { - - default_from = true; - default_received = false; - default_exclude_users = true; - - private_ips = "127.0.0.0/8 10.0.0.0/8 192.168.0.0/16 169.254.0.0/16 172.16.0.0/12 100.64.0.0/10 fc00::/7 fe80::/10 fec0::/10 ::1"; - - rbls { - - spamhaus { - symbol = "RBL_SPAMHAUS"; - rbl = "zen.spamhaus.org"; - ipv6 = true; - unknown = true; - returncodes { - RBL_SPAMHAUS_SBL = "127.0.0.2"; - RBL_SPAMHAUS_CSS = "127.0.0.3"; - RBL_SPAMHAUS_XBL = "127.0.0.4"; - RBL_SPAMHAUS_XBL = "127.0.0.5"; - RBL_SPAMHAUS_XBL = "127.0.0.6"; - RBL_SPAMHAUS_XBL = "127.0.0.7"; - RBL_SPAMHAUS_PBL = "127.0.0.10"; - RBL_SPAMHAUS_PBL = "127.0.0.11"; - } - } - - spamhaus_xbl { - symbol = "RECEIVED_SPAMHAUS_XBL"; - rbl = "xbl.spamhaus.org"; - ipv6 = true; - received = true; - from = false; - ignore_whitelists = true; - } - - spamhaus_swl { - symbol = "RWL_SPAMHAUS_WL"; - rbl = "swl.spamhaus.org"; - ipv6 = true; - is_whitelist = true; - unknown = true; - whitelist_exception = "RWL_SPAMHAUS_WL"; - returncodes { - RWL_SPAMHAUS_WL_IND = "127.0.2.2"; - RWL_SPAMHAUS_WL_TRANS = "127.0.2.3"; - RWL_SPAMHAUS_WL_IND_EXP = "127.0.2.102"; - RWL_SPAMHAUS_WL_TRANS_EXP = "127.0.2.103"; - } - } - - mailspike_bl { - symbol = "RBL_MAILSPIKE"; - unknown = true; - rbl = "bl.mailspike.net"; - returncodes { - RBL_MAILSPIKE_ZOMBIE = "127.0.0.2"; - RBL_MAILSPIKE_WORST = "127.0.0.10"; - RBL_MAILSPIKE_VERYBAD = "127.0.0.11"; - RBL_MAILSPIKE_BAD = "127.0.0.12"; - } - } - - mailspike_wl { - symbol = "RWL_MAILSPIKE"; - rbl = "wl.mailspike.net"; - is_whitelist = true; - unknown = true; - whitelist_exception = "RWL_MAILSPIKE"; - whitelist_exception = "RWL_MAILSPIKE_GOOD"; - whitelist_exception = "RWL_MAILSPIKE_POSSIBLE"; - returncodes { - RWL_MAILSPIKE_POSSIBLE = "127.0.0.17"; - RWL_MAILSPIKE_GOOD = "127.0.0.18"; - RWL_MAILSPIKE_VERYGOOD = "127.0.0.19"; - RWL_MAILSPIKE_EXCELLENT = "127.0.0.20"; - } - } - - senderscore { - symbol = "RBL_SENDERSCORE"; - rbl = "bl.score.senderscore.com"; - } - - abusech { - symbol = "RBL_ABUSECH"; - rbl = "spam.abuse.ch"; - } - - uceprotect1 { - symbol = "RBL_UCEPROTECT_LEVEL1"; - rbl = "dnsbl-1.uceprotect.net"; - } - - sorbs { - symbol = "RBL_SORBS"; - rbl = "dnsbl.sorbs.net"; - unknown = true; - returncodes { - # http:// www.sorbs.net/general/using.shtml - RBL_SORBS_HTTP = "127.0.0.2"; - RBL_SORBS_SOCKS = "127.0.0.3"; - RBL_SORBS_MISC = "127.0.0.4"; - RBL_SORBS_SMTP = "127.0.0.5"; - RBL_SORBS_RECENT = "127.0.0.6"; - RBL_SORBS_WEB = "127.0.0.7"; - RBL_SORBS_DUL = "127.0.0.10"; - RBL_SORBS_BLOCK = "127.0.0.8"; - RBL_SORBS_ZOMBIE = "127.0.0.9"; - } - } - - sem { - symbol = "RBL_SEM"; - rbl = "bl.spameatingmonkey.net"; - } - - semIPv6 { - symbol = "RBL_SEM_IPV6"; - rbl = "bl.ipv6.spameatingmonkey.net"; - ipv4 = false; - ipv6 = true; - } - - dnswl { - symbol = "RCVD_IN_DNSWL"; - rbl = "list.dnswl.org"; - ipv6 = true; - is_whitelist = true; - unknown = true; - whitelist_exception = "RCVD_IN_DNSWL"; - whitelist_exception = "RCVD_IN_DNSWL_NONE"; - whitelist_exception = "RCVD_IN_DNSWL_LOW"; - whitelist_exception = "DNSWL_BLOCKED"; - returncodes { - RCVD_IN_DNSWL_NONE = "127.0.%d+.0"; - RCVD_IN_DNSWL_LOW = "127.0.%d+.1"; - RCVD_IN_DNSWL_MED = "127.0.%d+.2"; - RCVD_IN_DNSWL_HI = "127.0.%d+.3"; - DNSWL_BLOCKED = "127.0.0.255"; - } - } - - rambleremails { - symbol = RAMBLER_EMAILBL; - rbl = "email-bl.rambler.ru"; - from = false; - emails = true; - exclude_users = false; - exclude_private_ips = false; - exclude_local = false; - ignore_whitelists = true; - } - - } -} 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); |