If you are receiving spam or phishing emails with .zip attachments, you can create an email filter in cPanel to automatically discard or quarantine messages that contain them.
Create a cPanel email filter
Go to cPanel > Email > Email Filters (for a specific account) or Global Email Filters (for all accounts). Create a filter where "Body" matches .zip and set the action to "Discard Message" or "Redirect to Folder" for review.
01. Create the Filter
- Log into cPanel > Email > Global Email Filters (applies to all accounts) or Email Filters (per account)
- Click "Create a New Filter"
- Filter Name: "Block ZIP Attachments"
- Rules: Set "Any Attachment" "contains"
.zip - Actions: Choose "Discard Message" to silently delete, or "Redirect to Folder" to send to a quarantine folder for review
- Click "Create"
Blocking all zip attachments will also block legitimate files people send you. If you receive zip files from trusted contacts regularly, consider using SpamAssassin instead (cPanel > Email > Spam Filters). SpamAssassin scores messages based on many factors, not just attachment type, so it is less likely to catch legitimate emails. See Greatly Reduce SPAM.
02. Block Other Dangerous Attachment Types
You can create similar filters for other risky file types. Add additional rules in the same filter using "or" logic:
.exe- Windows executables (almost always malware in email).scr- Screensaver files (common malware vector).js- JavaScript files (used in phishing).vbs- Visual Basic scripts.bat- Batch files
Need Help With Email Filters?
If you need a more complex filtering setup, our team can help configure rules for your specific needs.
Open a Support TicketQuick Recap
- Create a filter in cPanel > Email > Global Email Filters
- Filter on attachment type containing .zip
- Discard or redirect matching messages
- Consider SpamAssassin instead if you receive legitimate zip files
- Block .exe, .scr, .js too for broader protection
Email filtering · Last updated March 2026 · Browse all Email articles
