Skip to content

Email Filters

Email filters within cPanel are extremely powerful filters/actions that can execute tasks on incoming emails to your domain names. Filters can be configured to help you automate email-related actions you find yourself performing manually.

You should review the steps below. If you find yourself confused, you can look at some of the email filter examples we have.

Configuring an email filter

cPanel's email filters are a powerful tool for managing your email accounts, helping you sort and organize incoming emails based on specific criteria. These filters can be used to automatically sort emails into folders, delete spam, forward emails, and perform various other actions.

Here's a step-by-step guide on how to use cPanel email filters:

  1. Login to cPanel
  2. Navigate to either Global Email Filters or Filters. Global applies to all accounts, and Filters allows you to add individual filters.
  3. Choose or Create an Email Account to Filter, select the email account you wish to create filters for.
  4. Create a New Filter
  5. Set Filter Criteria:
    • Name: Name your filter for easy identification.
    • Rules: Define the rules for your filter. This involves specifying what the system should look for in incoming emails. For example, you can filter emails based on:
      • Sender's address
      • Subject line
      • Body content
      • Specific words or phrases
      • Spam Status
  6. You can configure multiple rules to ensure a message matches.

  7. Choose Actions for the Filter:

    • Decide what action to take when an email meets your criteria. Options include:
      • Discard message: Delete it.
      • Redirect to Email: Forward it to another email address
      • Fail with message: Prevent it from delivering, and respond with a message.
      • Stop processing rules: If it meets certain criteria, prevent it from being filtered.
      • Move the email to a specific folder: Allows you to move the message based on criteria.
      • Pipe to a program: Advanced Pipe it to a script or program.
  8. You can choose one or more actions for each filter.

  9. Save the Filter: Hit save, and the filter will now be active.

  10. After setting the criteria and actions, save the filter.
  11. It will now be active for the selected email account.

  12. Test the Filter: (Optional but Recommended): To ensure your filter is working as intended, you can send a test email that meets the criteria of your filter.

Note

Filters can also be added to individual accounts via webmail. Adding them within webmail adds it to only that single account.

Email Filter Examples

Moving all spam to the Junk folder

Here's an example filter that we configured to move all messages labeled SPAM to another folder:

Image title

Configuring a rule that says `Spam Status` `Begins With` `Yes`, & setting it to deliver to a folder allows you to move all spam to another folder (in this case .Junk)