aboutsummaryrefslogtreecommitdiffstats
path: root/src/util.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2011-05-13 19:22:09 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2011-05-13 19:22:09 +0400
commit4c4cdd54fbc5afde43e8ff18090c10dd60e06e0a (patch)
treed28e92cbac21f6dd99ee154b13cde57829d12e6f /src/util.c
parent04d82cf8b4d82aa979138d97fa4293534d04812e (diff)
downloadrspamd-4c4cdd54fbc5afde43e8ff18090c10dd60e06e0a.tar.gz
rspamd-4c4cdd54fbc5afde43e8ff18090c10dd60e06e0a.zip
* Strip email addresses from braces
Ignore empty domains in settings
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/util.c b/src/util.c
index 89bc13336..cec4e455d 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1336,6 +1336,29 @@ free_task_soft (gpointer ud)
free_task (task, FALSE);
}
+gchar *
+escape_braces_addr_fstr (memory_pool_t *pool, f_str_t *in)
+{
+ gint len = 0;
+ gchar *res, *orig, *p;
+
+ orig = in->begin;
+ while ((g_ascii_isspace (*orig) || *orig == '<') && orig - in->begin < in->len) {
+ orig ++;
+ }
+
+ p = orig;
+ while ((!g_ascii_isspace (*p) && *p != '>') && p - in->begin < in->len) {
+ p ++;
+ len ++;
+ }
+
+ res = memory_pool_alloc (pool, len + 1);
+ rspamd_strlcpy (res, orig, len + 1);
+
+ return res;
+}
+
/*
* vi:ts=4
*/