summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-17 13:08:54 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-07-17 13:08:54 +0100
commitf14a3db518a6c5e98f08a1d78e1a81cf2da61e3c (patch)
treefafbff642028b60770e7c4f350e0f390295d5c7a /src
parente5bce79129c229b472afe7e76434186ca87273b2 (diff)
downloadrspamd-f14a3db518a6c5e98f08a1d78e1a81cf2da61e3c.tar.gz
rspamd-f14a3db518a6c5e98f08a1d78e1a81cf2da61e3c.zip
More fixes to emails detection.
Diffstat (limited to 'src')
-rw-r--r--src/libserver/url.c9
1 files 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;
}