}
reconf['SUBJECT_ENDS_QUESTION'] = {
- re = 'Subject=/\\?\\s*$/H',
+ re = 'Subject=/\\?\\s*$/Hu',
description = 'Subject ends with a question',
score = 1.0,
group = 'headers'
}
reconf['SUBJECT_HAS_QUESTION'] = {
- re = string.format('%s & !%s', 'Subject=/\\?/H', 'Subject=/\\?\\s*$/H'),
+ re = string.format('%s & !%s', 'Subject=/\\?/H', 'Subject=/\\?\\s*$/Hu'),
description = 'Subject contains a question',
score = 0.0,
group = 'headers'
for (i = 0; i < str->len; i ++) {
t = str->str[i];
- if (!((t & 0x80) || g_ascii_isgraph (t) || t == ' ')) {
- str->str[i] = '?';
+ if (!((t & 0x80) || g_ascii_isgraph (t))) {
+ if (g_ascii_isspace (t)) {
+ /* Replace spaces characters with plain space */
+ str->str[i] = ' ';
+ }
+ else {
+ str->str[i] = '?';
+ }
}
}
}
ret = rspamd_re_cache_process_regexp_data (rt, re,
task, scvec, lenvec, headerlist->len, raw);
- msg_debug_re_task ("checking header %s regexp: %s -> %d",
+ msg_debug_re_task ("checking header %s regexp: %s=%*s -> %d",
re_class->type_data,
- rspamd_regexp_get_pattern (re), ret);
+ rspamd_regexp_get_pattern (re),
+ (int)lenvec[0], scvec[0], ret);
g_free (scvec);
g_free (lenvec);
}