Setting Up Global E-mail Filters on cPanel

It is possible to mark spam e-mails as spam in your e-mail program so that subsequent e-mails from that address are delivered to your spam folder but you still need to empty your spam/junk folder from time to time. How much more satisfying if you can prevent the e-mails being delivered in the first place and bounce them back to the sender with a message such as "You are not authorised to e-mail this address" or "You do not have permission to e-mail this address".

You can do this in the cPanel Hosting panel by setting up Global Filters (applying to all domain names managed by that panel) or E-Mail Filters (applying to a specific domain name).

 

Method

Login to your cPanel and select "Global E-Mail Filters"

Click "Create New Filter"

Filter name - Give your filter a unique name eg ANILKUMAR. Click here

Rules - Complete as follows:

1. When dealing with spam from a specific free provider you need to block the entire e-mail address

Click "From", select from the drop-down "equals" and enter entire e-mail address eg: anilkumarweb110@gmail.com Click here

Actions - select from drop-down "Fail with message" and enter your message below eg: "You do not have permission to e-mail this address". Click here

All future e-mails received will be returned to sender undelivered with the Fail message.

2. When dealing with spam from a domain name e-mail address you need to block the end part of the e-mail address

Click "From", select from the drop-down "ends with" and enter the end part of the e-mail address eg: for the e-mail address ajasevu@tewizu.com you would enter tewizu.com (this means that even if the spammer e-mails you from a different user within the tewizu.com domain the e-mail will still be "bounced").

Actions - select from drop-down "Fail with message" and enter your message below eg: "You do not have permission to e-mail this addess".

All future e-mails received will be returned to sender undelivered with the Fail message.

3. If you find you are receiving a lot of spam from a particular domain extension corresponding to a country eg .ru (russia) you can block all e-mails from e-mail addresses with that country extension. Or if you receive a lot of spam from one of the "new" extensions which are particularly utilised by spammers and scammers because of their often low introductory registration fees, you can block e-mails with that extension eg .limo

Click "From", select from the drop-down "matches regex" and enter the following code below: "\.ru(\>)?$" (omit the "") replace .ru with the country codes for other countries you wish to block or the "new" domain name extensions you wish to block. All e-mails will then be blocked which have the particular e-mail extension

For a list of country and "new" domain extensions we have blocked because of excessive spam please click here

4. If you wish to block e-mails containing specific content then enter specific "word strings" by selecting in Rules "body", "contains" from the drop-down and enter the specific word string. E-mails received containing that text within the body of the e-mail will be "bounced". You can similarly block e-mails whose subject included similar text.

 

Further Reading

List of Internet Top Level Domains (wikipedia)

Original Top Level Domains

Country code top-level domains

ICANN-era generic top-level domains

 

Michael Fowler

 

Other articles by Michael Fowler:

Choosing a Webhosting company - Michael Fowler
What to consider when deciding on a webhosting company, recommendation that you consider uk based webshosting company Just Host Me.

Choosing a Webform provider - Michael Fowler
The advantages of using webforms compared with e-mail links, the features you should consider when choosing a webform provider with the recommendation that you consider Ireland based Aidaform

Free Domain names - Michael Fowler
Discussion of the Pros and Cons of Free domains, popular free domains available and their suitability for different websites.

Free E-Mail - Michael Fowler
Discussion of the inadequacies of isp e-mail addresses and the free e-mail alternatives available.

Free Hosting - Michael Fowler
The Pros and Cons of using free hosting. A review of the free hosting available in the early days of the internet (1990 - 2000) and the free hosting options available today.