linux poison RSS
linux poison Email

Filter attachments (.bat, .exe, etc..) in postfix

Postfix attempts to be fast, easy to administer, and secure. The outside has a definite Sendmail-ish flavor, but the inside is completely different. Postfix has several hundred configuration parameters that are controlled via the file. Fortunately, all parameters have sensible default values

Simple, In /etc/postfix/ enable the body checks with this line:
body_checks = pcre:/etc/postfix/body_checks
Now put something in this file (/etc/postfix/body_checks):
/^(.*)name=\”(.*).(hta|vb[esx]|ws[fh]|js[e]|bat|cmd)\”$/ REJECT
This will filter attachments of various types.
Remove from the above line, whatever you want to allow.Of course you can add some more lines to make postfix a simple spam filter:

/special offer email/ REJECT
/mortgage rates/ REJECT
/other spam mail subjects/ REJECT


Post a Comment

Related Posts with Thumbnails