diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-09 13:20:16 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-04-09 13:20:16 +0100 |
commit | 6614b861a4b0ad518fae972ed509c7d8a983ebf7 (patch) | |
tree | 7b84b83f779e06e9563afb5b3863cb3a48c96f6b /src/plugins/lua/antivirus.lua | |
parent | 530e595772bf0a1aa9d8be715da6ab4987d4ecae (diff) | |
download | rspamd-6614b861a4b0ad518fae972ed509c7d8a983ebf7.tar.gz rspamd-6614b861a4b0ad518fae972ed509c7d8a983ebf7.zip |
[Feature] Antivirus: Handle encrypted files specially
Diffstat (limited to 'src/plugins/lua/antivirus.lua')
-rw-r--r-- | src/plugins/lua/antivirus.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/plugins/lua/antivirus.lua b/src/plugins/lua/antivirus.lua index 68dcedb64..70549719f 100644 --- a/src/plugins/lua/antivirus.lua +++ b/src/plugins/lua/antivirus.lua @@ -88,6 +88,10 @@ local function add_antivirus_rule(sym, opts) opts.symbol_fail = opts.symbol .. '_FAIL' end + if not opts.symbol_encrypted then + opts.symbol_encrypted = opts.symbol .. '_ENCRYPTED' + end + -- WORKAROUND for deprecated attachments_only if opts.attachments_only ~= nil then opts.scan_mime_parts = opts.attachments_only @@ -99,6 +103,7 @@ local function add_antivirus_rule(sym, opts) local rule = cfg.configure(opts) rule.type = opts.type rule.symbol_fail = opts.symbol_fail + rule.symbol_encrypted = opts.symbol_encrypted rule.redis_params = redis_params if not rule then @@ -158,6 +163,13 @@ if opts and type(opts) == 'table' then score = 0.0, group = N }) + rspamd_config:register_symbol({ + type = 'virtual', + name = m['symbol_encrypted'], + parent = id, + score = 0.0, + group = N + }) has_valid = true if type(m['patterns']) == 'table' then if m['patterns'][1] then |