From f14a3db518a6c5e98f08a1d78e1a81cf2da61e3c Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 17 Jul 2015 13:08:54 +0100 Subject: [PATCH] More fixes to emails detection. --- src/libserver/url.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/libserver/url.c b/src/libserver/url.c index 4a9fc7667..7d773525e 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; } -- 2.39.5