Postfix mail server block .bat, .exe .com .vbs mime attachments – common virus spreading files
Postfix provides Mime header check for all incoming messages. You can
put restrictions on .exe / .bat / .vbs files and block all attachments.
mime_header_checks directive allows you to define file, you will place a restriction for any file extensions that you do not want to have passing through your mail sever system.
On most mail server the first thing that needs to be done is to enable header checks and block dangerous files.
Append / set mime_header_checks directive as follows:
Save and close the file.
Append following line:
Save and close the file.
mime_header_checks directive allows you to define file, you will place a restriction for any file extensions that you do not want to have passing through your mail sever system.
On most mail server the first thing that needs to be done is to enable header checks and block dangerous files.
Define mine header checks
Open main.cf file:# vi /etc/postfix/main.cfAppend / set mime_header_checks directive as follows:
mime_header_checks = regexp:/etc/postfix/mime_header_checksSave and close the file.
Block attachments
Now open /etc/postfix/mime_header_checks file:# vi /etc/postfix/mime_header_checksAppend following line:
/name=[^>]*\.(bat|com|exe|dll|vbs)/ REJECTSave and close the file.
Restart postfix
First create postfix lookup table for mime_header_checks file:# /etc/init.d/postfix restartWatch log file
You should see rejected mail log in /var/log/maillog file:# tail -f /var/log/maillog
Комментарии
Отправить комментарий