]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Move urls find in subject to task process stage
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 27 Nov 2020 12:17:41 +0000 (12:17 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 27 Nov 2020 12:17:41 +0000 (12:17 +0000)
src/libmime/message.c
src/libserver/task.c

index 10de8ce53f30ad0cb6433a38ea616f70d11cd12b..99b84e38585ced1be78fb8576e17bc0af31d30cb 100644 (file)
@@ -1330,7 +1330,6 @@ rspamd_message_parse (struct rspamd_task *task)
 
        memcpy (MESSAGE_FIELD (task, digest), n, sizeof (n));
 
-       /* Parse urls inside Subject header */
        if (MESSAGE_FIELD (task, subject)) {
                p = MESSAGE_FIELD (task, subject);
                len = strlen (p);
@@ -1338,9 +1337,6 @@ rspamd_message_parse (struct rspamd_task *task)
                                p, len,
                                seed);
                memcpy (MESSAGE_FIELD (task, digest), n, sizeof (n));
-               rspamd_url_find_multiple (task->task_pool, p, len,
-                               RSPAMD_URL_FIND_STRICT, NULL,
-                               rspamd_url_task_subject_callback, task);
        }
 
        if (task->queue_id) {
@@ -1494,6 +1490,15 @@ rspamd_message_process (struct rspamd_task *task)
                lua_settop (L, old_top);
        }
 
+       /* Parse urls inside Subject header */
+       if (MESSAGE_FIELD (task, subject)) {
+               rspamd_url_find_multiple (task->task_pool, MESSAGE_FIELD (task, subject),
+                               strlen (MESSAGE_FIELD (task, subject)),
+                               RSPAMD_URL_FIND_STRICT, NULL,
+                               rspamd_url_task_subject_callback,
+                               task);
+       }
+
        /* Calculate average words length and number of short words */
        struct rspamd_mime_text_part *text_part;
        gdouble *var;
index 1f22e2715e9a875d4dd436e9c015efde5e1d24e8..80216537fb3dd7c535f7bf1d3ea7029fc2a4e717 100644 (file)
@@ -721,6 +721,10 @@ rspamd_task_process (struct rspamd_task *task, guint stages)
        st = rspamd_task_select_processing_stage (task, stages);
 
        switch (st) {
+       case RSPAMD_TASK_STAGE_CONNFILTERS:
+               all_done = rspamd_symcache_process_symbols (task, task->cfg->cache, st);
+               break;
+
        case RSPAMD_TASK_STAGE_READ_MESSAGE:
                if (!rspamd_message_parse (task)) {
                        ret = FALSE;
@@ -733,7 +737,6 @@ rspamd_task_process (struct rspamd_task *task, guint stages)
                }
                break;
 
-       case RSPAMD_TASK_STAGE_CONNFILTERS:
        case RSPAMD_TASK_STAGE_PRE_FILTERS:
        case RSPAMD_TASK_STAGE_FILTERS:
                all_done = rspamd_symcache_process_symbols (task, task->cfg->cache, st);