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 main.cf file. Fortunately, all parameters have sensible default values

Simple, In /etc/postfix/main.cf 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




0 comments:

Post a Comment

Related Posts with Thumbnails