]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
More fixes to emails detection.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 17 Jul 2015 12:08:54 +0000 (13:08 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 17 Jul 2015 12:08:54 +0000 (13:08 +0100)
src/libserver/url.c

index 4a9fc7667dd8a57531041ab147123dcf374b8491..7d773525e965105d97ff60f22ce822b4de4d2a01 100644 (file)
@@ -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;
                }