blog posts

How to prevent sending spam emails in cPanel

Most of us may receive a lot of spam emails daily. This can be very annoying and waste your time and energy unnecessarily. For this reason, the best thing to do in this situation is to use the filter function for such messages. CPanel, as a widely used control panel, has provided its users with the possibility of filtering spam emails. Just host implement the settings related to spam emails in your In this article, from the knowledge base of, we have decided to train on how to prevent sending spam emails in cPanel.

The topics covered in this article are as follows:

  • Filtering spam emails in cPanel
  • Step-by-step video tutorial of Global Filters in cPanel

Spam email filtering in cPanel

Receiving spam emails or emails that have no value in terms of content is one of the problems that people deal with a lot. Many of them are looking for a way to use it to filter spam emails. The good news is that popular control panels such as Direct Admin or CPanel have provided this possibility to their users to prevent sending spam emails with the help of built-in features. In the following, we will teach you step by step how to prevent sending spam emails in cPanel.

Global Filters video tutorial in cPanel

First, log in to your host’s control panel with the help of the CPanel login tutorial.

In the next step, you need to find Global Email Filters under the Email menu and click on it.

Prevent sending spam emails in cPanel

In the third step, you enter a page titled “Edit Filters For “All Mail On Your Account. On this page, as shown in the image below, click on the button Create A New Filter from the Create Filter section.

How to prevent sending spam email in cPanel

A page titled Create a New Filter for All Mail on Your Account will open for you. On this page, you must apply the settings to prevent sending spam emails in cPanel. For this purpose, you must complete the fields that are explained one by one in the following.

How to prevent sending spam emails in cPanel?

  1. Filter Name: In this section, you should write the desired name for your filter. Try to choose a name that is concrete and understandable for you.
  2. Rules: In this section, you must apply the rules you want. This section includes the following:

In the field , first, you select the part of the email that you intend to filter.

cpanel mailing list

  • From: Email sender address
  • Subject: line of the email
  • To: The address to which the sender sent the email.
  • Reply: The address from which the sender will receive replies.
  • Body: of the email
  • Any Header: Any part of the email header
  • Any Recipient: Any email recipient
  • Has Not Been Previously Delivered: cPanel will only check messages that are waiting for delivery.
  • Is An Error Message: cPanel will only check error messages that are from the automatic response system.
  • List ID: ID list
  • Spam Status: Email spam status
  • Spam Bar: Spam Bar header content
  • Spam Score: The total number of + marks on the Spam Bar.

In the second field, you select the rule or conditional expression you want. This part is used so that you can customize the first part according to the criteria you want.

Prevent receiving spam emails in cPanel

  • equals: be defined exactly according to the string.
  • matches regex: according to a regular expression that you define. (regular-expressions.info)
  • contains: contains the string defined by you.
  • does not contain: does not contain the string defined by you.
  • begins with: start with the definition string.
  • ends with: end with the definition string.
  • does not begin: does not begin with the definition string.
  • does not end with: does not end with a definition string.
  • does not match: does not exactly match the defined string.

The following 4 options can be used if Spam Score is selected in the first part:

  • is above: be greater than the number defined by you.
  • is not above: equal or less than the number defined by you.
  • is below: is less than the number defined by you.
  • is not below: be greater than or equal to the number defined by you.

In the third field , enter the words that you want the filtered emails to contain.

 

How to prevent sending in cPanel

Actions: In this section, you select the type of action you intend to apply to the filtered emails.

  • Discard Message: CPanel will reject all emails without any message.
  • Redirect to email: cPanel control panel will forward emails to the email defined by you.
  • Fail with message: All emails will be rejected by cPanel and will automatically send a failure message to the email sender.
  • Stop Processing Rules: CPanel will ignore all filter rules.
  • Deliver to folder: cPanel control panel will deliver the message to a defined folder.
  • Pipe to a program: cPanel will send received messages to a defined program.

After applying the settings, click the Create button to save the changes.

Key points about email spam in cPanel

  • Note that if you enter a similar name in the Filter Name field, this filter will be replaced by the previous filter.
  • Always use multiple small filters instead of large filters. Because this work will be effective in applying filters.
  • To ensure the correctness of the created filter, you can test your filter from the Test Filter section.
  • When you create a filter that uses multiple operators, Cpanel will process the and operator first and then the or operator.
  • In the Current Filters section, you can view and manage your previously created filters