From: Vsevolod Stakhov Date: Fri, 27 Nov 2020 12:17:41 +0000 (+0000) Subject: [Minor] Move urls find in subject to task process stage X-Git-Tag: 2.7~101 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=87f9e5050002ba9cebbdd9e35d26caacad56b907;p=thirdparty%2Frspamd.git [Minor] Move urls find in subject to task process stage --- diff --git a/src/libmime/message.c b/src/libmime/message.c index 10de8ce53f..99b84e3858 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -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; diff --git a/src/libserver/task.c b/src/libserver/task.c index 1f22e2715e..80216537fb 100644 --- a/src/libserver/task.c +++ b/src/libserver/task.c @@ -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);