From: Vsevolod Stakhov Date: Fri, 17 Jul 2015 12:08:54 +0000 (+0100) Subject: More fixes to emails detection. X-Git-Tag: 1.0.0~342 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f14a3db518a6c5e98f08a1d78e1a81cf2da61e3c;p=thirdparty%2Frspamd.git More fixes to emails detection. --- diff --git a/src/libserver/url.c b/src/libserver/url.c index 4a9fc7667d..7d773525e9 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -1515,10 +1515,15 @@ url_email_start (const gchar *begin, if (pos > begin && *pos == '@') { /* Try to extract it with username */ p = pos - 1; - while (p > begin && is_atom (*p)) { + while (p > begin && is_urlsafe (*p) && *p != ':') { p--; } - if (!is_atom (*p) && p != pos - 1) { + + /* + * If we've found something special but not ':' then we can try this as + * email address + */ + if (!is_urlsafe (*p) && p != pos - 1 && *p != ':') { match->m_begin = p + 1; return TRUE; }