From: Vsevolod Stakhov Date: Tue, 17 Feb 2015 12:35:13 +0000 (+0000) Subject: Email usernames can contain atom symbols. X-Git-Tag: 0.8.2~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d6dac52d809c3678e09f3c9a8aa5179351e1880;p=thirdparty%2Frspamd.git Email usernames can contain atom symbols. --- diff --git a/src/libserver/url.c b/src/libserver/url.c index 22cb15759e..0c002fe690 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -809,7 +809,7 @@ rspamd_url_parse (struct rspamd_url *uri, gchar *uristring, gsize len, { struct http_parser_url u; gchar *p, *comp; - gint i, complen; + guint i, complen; const struct { enum rspamd_url_protocol proto; @@ -1269,10 +1269,10 @@ url_email_start (const gchar *begin, if (pos > begin && *pos == '@') { /* Try to extract it with username */ p = pos - 1; - while (p > begin && (is_domain (*p) || *p == '.' || *p == '_')) { + while (p > begin && is_atom (*p)) { p--; } - if (!is_domain (*p) && p != pos - 1) { + if (!is_atom (*p) && p != pos - 1) { match->m_begin = p + 1; return TRUE; } @@ -1283,7 +1283,7 @@ url_email_start (const gchar *begin, } else { p = pos + strlen (match->pattern); - if (is_domain (*p)) { + if (is_atom (*p)) { match->m_begin = pos; return TRUE; }