Email and Webmail

How do I block emails containing zip attachments

Updated November 2026 10,182 views 3 min read
Email & Webmail | Updated November 2026

If you are receiving spam or phishing emails with .zip attachments, you can create a cPanel email filter to automatically discard or quarantine messages that contain them. You can filter a single mailbox or every account on the domain, and extend the same filter to other dangerous attachment types. Be aware that a type-based block also stops legitimate zips, so choose discard versus quarantine carefully.

01. Create the Filter

  1. Log into cPanel then Email then Global Email Filters (all accounts) or Email Filters (one account).
  2. Click Create a New Filter and name it, for example Block ZIP Attachments.
  3. Rules - set Any Attachment contains .zip.
  4. Actions - choose Discard Message to delete silently, or Redirect to Folder to quarantine for review.
  5. Click Create.

02. Discard, Quarantine, or SpamAssassin

Pick the action based on how much you trust that no legitimate zips arrive:

  • Redirect to a folder (quarantine) - safest if any real zips might come through, since you can review the folder.
  • Discard - only if you never expect zip files, because discarded mail is gone with no trace.
  • SpamAssassin - a gentler alternative that scores the whole message rather than blocking purely by attachment type, so it is less likely to catch legitimate mail. See Greatly Reduce SPAM.

03. Block Other Dangerous Types

Add more rules to the same filter with or logic to block executable and script attachments, which are almost always malware in email:

  • .exe - Windows executables
  • .scr - screensaver files, a common malware vector
  • .js - JavaScript files used in phishing
  • .vbs - Visual Basic scripts
  • .bat - batch files

04. Test the Filter

After saving, cPanel's Email Filters page has a Test Filters box where you can paste a sample message to confirm it matches and takes the action you expect. Or send yourself a harmless .zip from another address and verify it is discarded or redirected. Testing avoids silently losing wanted mail from a too-broad rule.

Need Help With Email Filters?

If you need a more complex filtering setup, open a ticket and we can help configure rules for your needs.

Open a Support Ticket

Frequently Asked Questions

How do I block emails with zip attachments?

Create a cPanel email filter (Email Filters for one account, or Global Email Filters for all) with a rule matching an attachment containing .zip, and set the action to Discard Message or redirect to a review folder.

Should I discard or quarantine blocked attachments?

Redirect to a folder (quarantine) if there is any chance of legitimate zip files, so you can review them; discard only if you never expect zips. SpamAssassin is a gentler alternative that scores the whole message rather than blocking by type.

Will blocking zip files also block legitimate attachments?

Yes, a type-based filter blocks all zips, including ones from trusted contacts. If you receive legitimate zips, prefer SpamAssassin or quarantine-and-review instead of silent discard, so you do not lose wanted mail.

What other attachment types should I block?

The dangerous ones are executables and scripts: .exe, .scr, .js, .vbs, and .bat. Add them to the same filter with or logic. These are almost always malware when they arrive by email.

Quick Recap

  1. Create a filter in cPanel then Email then Global Email Filters.
  2. Match an attachment containing .zip.
  3. Quarantine over discard if legitimate zips are possible.
  4. Add .exe, .scr, .js, .vbs, .bat for broader protection.
  5. Test the filter before relying on it.

Email filtering · Last updated November 2026 · Browse all Email articles

Share: X in Reddit f Email
  • 158 Users Found This Useful

Was this answer helpful?

Related Articles

Email Troubleshooting Guide

Email & Webmail | Updated August 2026 Email problems are the most common support...

550-not permitted to relay through this server

Email & Webmail | Updated November 2026 The "550 not permitted to relay" error means the...

How Do I Change My MX Records

Email & Webmail | Updated August 2026 MX records control where email for your domain is...

Why Is My Email Going to Spam and How to Fix It

Email and Webmail | Updated July 2026 When mail you send from your Ultra Web Hosting domain...

How can I report someone that is spamming me?

Email & Webmail | Updated November 2026 If you are receiving spam or someone is using...



Save 30% on web hosting - Use coupon code Hosting30