How to Block Unwanted Emails in cPanel

Sometimes spam emails get through filtering software and end up in your inbox. If spam continues you could block unwanted emails using cPanel.

What you’ll need

Before you begin this guide you’ll need the following:

  • Access to cPanel account
  • Email address created via cPanel

Step 1 — Navigating to Apache SpamAssassin

Once you have successfully logged in your cPanel account, click on Apache SpamAssassin in Email section.

SpamAssasin location

Click on Configure Apache SpamAssassin.

SpamAssasin configuration button

Step 2 — Blocking unwanted email accounts

Once you are in Apache SpamAssassin configuration page you will notice multiple ways how to block spam emails.


  1. You can block specific email address, for example, . This way all emails sent from would be blocked bu emails sent from would still reach your inbox.
  2. You can also use a pattern to block all emails coming from a specific domain name. In this example all email addresses that ends in would be blocked including and .

When you have blocked all unwanted addresses click Save at the bottom of the page to save your changes.


If entered addresses were correctly formatted you will receive a confirmation that changes have been saved.


From now on all emails that are coming from email addresses that are in the blacklist will be blocked.

If you are getting spammed from various of different email accounts and different domain names you can also decrease the required_score field value. This way mail filtering would be more strict. However, note that with stricter rules you risk of missing valid emails as well which could be incorrectly identified as spam so the safest bet would be to keep score value at default 5.


You have just learned how to block unwanted emails from reaching your inbox using few simple steps.

About the author

Elvinas S.

Elvinas is a senior server administrator at Hostinger. He monitors the infrastructure’s well-being and keeps the uptime at a maximum. Besides server management, web development has always been one of his biggest passions.

Add Comment

Click here to post a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get Exclusive Content

Join thousands of webmasters who get our free newsletter with tips on how to drive more traffic and revenue to their websites!

Please wait...

Thank you for sign up!