Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

SOLVED How to delete messages coming from a domain

Discussion in 'E-mail Discussions' started by magmatic, Jan 9, 2017.

Tags:
  1. magmatic

    magmatic Member

    Joined:
    Jan 27, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Does anybody know if it's possible to automatically delete an incoming email message, based on the From field (like from *example.com), before it even reaches the user?
     
  2. NOC_Serverpoint

    NOC_Serverpoint Well-Known Member

    Joined:
    Jul 3, 2016
    Messages:
    102
    Likes Received:
    6
    Trophy Points:
    18
    cPanel Access Level:
    Website Owner
    Hello,

    Yes, this can be done using email filters.
    --
    How to Configure Mail Filters - cPanel Knowledge Base - cPanel Documentation
    --

    Steps
    • Login to cPanel and click on Mail. Then click on the "E-mail Filtering" link.
    • To create a new email filter, click on the "Add Filter" link.
    • Select the required header field in the first drop-down list. These are the various fields in any e-mail message like 'To', 'Body' etc. For example, if you want to block emails containing certain words in the "Subject" of the message then select "Subject" in the header field.
    • Click on the required parameter in the second drop-down list. This will act on the text entered in the third field later. The option used most often is "contains" and it tests if the Subject (or other selected header) "contains" the words to be blocked or not.

      Equals - will match the text exactly (complete words only)
    • Matches regex - will match the text based on regular expression rules. Regular expressions are a powerful but complex area and you do not need to use regular expression filters mostly.

      Contains - will match the specified text in any occurrence. "Credit" will block both "Credit" and "Credit Cards".

      Begins with - will match the text only when it occurs at the beginning of a word.
      • Now you must choose what action to take on the identified emails. Enter the destination for the identified email in the Destination field box.

        There are three types of destinations:
        To destroy the e-mail type Discard (default option).
        To send the marked email to another address type the full email address.
        To send the email to a script type the full path to the script.
      • Finally, click on the Activate button.
      • In case you want to delete an email filter, later on, just login to cPanel, click on "Mail" and then on "Email Filtering". Now you can click on the "Delete" button next to the filter you want to remove.
    Regards,
     
    #2 NOC_Serverpoint, Jan 9, 2017
    Last edited by a moderator: Jan 9, 2017
  3. magmatic

    magmatic Member

    Joined:
    Jan 27, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    This is great! Thanks!

    We have thousands of domains we want to black list, so we want to manipulate this list in a better way than manually copying and pasting thousands of domains into it. Does this list live in a file somewhere that I can edit manually?

    That would be really handy.
     
  4. magmatic

    magmatic Member

    Joined:
    Jan 27, 2014
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,425
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page