Issue: #723
Reported by: @leoboiko
guint nchars = 0;
const gchar *p;
rspamd_ftok_t tok;
+ gboolean has_obrace = FALSE;
g_assert (in != NULL);
g_assert (in->len > 0);
p = in->str;
while ((g_ascii_isspace (*p) || *p == '<') && nchars < in->len) {
+ if (*p == '<') {
+ has_obrace = TRUE;
+ }
+
p++;
nchars ++;
}
p = in->str + in->len - 1;
tok.len = in->len - nchars;
- while ((!g_ascii_isspace (*p) && *p !=
- '>') && tok.len > 0) {
+ while (g_ascii_isspace (*p) && tok.len > 0) {
p--;
tok.len --;
}
+ if (has_obrace && *p == '>') {
+ tok.len --;
+ }
+
return rspamd_mempool_ftokdup (task->task_pool, &tok);
}