aboutsummaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-05-22 14:02:26 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-05-22 14:02:26 +0100
commit3b3de857f12e0b13b060c8fffccd4923abca3631 (patch)
tree2681033bccd99ad70b72bfd72fb5c41591e9b72e /rules
parent2fa03199e4bcf3d323d5c94ec7a16bb2890e0354 (diff)
downloadrspamd-3b3de857f12e0b13b060c8fffccd4923abca3631.tar.gz
rspamd-3b3de857f12e0b13b060c8fffccd4923abca3631.zip
[Feature] PDF: Add timeouts for expensive operations
Diffstat (limited to 'rules')
-rw-r--r--rules/content.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/rules/content.lua b/rules/content.lua
index 5bdc46c25..d95eeec63 100644
--- a/rules/content.lua
+++ b/rules/content.lua
@@ -46,6 +46,10 @@ local function process_pdf_specific(task, part, specific)
task:insert_result('PDF_MANY_OBJECTS', 1.0, string.format('%s:%d',
part:get_filename() or 'unknown', specific.many_objects))
end
+ if specific.timeout_processing then
+ task:insert_result('PDF_TIMEOUT', 1.0, string.format('%s:%.3f',
+ part:get_filename() or 'unknown', specific.timeout_processing))
+ end
end
local tags_processors = {
@@ -104,3 +108,9 @@ rspamd_config:register_symbol{
parent = id,
groups = {"content", "pdf"},
}
+rspamd_config:register_symbol{
+ type = 'virtual',
+ name = 'PDF_TIMEOUT',
+ parent = id,
+ groups = {"content", "pdf"},
+} \ No newline at end of file