diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-06-17 14:33:54 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-06-17 14:33:54 +0100 |
commit | d7d83b570be42d732083f1b5839760b78979b7cf (patch) | |
tree | 63f3f015e3ee0f2626c8eeb95a6ca6d224682ee8 /src/plugins | |
parent | 5efd0c7fe5ebbe1fa12fd3e087feab74c8897e44 (diff) | |
download | rspamd-d7d83b570be42d732083f1b5839760b78979b7cf.tar.gz rspamd-d7d83b570be42d732083f1b5839760b78979b7cf.zip |
Fix selecting URLs for sending to redirector.
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/surbl.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index 07ccda52f..cddfbb361 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -1092,6 +1092,7 @@ surbl_tree_url_callback (gpointer key, gpointer value, void *data) rspamd_regexp_t *re; gint idx = 0, state = 0; ac_trie_pat_t *pat; + gboolean found = FALSE; task = param->task; debug_task ("check url %s", struri (url)); @@ -1112,8 +1113,19 @@ surbl_tree_url_callback (gpointer key, gpointer value, void *data) re = g_hash_table_lookup ( surbl_module_ctx->redirector_hosts, pat->ptr); - if (re == NULL || rspamd_regexp_search (re, url->string, 0, + if (re == NULL) { + /* Perform exact match */ + if (pat->len == url->hostlen && memcmp (pat->ptr, + url->host, pat->len) == 0) { + found = TRUE; + } + } + else if (rspamd_regexp_search (re, url->string, 0, NULL, NULL, TRUE)) { + found = TRUE; + } + + if (found) { if (surbl_module_ctx->redirector_symbol != NULL) { rspamd_task_insert_result (param->task, surbl_module_ctx->redirector_symbol, |