From 96233956371f0312e894be5d03675377128af8ad Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 23 Apr 2019 19:41:21 +0100 Subject: [Fix] Fix processing of the ip urls in file --- src/libserver/url.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/libserver/url.c') diff --git a/src/libserver/url.c b/src/libserver/url.c index 8ad073ae2..96e3118eb 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -2004,7 +2004,7 @@ rspamd_url_parse (struct rspamd_url *uri, } } - if (uri->protocol & (PROTOCOL_HTTP|PROTOCOL_HTTPS|PROTOCOL_MAILTO|PROTOCOL_FTP)) { + if (uri->protocol & (PROTOCOL_HTTP|PROTOCOL_HTTPS|PROTOCOL_MAILTO|PROTOCOL_FTP|PROTOCOL_FILE)) { /* Find TLD part */ rspamd_multipattern_lookup (url_scanner->search_trie, uri->host, uri->hostlen, @@ -2017,9 +2017,11 @@ rspamd_url_parse (struct rspamd_url *uri, return URI_ERRNO_TLD_MISSING; } } else { - /* Assume tld equal to host */ - uri->tld = uri->host; - uri->tldlen = uri->hostlen; + if (!rspamd_url_is_ip (uri, pool)) { + /* Assume tld equal to host */ + uri->tld = uri->host; + uri->tldlen = uri->hostlen; + } } } } -- cgit v1.2.3