Error in system filter: malformed address "@example.com" in filter file: no local part

nshah14285

Member
May 26, 2011
12
1
53
Hello,

Variable $local_part is not working when I set the filter at the system filter level. Variable $local_part works properly when set it from cPanel user account.

Below is the filter:

At system filter : Not working set at path (/usr/local/cpanel/etc/exim/sysfilter/options/example_filter)
if ("$h_to:, $h_cc:, $h_bcc" contains "@example.com")
then
unseen deliver "${local_part}@test.example.com"
endif


From cPanel user (example.com) account : Working set at path (/etc/vfilters/example.com)
if ("$h_to:, $h_cc:, $h_bcc" contains "@example.com")
then
unseen deliver "${local_part}@test.example.com"
endif


The reason for doing this is: We have around 100 email id's and we want to copy all (incoming and outgoing) emails of each user to another server for backup purposes.
We do not want to create 100 filters for each user because of that we tried to use the Exim variable $local_part but it didn't work at the system filter level.


Is this a bug or some limitation with the system filter?
Please help.


Thanks in advance.
 
Last edited by a moderator:

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,493
1,008
313
cPanel Access Level
Root Administrator
It looks like this is the default behavior for Exim. From the docs, I see this information when configuring global filters:

"Warning: Because the system filter runs just once, variables that are specific to individual recipient addresses, such as $local_part and $domain, are not set, and the “personal” condition is not meaningful. If you want to run a centrally-specified filter for each recipient address independently, you can do so by setting up a suitable redirect router, as described in section 47.8 below."

 

nshah14285

Member
May 26, 2011
12
1
53
One more thing I have noticed that variable $h_bcc does not work in system filter.
Same variable $h_bcc works in cPanel user level filtering.

Is there a way to make it workable in system filter?


Thanks in advance.
 

cPRex

Jurassic Moderator
Staff member
Oct 19, 2014
7,493
1,008
313
cPanel Access Level
Root Administrator
I would expect the h_bcc variable to work well. I have seen other users utilize this in the past, such as in the following threads:


Can you let me know what errors you're getting when you try and use that option?