[fusion_text]
[/fusion_text][separator style_type=”none” top_margin=”5″ bottom_margin=”” sep_color=”” border_size=”” icon=”” icon_circle=”” icon_circle_color=”” width=”” alignment=”center” class=”” id=””]
With Postfix you can define mine header checks, to block certain email attachments
like *.exe or *.bat etc. You can enable this bij doing the following:
Open main.cf file:
Shell
1 | user@linuxsource.nl# nano /etc/postfix/main.cf |
Append the mime_header_checks directive as follow on the bottom of the file:
Shell
1 | mime_header_checks = regexp:/etc/postfix/mime_header_checks |
Save and close the file with crtl+x and choose yes
Then create the postfix lookup table for mime_header_checks file:
Shell
1 | user@linuxsource.nl# nano/etc/postfix/mime_header_checks |
Now open the /etc/postfix/mime_header_checks file:
Shell
1 | user@linuxsource.nl# nano /etc/postfix/mime_header_checks |
Add following line to block the file extensions:
Shell
1 | /name=[^>]*.(bat|com|exe|dll|vbs)/ REJECT |
Save and close the file. (control+x and choose yes)
Restart postfix:
Shell
1 | user@linuxsource.nl# /etc/init.d/postfix restart |
You should see rejected mail log in /var/log/maillog file by entering the following:
Shell
1 | user@linuxsource.nl# tail -f /var/log/maillog |