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 filter out emails with no subject

Discussion in 'E-mail Discussions' started by silverbytes, Aug 7, 2017.

  1. silverbytes

    silverbytes Member

    Joined:
    May 31, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    151
    I'm getting a lot of spam of emails with no subject.
    In webmail i see this subject [no subject] but in my email client the subject is empty.
    I created a rule where in subject not contains "a" and in sujcted not contains "b" and so on, but that filtered absolutely all email to trash (incluiding good email)
    How do I set up spam assasin or horde to avoid those spam with no subject?
     
  2. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    260
    Likes Received:
    76
    Trophy Points:
    28
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    Use matching on the subject line against a regex of
    Code:
    ^$
    which matches an empty string

    If you cant get it to work with spamassassin or horde, I do know they work if you set them up either as a cPanel email account filter, or as a domain global filter
     
    #2 rpvw, Aug 7, 2017
    Last edited: Aug 7, 2017
    cPanelMichael likes this.
  3. silverbytes

    silverbytes Member

    Joined:
    May 31, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    151
    Thanks. Can you tell me step by step how to do that?
     
  4. rpvw

    rpvw Well-Known Member

    Joined:
    Jul 18, 2013
    Messages:
    260
    Likes Received:
    76
    Trophy Points:
    28
    Location:
    Spain
    cPanel Access Level:
    Root Administrator
    1. Log into the cPanel account that you want to apply the filter on
    2. In the EMAIL section ether choose to make a filter for the all the accounts on the domain by clicking on the Global Email Filters, or by clicking on the Email Filters and selecting the email address you want to create a filter on.
    3. Click on the Create a New Filter button
    4. Fill in the Filter Name field (Must be a unique name)
    5. In the Rules select Subject from the first dropdown and matches regex from the second
    6. In the next field add the ^$
    7. Now choose an action to apply to the mail when the regex matches eg Discard Message
    8. Click the Create button
    9. You can then test the filter using the Filter Test facility provided or send yourself mails with and without subjects

    Hope this helps
     
    cPanelMichael likes this.
  5. silverbytes

    silverbytes Member

    Joined:
    May 31, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    151
    Thanks!
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm happy to see the solution offered was helpful. I'm marking this thread as solved.

    Thanks!
     
Loading...

Share This Page