diff options
author | Bernhard Frauendienst <rspamd@nospam.obeliks.de> | 2018-04-30 14:34:51 +0200 |
---|---|---|
committer | Bernhard Frauendienst <rspamd@nospam.obeliks.de> | 2018-04-30 14:34:51 +0200 |
commit | 4c4ce6dc468b105e6e52edeb126a9f39f58fd92a (patch) | |
tree | 277278dfb3ebf1bd808424295fd39dd3f7f193b7 /src/plugins | |
parent | 486435c147e6af12f8e9ad0cffec98e742fea2c4 (diff) | |
download | rspamd-4c4ce6dc468b105e6e52edeb126a9f39f58fd92a.tar.gz rspamd-4c4ce6dc468b105e6e52edeb126a9f39f58fd92a.zip |
Add optional status prefix to X-Virus header
Adds two options to X-Virus milter header routine that prefix the header
value with a configured string when a virus was found (or not). This is
useful for sieve implementations (like pidgeonhole) that require a fixed
value part to match against.
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/milter_headers.lua | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/lua/milter_headers.lua b/src/plugins/lua/milter_headers.lua index 0eb92ff27..5e7fb21ed 100644 --- a/src/plugins/lua/milter_headers.lua +++ b/src/plugins/lua/milter_headers.lua @@ -71,6 +71,8 @@ local settings = { ['x-virus'] = { header = 'X-Virus', remove = 1, + status_clean = nil, + status_infected = nil, symbols = {}, -- needs config }, ['x-spamd-bar'] = { @@ -344,7 +346,13 @@ local function milter_headers(task) end end if #virii > 0 then - add_header('x-virus', table.concat(virii, ',')) + local virusstatus = table.concat(virii, ',') + if settings.routines['x-virus'].status_infected then + virusstatus = settings.routines['x-virus'].status_infected .. ', ' .. virusstatus + end + add_header('x-virus', virusstatus) + elseif settings.routines['x-virus'].status_clean then + add_header('x-virus', settings.routines['x-virus'].status_clean) end end |