if ext2 then
check_extension(settings['bad_extensions'][ext],
settings['bad_extensions'][ext2])
+ -- Check for archive cloaking like .zip.gz
+ if settings['archive_extensions'][ext2]
+ -- Exclude multipart archive extensions, e.g. .zip.001
+ and not string.match(ext, '^%d+$')
+ then
+ task:insert_result(settings['symbol_archive_in_archive'], 1.0, string.format(".%s.%s", ext2, ext))
+ end
else
check_extension(settings['bad_extensions'][ext], nil)
end
${result} = Scan Message With Rspamc ${TESTDIR}/messages/rar4.eml
Check Rspamc ${result} MIME_BAD_EXTENSION \\(\\d+\\.\\d+\\)\\[exe\\]\\n re=1
+Cloaked Archive Extension
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/f.zip.gz.eml
+ Check Rspamc ${result} MIME_ARCHIVE_IN_ARCHIVE \\(\\d+\\.\\d+\\)\\[\\.zip\\.gz\\]\\n re=1
+
+Multipart Archive Extension
+ ${result} = Scan Message With Rspamc ${TESTDIR}/messages/f.zip.001.eml
+ Should Not Contain ${result.stdout} MIME_ARCHIVE_IN_ARCHIVE
+
*** Keywords ***
MIMETypes Setup
${PLUGIN_CONFIG} = Get File ${TESTDIR}/configs/mime_types.conf
--- /dev/null
+Content-Type: multipart/mixed; boundary="------------CB783608BCB68F7F91E9F2A1"
+
+--------------CB783608BCB68F7F91E9F2A1
+Content-Type: application/octet-stream; name="f.zip.001"
+Content-Disposition: attachment; filename="f.zip.001"
+Content-Transfer-Encoding: base64
+
+UEsDBAoAAAAAAGVXsUwAAAAAAAAAAAAAAAAFAAAAZi50eHRQSwECPwAKAAAAAABlV7FMAAAA
+AAAAAAAAAAAABQAkAAAAAAAAACAgAAAAAAAAZi50eHQKACAAAAAAAAEAGAC4V3vvtO3TAbhX
+e++07dMBuFd777Tt0wFQSwUGAAAAAAEAAQBXAAAAIwAAAAAA
+--------------CB783608BCB68F7F91E9F2A1--
--- /dev/null
+Content-Type: multipart/mixed; boundary="------------283A5F1FAE533F3FB6BF6ED3"
+
+--------------283A5F1FAE533F3FB6BF6ED3
+Content-Type: application/octet-stream; name="f.zip.gz"
+Content-Disposition: attachment; filename="f.zip.gz"
+Content-Transfer-Encoding: base64
+
+H4sICPY5/VoEAGYuemlwAHVLuQmAQBCcU8/gKjA80NgWLGANNtsKtIILBKsSDOzDOsQWXE8F
+EZxl54EZpjRzONHJ1OIFq9/XYQhMJmnwV6pu573SM3G4kkGBRcZ93lbzVSabx46eqJZxcQAU
+cyqqkAAAAA==
+--------------283A5F1FAE533F3FB6BF6ED3--