Skip to content

Instantly share code, notes, and snippets.

@milosdjakonovic
Created March 19, 2017 13:46
Show Gist options
  • Save milosdjakonovic/36a820824c414b52d54e2da3a4e835ad to your computer and use it in GitHub Desktop.
Save milosdjakonovic/36a820824c414b52d54e2da3a4e835ad to your computer and use it in GitHub Desktop.
Clamsmtp reject zipped dangerous files (exe, com...) in attachments

Based on https://forums.cpanel.net/threads/reject-emails-with-zip-files-containing-exe-files.333101/

Find clamav database directory, on Debian/Ubuntu it is /var/lib/clamav

Create file with arbitrary filename, give it .cdb extension.

Give it proper user and group ownership, on Debian/Ubuntu clamav:clamav.

Paste the following content:

Archived_EXE:*:*:.*\.exe:*:*:*:*:*:*
Archived_SCR:*:*:.*\.scr:*:*:*:*:*:*
Archived_PIF:*:*:.*\.pif:*:*:*:*:*:*
Archived_COM:*:*:.*\.com:*:*:*:*:*:*

Attention:

This way not only clamsmtp but clamscan binary as well with detect zipped exe files as viruses and act accordingly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment