commit 87f9e50: [Minor] Move urls find in subject to task process stage
Vsevolod Stakhov
vsevolod at highsecure.ru
Fri Nov 27 12:21:06 UTC 2020
Author: Vsevolod Stakhov
Date: 2020-11-27 12:17:41 +0000
URL: https://github.com/rspamd/rspamd/commit/87f9e5050002ba9cebbdd9e35d26caacad56b907 (HEAD -> master)
[Minor] Move urls find in subject to task process stage
---
src/libmime/message.c | 13 +++++++++----
src/libserver/task.c | 5 ++++-
2 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/src/libmime/message.c b/src/libmime/message.c
index 10de8ce53..99b84e385 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 1f22e2715..80216537f 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);
More information about the Commits
mailing list