diff options
author | Vsevolod Stakhov <vsevolod@rspamd.com> | 2023-06-23 20:40:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-23 20:40:35 +0100 |
commit | f89a5b762d489e9b0dd2a5302b02002cff7f351b (patch) | |
tree | 073830588265c789eb01203b82750e67c85ce3e4 | |
parent | e7886aa089a295a4ab07d385dbf663dda74a7e6c (diff) | |
parent | bf3aa41aeafc58095080981e991ba579785e596d (diff) | |
download | rspamd-f89a5b762d489e9b0dd2a5302b02002cff7f351b.tar.gz rspamd-f89a5b762d489e9b0dd2a5302b02002cff7f351b.zip |
Merge pull request #4519 from twesterhever/temp-html-attachments
[Enhancement] Treat HTML attachments as (slightly) bad
-rw-r--r-- | src/plugins/lua/mime_types.lua | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/plugins/lua/mime_types.lua b/src/plugins/lua/mime_types.lua index 2059fc9f9..428637d70 100644 --- a/src/plugins/lua/mime_types.lua +++ b/src/plugins/lua/mime_types.lua @@ -45,8 +45,10 @@ local settings = { extension_map = { -- extension -> mime_type html = 'text/html', htm = 'text/html', - txt = 'text/plain', - pdf = 'application/pdf' + pdf = 'application/pdf', + shtm = 'text/html', + shtml = 'text/html', + txt = 'text/plain' }, bad_extensions = { @@ -59,6 +61,11 @@ local settings = { jar = 2, lnk = 4, scr = 4, + -- In contrast to HTML MIME parts, dedicated HTML attachments are considered harmful + htm = 1, + html = 1, + shtm = 1, + shtml = 1, -- Have you ever seen that in legit email? ace = 4, arj = 2, @@ -168,40 +175,40 @@ local settings = { -- Something that should not be in archive bad_archive_extensions = { - pptx = 0.1, docx = 0.1, - xlsx = 0.1, - pdf = 0.1, + hta = 4, jar = 3, js = 0.5, + pdf = 0.1, + pptx = 0.1, vbs = 4, wsf = 4, - hta = 4, + xlsx = 0.1, }, archive_extensions = { - zip = 1, - arj = 1, - rar = 1, - ace = 1, ['7z'] = 1, - cab = 1, + ace = 1, + alz = 1, + arj = 1, bz2 = 1, + cab = 1, egg = 1, - alz = 1, - xz = 1, lz = 1, + rar = 1, + xz = 1, + zip = 1, }, -- Not really archives archive_exceptions = { - odt = true, - ods = true, - odp = true, docx = true, - xlsx = true, + odp = true, + ods = true, + odt = true, pptx = true, vsdx = true, + xlsx = true, -- jar = true, }, |