diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libmime/mime_expressions.c | 8 | ||||
-rw-r--r-- | src/plugins/regexp.c | 1 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/libmime/mime_expressions.c b/src/libmime/mime_expressions.c index 438d7347f..6152032a2 100644 --- a/src/libmime/mime_expressions.c +++ b/src/libmime/mime_expressions.c @@ -728,12 +728,8 @@ rspamd_mime_regexp_element_process (struct rspamd_task *task, len = strlen (data); } - if (max_re_data != 0 && len > max_re_data) { - msg_info ("<%s> skip data of size %Hud", - task->message_id, - len); - - return 0; + if (max_re_data > 0 && len > max_re_data) { + len = max_re_data; } while (rspamd_regexp_search (re->regexp, data, len, &start, &end, raw)) { diff --git a/src/plugins/regexp.c b/src/plugins/regexp.c index 27cbf924f..59f5427df 100644 --- a/src/plugins/regexp.c +++ b/src/plugins/regexp.c @@ -126,6 +126,7 @@ regexp_module_config (struct rspamd_config *cfg) if (g_ascii_strncasecmp (ucl_object_key (value), "max_size", sizeof ("max_size") - 1) == 0) { regexp_module_ctx->max_size = ucl_obj_toint (value); + rspamd_mime_expression_set_re_limit (regexp_module_ctx->max_size); } else if (g_ascii_strncasecmp (ucl_object_key (value), "max_threads", sizeof ("max_threads") - 1) == 0) { |