diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-04-30 17:17:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-30 17:17:22 +0100 |
commit | 460a1c38db02008c5385cc31399350120a3cd7e5 (patch) | |
tree | a6c6e2dbdc3e613530c054d06e6b211f1b86a828 /src | |
parent | d87d37df04d1cf87c579ad984ba7d60704d80592 (diff) | |
parent | 4c4ce6dc468b105e6e52edeb126a9f39f58fd92a (diff) | |
download | rspamd-460a1c38db02008c5385cc31399350120a3cd7e5.tar.gz rspamd-460a1c38db02008c5385cc31399350120a3cd7e5.zip |
Merge pull request #2205 from oxc/extended_virus_header
Add optional status prefix to X-Virus header
Diffstat (limited to 'src')
-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 |