How to block attachment file extension in Postfix (OS= Debian)
Step 1. Add the following line on main.cf
# vim /etc/postfix/main.cf
mime_header_checks = regexp:/etc/postfix/mime_header_checks
:wq! Save and close the file.
mime_header_checks = regexp:/etc/postfix/mime_header_checks
:wq! Save and close the file.
Step 2. Add following line on /etc/postfix/mime_header_checksfile:
# vim /etc/postfix/mime_header_checks
/name=[^>]*\.(bat|exe|dll|eml|vbs)/ REJECT ### File ext that you want to block ####
:wq! Save and close the file.
3. Restart Postfix service and check with mail log.
/etc/init.d/postfix restart
Check with mail log
tail -f /var/log/mail.log
0 Comments