> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring e-mail filtering in cPanel

> Configure email filters in cPanel to block unwanted messages with these easy instructions.

This article describes how to set up e-mail filters in cPanel.

## About e-mail filters

You can use e-mail filters to block unwanted messages based upon a certain set of conditions. For example, you can specify that messages containing a certain word or phrase are deleted automatically or routed to another e-mail address. The e-mail filters that you create are cumulative: if a message passes through one filter, it can still be blocked by a subsequent filter.

There are two types of e-mail filters that you can create:

* **E-mail filters**: You can configure filters for specific e-mail accounts.

* **Global e-mail filters**: You can configure filters that apply to all e-mail accounts for a domain.

## Creating an e-mail filter

To create an e-mail filter, follow these steps:

1. Log in to cPanel.
   > 📘 Note
   >
   > If you do not know how to log in to your cPanel account, please see [this article](/docs/accessing-cpanel).

2. On the **Tools** page, in the **Email** section, do one of the following:

   * To create a filter for a specific e-mail account, click **Email Filters**:\
     ![cPanel - Email - Email Filters icon](https://static.hosting.com/kb/kb-cpanel-jupiter-email-email-filters-icon.png)

     Locate the account for which you want to add a filter, and then click **Manage Filters**.

   * To create a global e-mail filter, click **Global Email Filters**:\
     ![cPanel - Email - Global Email Filters icon](https://static.hosting.com/kb/kb-cpanel-jupiter-email-global-email-filters-icon.png)

3. Click **Create a New Filter**.

4. In the **Filter Name** text box, type the filter name.

   > 👍 Tip
   >
   > You should use a filter name that is easily identifiable so you can tell what the filter's purpose is. Also, filter names must be unique; you cannot use duplicate filter names.

5. Under **Rules**, specify the filter rules. For example, to filter e-mail messages that contain the word *buy* in the subject:

* In the first list box, select **Subject**.

* In the second list box, select **contains**.

* Type **buy** in the text box.

  > 📘 Note
  >
  > Filters use strict logic in determining how to handle messages. Make sure that your filter rules are not too broad. Otherwise, you may unintentionally block messages that you want to receive. Also, the text in rules is not case-sensitive. A rule that specifies **buy** and a rule that specifies **BUY** are equivalent.

6. Click the **+** icon to add another rule.

   > 📘 Note
   >
   > You can add as many rules as you want. For example, the sample rule in step 5 blocks all messages that contain the word **buy** in the subject. This is a very broad rule that will likely block some legitimate messages. You can add another rule that specifies the word **now** in the subject. Select **and** in the list box. The filter will now match any message that contains the words **buy** and **now** in the subject line.

7. Under **Actions**, select the action for the filter to perform if the rule conditions are matched. You can specify multiple actions. To do so, click the **+** icon to add another action.

8. Click **Create**. cPanel creates the filter.

## Testing an email filter

After you have created a filter, you should test it to make sure that it filters what you intended.

To test an email filter, follow these steps:

1. Log in to cPanel.
   > 📘 Note
   >
   > If you do not know how to log in to your cPanel account, please see [this article](/docs/accessing-cpanel).

2. On the **Tools** page, in the **Email** section, do one of the following:

   * To test a filter for a specific e-mail account, click **Email Filters**:\
     ![cPanel - Email - Email Filters icon](https://static.hosting.com/kb/kb-cpanel-jupiter-email-email-filters-icon.png)

     Locate the account for which you want to test a filter, and then click **Manage Filters**.

   * To test a global e-mail filter, click **Global Email Filters**:\
     ![cPanel - Email - Global Email Filters icon](https://static.hosting.com/kb/kb-cpanel-jupiter-email-global-email-filters-icon.png)

3. In the **Filter Test** text box, type a test e-mail message.

4. Click **Test Filter**. The **Filter Trace** **Results** page shows if any rule conditions were met, and whether or not any actions will be taken.

## Editing or deleting an email filter

After you have created a filter, you can edit it or delete it.

To edit or delete an email filter, follow these steps:

1. Log in to cPanel.
   > 📘 Note
   >
   > If you do not know how to log in to your cPanel account, please see [this article](/docs/accessing-cpanel).

2. On the **Tools** page, in the **Email** section, do one of the following:

   * To edit or delete a filter for a specific e-mail account, click **Email Filters**:\
     ![cPanel - Email - Email Filters icon](https://static.hosting.com/kb/kb-cpanel-jupiter-email-email-filters-icon.png)

     Locate the account for which you want to edit or delete a filter, and then click **Manage Filters**.

   * To edit or delete a global e-mail filter, click **Global Email Filters**:\
     ![cPanel - Email - Global Email Filters icon](https://static.hosting.com/kb/kb-cpanel-jupiter-email-global-email-filters-icon.png)

3. Under **Current Filters**, locate the filter you want to edit or delete.

* To edit the filter, click **Edit**. The **Edit a Filter** page is almost identical to the page that you use to create a filter.

* To delete the filter, click **Delete**, and then click **Delete Filter** to confirm the deletion.

## Related articles

* [Filtering incoming e-mail messages by IP address](/docs/filtering-incoming-e-mail-messages-by-ip-address)

* [Unwanted email (spam)](/docs/unwanted-e-mail-spam)

* [Managing e-mail deliverability settings](/docs/managing-e-mail-deliverability-settings)

* [E-mail Accounts](/docs/e-mail-accounts)
