EXIM custom filter problem/question
I'm still new to a lot of this but did much research before moving forward.
I created a custom filter to forward inbound emails for a few users.
I know the filter is activated, because I can see that it imported into /etc/cpanel_exim_system_filter
I found several variations on the following, and tried all of them, including with/without quotes, and escaping the dots in the email addresses (single, double and quad slash)
Something must be wrong in my syntax or code but I'm at a loss and would appreciate any help! Here's my last attempt (note the dotted email addresses, and altho I doubt it matters, I'm forwarding to a 2nd domain)
# Exim filter
if first_delivery
and ("$h_from:" is "user1.lastname@example1.com")
or ("$h_from:" is "user2@example1.com")
and not ("$h_X-Spam-Checker-Version:" begins "SpamAssassin")
then
unseen deliver "user1@example2.com"
endif
if first_delivery
and ("$h_from:" is "user2.lastname@example1.com")
and not ("$h_X-Spam-Checker-Version:" begins "SpamAssassin")
then
unseen deliver "user2@example2.com"
endif
if first_delivery
and ("$h_from:" is "user3.lastname@example1.com")
and not ("$h_X-Spam-Checker-Version:" begins "SpamAssassin")
then
unseen deliver "user2@example2.com"
unseen deliver "user3@example2.com"
endif
-
fwiw I think I fixed this by putting each "if" in its own custom filter file. A few successful tests so far, so fingers crossed... 0 -
Not fixed. I know it's working for the two separate filters I added with my test accounts. But it's definitely not working for one of my users. I see their outgoing email in the logs, but no filter ever kicks in. Is there something a user could do to override the custom filter? 0 -
Thanks Michael. I'm running one more test now - I changed the forwarding address on the non-working filter to be the same as one of the working filters. If that fails, I will open a ticket, because I'm out of ideas. 0 -
support ticket 12179075 After a few more tests, I learned that having 2 "unseen deliver" lines does not work on my server (and it should?) - I had this in the non-working filter. So I created local aliases for the non-working and one of the working filters - this is working for one of my test filters, but still not working for this particular user. More details in the support ticket. Thank you for any help you can offer! 0 -
In case anyone is experiencing a similar problem, this is what finally got the outgoing filter to work - I had to use $sender_address - here's the full working custom filter: # Exim filter if first_delivery and ("$sender_address:" contains "user@example.com") and not ("$h_X-Spam-Checker-Version:" begins "SpamAssassin") then unseen deliver "user2@example2.com" endif0
Please sign in to leave a comment.
Comments
6 comments