SOLVED how to filter out emails with no subject

silverbytes

Member
May 31, 2006
15
0
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?
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
470
113
UK
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
 
Last edited:
  • Like
Reactions: cPanelMichael

silverbytes

Member
May 31, 2006
15
0
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?
Thanks. Can you tell me step by step how to do that?
 

rpvw

Well-Known Member
Jul 18, 2013
1,101
470
113
UK
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
 
  • Like
Reactions: cPanelMichael

silverbytes

Member
May 31, 2006
15
0
151
  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
Thanks!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,254
463
Hello,

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

Thanks!