]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Treat HTML attachments as bad
authortwesterhever <40121680+twesterhever@users.noreply.github.com>
Thu, 22 Jun 2023 20:58:18 +0000 (20:58 +0000)
committertwesterhever <40121680+twesterhever@users.noreply.github.com>
Thu, 22 Jun 2023 21:02:41 +0000 (21:02 +0000)
src/plugins/lua/mime_types.lua

index 2059fc9f9e01f3dfeda3d1c34640dc9bde3ae643..83ea0eb004fec2b8cf56594c95df02306a470d54 100644 (file)
@@ -45,8 +45,10 @@ local settings = {
   extension_map = { -- extension -> mime_type
     html = 'text/html',
     htm = 'text/html',
-    txt = 'text/plain',
     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,