Block Email With Certain Subject On Specific Domain

keat63

Well-Known Member
Nov 20, 2014
1,961
267
113
cPanel Access Level
Root Administrator
In the specific users CPanel, you can do this in Account Level Filtering.

Maybe there's a way to modify the config file at ssh level.
 

24x7server

Well-Known Member
Apr 17, 2013
1,912
99
78
India
cPanel Access Level
Root Administrator
Twitter
Hello,

You can create a custom Exim system filter file with the following code on your server to block mail with the subject.

Code:
if
  $header_subject: contains “YOUR SUBJECT TO BLOCK“
then
  fail text “Your mail is not welcome.”
seen finish
endif
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,883
2,256
463
How can i block email with certain subject on specific domain ?
Hello :)

To clarify, are you looking for a way to block emails with a specific subject for a single account or single email account? If so, are the account or user level filter options in cPanel helpful?

Account Level Filtering

Thank you.
 

Osama Tariq

Well-Known Member
Nov 27, 2014
206
2
18
Lahore, Pakistan
cPanel Access Level
Root Administrator
Twitter
Hello,

You can create a custom Exim system filter file with the following code on your server to block mail with the subject.

Code:
if
  $header_subject: contains “YOUR SUBJECT TO BLOCK“
then
  fail text “Your mail is not welcome.”
seen finish
endif

The custom filter is not working properly, it also blocked emails with other subject.
I have created filter on this path: nano /etc/vfilters/domainname
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,883
2,256
463
it also blocked emails with other subject.
Hello :)

Could you let us know the exact filter rule you created? Also, please use the "Account Level Filtering" option in cPanel to ensure all required files are populated correctly.

Thank you.