From 9d6dac52d809c3678e09f3c9a8aa5179351e1880 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 17 Feb 2015 12:35:13 +0000 Subject: [PATCH] Email usernames can contain atom symbols. --- src/libserver/url.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libserver/url.c b/src/libserver/url.c index 22cb15759..0c002fe69 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; } -- 2.39.5