Block Email With Certain Subject

Sash

Well-Known Member
Feb 18, 2003
252
0
166
Does anyone know how to get Exim to block ALL email coming into the server with a certain subject?

Thanks
MIke

cPanel.net Support Ticket Number:
 

ciphervendor

Well-Known Member
Aug 26, 2002
1,050
0
166
When you say server, do you mean for a specific domain or for all domains on the server?

cPanel.net Support Ticket Number:
 

Sash

Well-Known Member
Feb 18, 2003
252
0
166
Hi

ALL domains on the server.

Thanks
MIke

cPanel.net Support Ticket Number:
 

ciphervendor

Well-Known Member
Aug 26, 2002
1,050
0
166
edit /etc/antivirus.exim
scroll all the way to the bottom
add:
Code:
if
  $header_subject: contains "SUBJECT-LINE" or
 then
  save /dev/null
endif
Save, close & restart exim.

cPanel.net Support Ticket Number:
 

ciphervendor

Well-Known Member
Aug 26, 2002
1,050
0
166
mmm we don't want to have to write transports just to pipe mail into /dev/null. If you want to, use the above. If not, use the following:
Code:
if      
  $header_subject: contains "SUBJECT-LINE"
then
  fail text "Your mail is not welcome."
 seen finish
endif
 
Last edited:

Sash

Well-Known Member
Feb 18, 2003
252
0
166
I get this error inside the /var/log/exim_mainlog:

2003-08-12 18:06:11 19md7Y-0003N5-2T Error in system filter: unrecognized condition word "or" near line 135 of filter file
2003-08-12 18:06:11 19md2R-0002wr-0s Error in system filter: unrecognized condition word "or" near line 135 of filter file
2003-08-12 18:06:11 19md2j-000330-5D Error in system filter: unrecognized condition word "or" near line 135 of filter file
2003-08-12 18:06:11 19md2h-00032U-1P Error in system filter: unrecognized condition word "or" near line 135 of filter file
2003-08-12 18:06:11 19md2l-00033e-4C Error in system filter: unrecognized condition word "or" near line 135 of filter file

We want the filter to delete email based on mutliple subjects which why we are trying to use "or".

Thanks
Mike

cPanel.net Support Ticket Number:
 

ciphervendor

Well-Known Member
Aug 26, 2002
1,050
0
166
****...remove the "or" from the end of this line: $header_subject: contains "SUBJECT-LINE" or

One set of rules at a time. Can't do multiple.
 

Sash

Well-Known Member
Feb 18, 2003
252
0
166
But we are trying to filter multiple subjects. Example:

$header_subject: contains "SUBJECT-LINE" or "subject-line" or "SUBJECT LINE"

Thank
Mike

cPanel.net Support Ticket Number:
 

ciphervendor

Well-Known Member
Aug 26, 2002
1,050
0
166
You can't. You need to do one at a time:
Code:
if      
  $header_subject: contains "SUBJECT-LINE-ONE"
then
  fail text "Your mail is not welcome."
 seen finish
endif

if      
  $header_subject: contains "SUBJECT-LINE-TWO"
then
  fail text "Your mail is not welcome."
 seen finish
endif

if      
  $header_subject: contains "SUBJECT-LINE-THREE"
then
  fail text "Your mail is not welcome."
 seen finish
endif
cPanel.net Support Ticket Number:
 

ciphervendor

Well-Known Member
Aug 26, 2002
1,050
0
166
You can always do a little string expansion if it helps:
Code:
if      
  $header_subject: matches "[S|s][U|u][B|b][J|j][E|e][C|c][T|t]"
then
  fail text "Your mail is not welcome."
 seen finish
endif
cPanel.net Support Ticket Number:
 

goodmove

Well-Known Member
May 12, 2003
643
4
168
Originally posted by Sash
Does anyone know how to get Exim to block ALL email coming into the server with a certain subject?
I can't think of a subject line that I would want to filter out for every single domain ... Can you give one example?
 
Last edited:

ciphervendor

Well-Known Member
Aug 26, 2002
1,050
0
166
Re: Re: Block Email With Certain Subject

Originally posted by goodmove
I can't think of a subject line that I would want to filter out for every single domain ... Can you give one example?
"Keep your nose out of other peoples business."

cPanel.net Support Ticket Number:
 

goodmove

Well-Known Member
May 12, 2003
643
4
168
Originally posted by ciphervendor
"Keep your nose out of other peoples business."
Or how about: "Keep your mouth shut when your opinion is not requested!"
 

ciphervendor

Well-Known Member
Aug 26, 2002
1,050
0
166
Re: Re: Block Email With Certain Subject

Originally posted by goodmove
Or how about: "Keep your mouth shut when your opinion is not requested!"
Impossible, you would have to escape the exclamation point--because we all (well almost all of us) know it's a reserved symbol. Try again son.

cPanel.net Support Ticket Number:
 

goodmove

Well-Known Member
May 12, 2003
643
4
168
Originally posted by ciphervendor
Impossible, you would have to escape the exclamation point--because we all (well almost all of us) know it's a reserved symbol. Try again son.
So humorous my boy...! Would you kindly accept a soother to keep both your mouth and your hostile covert opinions to your own self?

Or alternatively, you are gracefully invited to continue pouring your venom by means of a PM....
 

Website Rob

Well-Known Member
Mar 23, 2002
1,501
1
318
Alberta, Canada
cPanel Access Level
Root Administrator
For the message of unwanted eMail:

Begone

Simple, effective, and works so well, in such a variety of situations. ;)

cPanel.net Support Ticket Number:
 

isputra

Well-Known Member
May 3, 2003
574
0
166
Mbelitar
Now the spammer more creative. I use email blocker for subject in this thread but recently i have email with these variant subject :

- (no subject)
- approve
- your account
- etc ....

But the body of email all the same matter : How to enlarge YOUR THING :D

So how to block email with Bad Word on body of email ?

cPanel.net Support Ticket Number:
 

goodmove

Well-Known Member
May 12, 2003
643
4
168
Originally posted by Website Rob
For the message of unwanted eMail:

Begone

Simple, effective, and works so well, in such a variety of situations. ;)
:D I agree!

I have just noticed your post... sorry for the delayed reaction. ;)
 

taivu

Well-Known Member
Nov 22, 2001
65
0
306
Originally posted by ciphervendor
You can't. You need to do one at a time
Why? I have had no problems running something like this (lot s of rows snipped):

Code:
# Spamtrap
if
 $message_headers contains "spamdomain.com"
 or $header_subject: contains "VALUABLE ITEMS FOR YOUR REVIEW"
 or $header_subject: contains "FREE PAY PER VIEW"
 or $header_subject: contains "FREE ADULT MOVIES"
 or $header_subject: contains "Off V1agra"
 or $header_subject: contains "Partnership Required!"
 or $message_headers contains "The Great American Online Drugstore"
 or $message_headers contains "goldmonkeys.biz"
 or $message_headers contains "kellysoffers.com"
 or $message_headers contains "bestspecials.biz"
 or $message_headers contains "greatbizservices.com"
 or $message_headers contains "salesjet.biz"
then
 save /var/mail/spamtrap
 #or what ever action you want to take
endif
cPanel.net Support Ticket Number: