Pages

Monday, October 17, 2011

Specific file extension block in postfix


How to block attachment file extension in Postfix (OS= Debian)?


vim /etc/postfix/main.cf


Add the following line.

mime_header_checks = regexp:/etc/postfix/mime_header_checks

Save and close the file.




Now open /etc/postfix/mime_header_checks file:

vim /etc/postfix/mime_header_checks

 Append following line:

/name=[^>]*\.(bat|exe|dll|eml|vbs)/ REJECT    ### File ext that you want to block ####

Save and close the file.



Restart Postfix service and check with mail log.




1 comment: