]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Add phishing flag
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 13 Jan 2017 13:30:31 +0000 (13:30 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 13 Jan 2017 13:30:31 +0000 (13:30 +0000)
src/libserver/html.c

index 1231650a3107783e9615a2074aa7eb03fb233859..785951d661d478f180efa2020e0db0b6ac694699 100644 (file)
@@ -768,6 +768,7 @@ rspamd_html_url_is_phished (rspamd_mempool_t *pool,
        gboolean *url_found)
 {
        struct rspamd_url *text_url;
+       rspamd_ftok_t phished_tld;
        gint rc;
        gchar *url_str = NULL;
 
@@ -785,6 +786,11 @@ rspamd_html_url_is_phished (rspamd_mempool_t *pool,
                                                text_url->tld, href_url->tldlen) != 0) {
                                        href_url->flags |= RSPAMD_URL_FLAG_PHISHED;
                                        href_url->phished_url = text_url;
+                                       phished_tld.begin = href_url->tld;
+                                       phished_tld.len = href_url->tldlen;
+                                       rspamd_url_add_tag (text_url, "phishing",
+                                                       rspamd_mempool_ftokdup (pool, &phished_tld),
+                                                       pool);
                                }
                        }