Postfix block PDF or ZIP files attachments
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
Subscribe to our free e-mail newsletter or RSS feed to get all updates.
You can Email this page to a friend.
Related Other Helpful FAQs:
- Postfix blacklist or reject an email address
- Bind Postfix Mail Server To Localhost or Specific IP Address Only
- Postfix setup catch-all email accounts using /etc/postfix/virtual
- Postfix limit incoming or receiving email rate
- Configure Postfix for DNS Blackhole Lists such as dsbl.org / spamhaus.org database
Leave a Reply
We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!
Tags: block_files, block_pdf_file, block_zip_file, email_attachments, mail_server, mime_header, postfix, reload_postfix, restart_postfix, zip_files



Recent Comments
Today ~ 32 Comments
Yesterday ~ 1 Comment
Yesterday ~ 3 Comments
Yesterday ~ 2 Comments
Yesterday ~ 3 Comments