aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-02-17 15:18:37 +0300
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-02-17 15:18:37 +0300
commita5899a828367d0ff16534771c561e44ae7af632d (patch)
treebb1a051c7023664db90fcec9f8ea3de918d6690f
parent0c53751a9afce121ec5da230d942e722b6f8f460 (diff)
downloadrspamd-a5899a828367d0ff16534771c561e44ae7af632d.tar.gz
rspamd-a5899a828367d0ff16534771c561e44ae7af632d.zip
Fix parsing emails with '_' symbol.
Fix adding metric symbol.
-rw-r--r--src/cfg_xml.c4
-rw-r--r--src/lua/lua_cfg_file.c4
-rw-r--r--src/url.c2
3 files changed, 7 insertions, 3 deletions
diff --git a/src/cfg_xml.c b/src/cfg_xml.c
index c1d0be95d..885af3a57 100644
--- a/src/cfg_xml.c
+++ b/src/cfg_xml.c
@@ -840,7 +840,9 @@ handle_metric_symbol (struct config_file *cfg, struct rspamd_xml_userdata *ctx,
}
else {
/* Slow but keep start element of list in safe */
- metric_list = g_list_append (metric_list, metric);
+ if (!g_list_find (metric_list, metric)) {
+ metric_list = g_list_append (metric_list, metric);
+ }
}
return TRUE;
diff --git a/src/lua/lua_cfg_file.c b/src/lua/lua_cfg_file.c
index e4f0734af..8c44ab809 100644
--- a/src/lua/lua_cfg_file.c
+++ b/src/lua/lua_cfg_file.c
@@ -174,7 +174,9 @@ lua_process_metric (lua_State *L, const gchar *name, struct config_file *cfg)
}
else {
/* Slow but keep start element of list in safe */
- metric_list = g_list_append (metric_list, metric);
+ if (!g_list_find (metric_list, metric)) {
+ metric_list = g_list_append (metric_list, metric);
+ }
}
}
}
diff --git a/src/url.c b/src/url.c
index 3db6b05b6..de916188f 100644
--- a/src/url.c
+++ b/src/url.c
@@ -1117,7 +1117,7 @@ url_email_start (const gchar *begin, const gchar *end, const gchar *pos, url_mat
if (pos > begin && *pos == '@') {
/* Try to extract it with username */
p = pos - 1;
- while (p > begin && (is_domain (*p) || *p == '.')) {
+ while (p > begin && (is_domain (*p) || *p == '.' || *p == '_')) {
p --;
}
if (!is_domain (*p)) {