aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver/url.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-05-05 14:59:33 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-05-05 14:59:33 +0100
commit5dd1ccbb33e53b9a3903970bbd623569869ad008 (patch)
treea7bb39de8f90e042019e7ed7e9bcd286d174393e /src/libserver/url.c
parent569825264466b743f741514f117afae29c4b8dad (diff)
downloadrspamd-5dd1ccbb33e53b9a3903970bbd623569869ad008.tar.gz
rspamd-5dd1ccbb33e53b9a3903970bbd623569869ad008.zip
[Minor] Allow attaching of urls to the mime parts
Diffstat (limited to 'src/libserver/url.c')
-rw-r--r--src/libserver/url.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/libserver/url.c b/src/libserver/url.c
index a47d732f7..c10073dcb 100644
--- a/src/libserver/url.c
+++ b/src/libserver/url.c
@@ -3296,7 +3296,13 @@ rspamd_url_query_callback (struct rspamd_url *url, gsize start_offset,
}
url->flags |= RSPAMD_URL_FLAG_QUERY;
- rspamd_url_set_add_or_increase (MESSAGE_FIELD (task, urls), url);
+
+
+ if (rspamd_url_set_add_or_increase (MESSAGE_FIELD (task, urls), url)) {
+ if (cbd->part && cbd->part->mime_part->urls) {
+ g_ptr_array_add (cbd->part->mime_part->urls, url);
+ }
+ }
return TRUE;
}
@@ -3347,7 +3353,11 @@ rspamd_url_text_part_callback (struct rspamd_url *url, gsize start_offset,
}
url->flags |= RSPAMD_URL_FLAG_FROM_TEXT;
- rspamd_url_set_add_or_increase (MESSAGE_FIELD (task, urls), url);
+
+ if (rspamd_url_set_add_or_increase (MESSAGE_FIELD (task, urls), url) &&
+ cbd->part->mime_part->urls) {
+ g_ptr_array_add (cbd->part->mime_part->urls, url);
+ }
cbd->part->exceptions = g_list_prepend (
cbd->part->exceptions,