forked from vexim/vexim2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace old demime-function with acl_smtp_mime-rules
- Loading branch information
Showing
3 changed files
with
44 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Decode MIME parts to disk. This will support virus scanners later. | ||
deny | ||
decode = default | ||
condition = ${if > {$mime_anomaly_level}{2} \ | ||
{true}{false}} | ||
message = This message contains a MIME error ($mime_anomaly_text) | ||
log_message = DENY: MIME Error ($mime_anomaly_text) | ||
|
||
# File extension filtering. | ||
deny | ||
condition = ${if match \ | ||
{${lc:$mime_filename}} \ | ||
{\N(?i)\.(exe|com|ade|adep|adp|bas|bat|chm|cmd|cnf|com|cpl|crt|dll|hlp|hta|inf|ins|isp|js|jse|lnk|mad|maf|mag|mam|maq|mar|mas|matmav|maw|ocx|pcd|pif|reg|scf|scr|sct|vbe|vbs|wsc|wsf|wsh|url|xnk)\N} \ | ||
{1}{0}} | ||
message = Blacklisted file extension detected in "$mime_filename". If you legitimately need to send these files please use a compressed archive or a file exchange provider. | ||
log_message = DENY: Blacklisted extension ("$mime_filename") | ||
|
||
# Check zip files for suspicious mail extensions | ||
# from: http://www.gossamer-threads.com/lists/exim/users/98336#98336 | ||
# | ||
# deny message = A .zip attachment contains a Windows-executable file - \ | ||
# blocked because we are afraid of new viruses \ | ||
# not recognized [yet] by antiviruses. | ||
# condition = ${if match{$mime_filename}{\N(?i)\.zip$\N}} | ||
# condition = ${if def:sender_host_address} | ||
# !authenticated = * | ||
# decode = default | ||
# log_message = forbidden binary in attachment: filename=$mime_filename, \ | ||
# recipients=$recipients | ||
# condition = ${if match{${run{/usr/bin/unzip -l \ | ||
# $mime_decoded_filename}}}\ | ||
# {\N(?i)\.(exe|com|ade|adep|adp|bas|bat|chm|cmd|cnf|com|cpl|crt|dll|hlp|hta|inf|ins|isp|js|jse|lnk|mad|maf|mag|mam|maq|mar|mas|matmav|maw|ocx|pcd|pif|reg|scf|scr|sct|vbe|vbs|wsc|wsf|wsh|url|xnk)\n\N}} | ||
|
||
# Further checks can be implemented, especially if older email clients are used: https://github.com/Exim/exim/wiki/ExiscanBugBlocking |