Make global filter under cPanel account?

VMunich

Member
May 27, 2015
7
1
3
Boston
cPanel Access Level
DataCenter Provider
Hi, I'd like to make a global filter, to put all emails containing `****SPAM****` in the Junk folder.

This works fine if I make an email filter, but then I need to make an individual filter for each email account:

Code:
headers charset "UTF-8"
if not first_delivery and error_message then finish endif
#X-MagicSpam-Spam-Global
if
 $message_headers contains "X-MagicSpam-Spam"
then
 deliver "\"$local_part+Junk\"@$domain"
endif
However, if I turn this same filter into a global filter, it doesn't work. Exim's logs return this:

Code:
testing+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+junk+j[email protected]domain.tdl
In my global filter, if I do logwrite ${local_part}\+Junk\@${domain}, it returns the intended email account, [email protected], but when the filter runs deliver ${local_part}\+Junk\@${domain}, $local_part loops +junk+ over and over and my log overflows.

What am I doing wrong? I've been looking at EXIM's documentation and trying to get this to work, but I always end up in the same outcome.

I appreciate any help, thanks
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,245
463
Hello @VMunich,

Is there any reason you prefer not to use the SpamBox feature that's included with cPanel & WHM? It's documented at:

Spam Filters - Version 74 Documentation - cPanel Documentation

Also, note the following information from the cPanel & WHM version 74 Release Notes:

In cPanel & WHM version 74, we enabled Apache SpamAssassin™ Spam Box by default. You can change this setting in the Enable Apache SpamAssassin™ Spam Box delivery for messages marked as spam (user configurable) section of WHM's Tweak Settings interface (WHM >> Home >> Server Configuration >> Tweak Settings).
Thank you.