Q. How do I block all PDF or ZIP files attachments under Postfix Mail Server?
A. You can easily block email attachments using mime header check.
Open postfix config file
Login as the root, enter:
# vi /etc/postfix/main.cf
Block zip or pdf files
Use mime_header_checks postfix config directive, enter:
mime_header_checks = regexp:/etc/ostfix/block_attachments
Save and close the file. Open /etc/ostfix/block_attachments file and append code as follows:
/name=[^>]*\.(pdf|zip)/ REJECT
Save and close the file.
Restart Postfix MTA
You must restart or reload postfix:
# /etc/init.d/postfix reload
Featured Articles:
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- My 10 UNIX Command Line Mistakes
- Linux: 20 Iptables Examples For New SysAdmins

- 25 PHP Security Best Practices For Sys Admins
- The Novice Guide To Buying A Linux Laptop
- 10 Greatest Open Source Software Of 2009
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- Top 20 OpenSSH Server Best Security Practices
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Linux Video Editor Software
Facebook it - Tweet it - Print it -


{ 1 comment… read it below or add one }
Hi,
This will block attachments for all the accounts on the server, what I want to do is block all outgoing attachments for one account.
Is there is a way to do that ?