From a5f3e37ba6c295df97a66615d29faf913f2d036b Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 7 Feb 2017 12:45:13 +0000 Subject: [PATCH] [Minor] Stop using tags for redirections --- src/plugins/surbl.c | 56 ++++----------------------------------------- 1 file changed, 4 insertions(+), 52 deletions(-) diff --git a/src/plugins/surbl.c b/src/plugins/surbl.c index c469873a7..8bd008e6a 100644 --- a/src/plugins/surbl.c +++ b/src/plugins/surbl.c @@ -1463,49 +1463,18 @@ static gboolean surbl_test_tags (struct rspamd_task *task, struct redirector_param *param, struct rspamd_url *url) { - struct rspamd_url_tag *tag = NULL, *rtag = NULL, *cur; - struct rspamd_url *redirected_url = NULL; + struct rspamd_url_tag *tag = NULL, *cur; gchar *ftld = NULL; rspamd_ftok_t tld; gboolean processed = FALSE; if (url->tags) { tag = g_hash_table_lookup (url->tags, "surbl"); - rtag = g_hash_table_lookup (url->tags, "redirector"); } - if (rtag) { - /* This is a redirected URL */ - gint r; - - redirected_url = rspamd_mempool_alloc0 (task->task_pool, - sizeof (*redirected_url)); - r = rspamd_url_parse (redirected_url, (gchar *)rtag->data, - strlen (rtag->data), - task->task_pool); - - if (r == URI_ERRNO_OK) { - if (!g_hash_table_lookup (task->urls, redirected_url)) { - g_hash_table_insert (task->urls, redirected_url, - redirected_url); - redirected_url->phished_url = url; - redirected_url->flags |= RSPAMD_URL_FLAG_REDIRECTED; - } - } - else { - redirected_url = NULL; - } - } - - if (tag || redirected_url) { - if (redirected_url) { - tld.begin = redirected_url->tld; - tld.len = redirected_url->tldlen; - } - else { - tld.begin = url->tld; - tld.len = url->tldlen; - } + if (tag) { + tld.begin = url->tld; + tld.len = url->tldlen; ftld = rspamd_mempool_ftokdup (task->task_pool, &tld); } @@ -1519,23 +1488,6 @@ surbl_test_tags (struct rspamd_task *task, struct redirector_param *param, processed = TRUE; } - else if (redirected_url && param->suffix) { - /* Just register surbl call for the redirected url */ - make_surbl_requests (redirected_url, - param->task, - param->suffix, - FALSE, - param->tree); - - if (surbl_module_ctx->redirector_symbol != NULL) { - rspamd_task_insert_result (param->task, - surbl_module_ctx->redirector_symbol, - 1, - ftld); - } - - processed = TRUE; - } return processed; } -- 2.39.5