]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Stop using tags for redirections
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 7 Feb 2017 12:45:13 +0000 (12:45 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 7 Feb 2017 12:45:13 +0000 (12:45 +0000)
src/plugins/surbl.c

index c469873a7cd419bf045a5377a326e22375ba3dcf..8bd008e6abb71eaab4aeeceef083b3ccd029c1ee 100644 (file)
@@ -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;
 }