A single line Regex as the only filter fails with v.long e-mail headers
It has taken me 3 months! to isolate the problem but this is the Regex that causes the problem:
when matched against All headers. When very long e-mail headers are tested the above Regex fails in the cPanel "Account level Filtering" test facility. V.long headers started to arrive in June/July 2015 - examples typically have a server names ending in: .mail.protection.outlook.com, .portsmouth.uk.ibm.com, eurprd07.prod.outlook.com, mcws-ironport3.johnlewis.co.uk, .outbound.protection.outlook.com. Obviously I can PM examples of specific headers that fail. Note that the above Regex *does* work fine for detecting recipients in 98% of e-mails. Is it my Regex code or ??? I would welcome any suggestions or feedback. My original post was here: e-mails cause a problem in non-trivial(inc.RegEx) cPanel/Exim. I got my version of cPanel from the link: cPanel User Documentation - Documentation - cPanel Documentation.
(\n(to|cc):(.*\n[ \t]){0,5}.*|^Received: from (.|\n)+[ \t]+for)[ \t]*(user1|user2)\@domain1when matched against All headers. When very long e-mail headers are tested the above Regex fails in the cPanel "Account level Filtering" test facility. V.long headers started to arrive in June/July 2015 - examples typically have a server names ending in: .mail.protection.outlook.com, .portsmouth.uk.ibm.com, eurprd07.prod.outlook.com, mcws-ironport3.johnlewis.co.uk, .outbound.protection.outlook.com. Obviously I can PM examples of specific headers that fail. Note that the above Regex *does* work fine for detecting recipients in 98% of e-mails. Is it my Regex code or ??? I would welcome any suggestions or feedback. My original post was here: e-mails cause a problem in non-trivial(inc.RegEx) cPanel/Exim. I got my version of cPanel from the link: cPanel User Documentation - Documentation - cPanel Documentation.
-
Is there a reason why you started a new thread on the same topic as that other thread? Preferably that thread you started should be continued there. 0 -
Is there a reason why you started a new thread on the same topic as that other thread? Preferably that thread you started should be continued there.
I started a new thread because my original title/description and content was a very fuzzy scenario as there were dozens of filters and dozens of Regexs in many of them - whereas... I have isolated the problem to be a single Regex in a single filter for the whole (new) account so is now tightly defined (+hopefully reproducable) and *may* actually be my error although the Regex does work 98% of the time - so hopefully isn't. The Regex seems to be OK at debuggex.com but I was hoping that someone might be a Regex wizard or have even written a better Regex that matches both the visible recipients as well as the "envelope" data as I am attempting to do in a single line so I don't have to (a) maintain a duplicate version of (user1|user2)\@domain as some of those can be too wide to see/compare and (b) use cPanel's and+or. If a moderator would like to combine the two posts then that would be OK by me but ideally the title would describe what it has taken me 3 months to isolate - i.e. the title of *this* new thread. BTW the cPanel I am using is: build=11.52.0.23 - my earlier link turned into a page title.0
Please sign in to leave a comment.
Comments
2 comments