I was under the assumption that header matches only match the single line,
The subject repeat one:
Subject: Re: Hello
Re: Hello
Wouldn't the second line become the "Re:" header?
The same with the From:/To: headers - I'm comparing the two headers - is
there a better way?
Paul
On 13/11/14 17:18, Axb wrote:
On 11/13/2014 06:07 PM, Paul Stead wrote:
Hey guys,
I've developed a few rules which seem to be hitting well, could I get
these into the sandbox?
TO_EQ_FROM_NAME will match headers that look like the following:
From: "t...@example.com" <u...@anotherdomain.com>
To: t...@example.com
----8<----
header __PDS_TO_EQ_FROM_NAME_1 ALL =~
/\nTo:\s+(?:[^\n<]{0,80}<)?([^\n\s>]+)>?\n(?:[^\n]{1,100}\n)*From:\W+(\1)([^\n\w<]++<)?((?!\1)[^\n">]++)>?\n/ism
header __PDS_TO_EQ_FROM_NAME_2 ALL =~
/\nFrom:\W+"([\w+.-]+\@[\w.-]+\.\w\w+)(?:[^\n\w<]{0,80}<)?((?!\1)[^\n">]++)>?\n(?:[^\n]{1,100}\n)*To:\s+(?:[^\n<]{0,80}<)?(\1)>?/ism
meta PDS_TO_EQ_FROM_NAME (__PDS_TO_EQ_FROM_NAME_1 ||
__PDS_TO_EQ_FROM_NAME_2)
describe PDS_TO_EQ_FROM_NAME To: name same as From: address
----8<----
Curious as to why you're using "ALL =~" instead of the specific headers?
eg:
header PDS_SUBJECT_REPEAT ALL =~ /\nSubject:\s+([^\n]+\n)(\1)/
versus
header PDS_SUBJECT_REPEAT Subject =~ /string/
afaik, would be much faster/cheaper
--
Paul Stead
Systems Engineer
Zen Internet