Email filters - tests ok but fails with actual email
AnsweredI have this filter in my personal account:
From matches regex
pcloud +team.*@(?!pcloud(?:mail)?\.(?:com|email))
Deliver to folder
Stop processing rules
Note, I'm using a negative lookahead. i.e. someone proclaiming to be "pCloud Team" with domain anything but "pcloud.com", "pcloud.email", "pcloudmail.com"or "pcloudmail.email" fails. I've tested this at https://regex101.com and it works.
The thing I don't understand is, when tested with "From: pCloud Team <team@pcloud.com>" in the cpanel filter test page:
To: test@localhost
From: pCloud Team <team@pcloud.email>
Subject: test
This is a test message.
It passes and says it's bound for "Normal delivery":
Match expanded arguments: Subject = pCloud Team <team@pcloud.email> Pattern = pcloud +team.*@(?!pcloud(?:mail)?\.(?:com|email)) Condition is false: $header_from: matches pcloud +team.*@(?!pcloud(?:mail)?\\.(?:com|email))
...
...
Filtering did not set up a significant delivery. Normal delivery will occur.
But an actual email with this exact same from address is delivered to the spam folder.
What could I be missing? Why does the test work, but real life fails?
-
Hey there! I believe this is working as intended - your filter is working properly as shown in the tool, but when you perform a live test you add in the spam filtering tool as well, which doesn't happen as part of the test since it's a different system.
0 -
Hi, Firstly, thank you for taking the time to comment. I appreciate it.
Secondly, I'm so sorry, I should have been clearer. When I said 'delivered to the spam folder' I actually meant that the email that passed the tests for normal delivery was delivered to the folder in the filter. It's actually a folder called '.spam.pcloud'.
I'm sure it's not being collected by the normal spam filters, as its subject is unchanged, and I have a separate filter for emails marked as spam, which comes after the problematic pcloud filter.
0 -
Thanks for that - let me look into this a bit more and I'll let you know what I find!
0 -
I'm not finding much on my end when I setup a similar test - could you create a ticket so we can investigate this directly on the machine?
0 -
Hi,
Thanks for following this up for me. Creating a ticket is not something I can do, sorry, but I will do some more investigation and let you know if I find anything else out.
I did suspect that the negative lookahead was causing a problem, but haven't had an opportunity yet to examine that further.
0 -
Hi again,
I've now had a chance to do more work on this and I've found the problem:
The regex was, in fact, working exactly as it should. The confusion was caused because there was a conflicting email filter in the Global section that I had not taken into account.
I located the problem by creating a test email account, putting one filter in it, and sending test emails while monitoring their destination.
Thanks again for your assistance providing reassurance that the filter should have worked as intended.
0 -
I'm glad to hear you were able to track this down!
1
Please sign in to leave a comment.
Comments
7 comments