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.
Create a cPanel email filter
Go to cPanel then Email then Email Filters (one account) or Global Email Filters (all accounts), create a filter where an attachment contains .zip, and set the action to Discard Message or Redirect to Folder for review.
01. Create the Filter
- Log into cPanel then Email then Global Email Filters (all accounts) or Email Filters (one account).
- Click Create a New Filter and name it, for example Block ZIP Attachments.
- Rules - set Any Attachment contains
.zip. - Actions - choose Discard Message to delete silently, or Redirect to Folder to quarantine for review.
- 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 TicketFrequently 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
- Create a filter in cPanel then Email then Global Email Filters.
- Match an attachment containing .zip.
- Quarantine over discard if legitimate zips are possible.
- Add .exe, .scr, .js, .vbs, .bat for broader protection.
- Test the filter before relying on it.
Email filtering · Last updated November 2026 · Browse all Email articles
