Contain_field not matching on multi line "References:" header
I'm not sure whether this is due to the header being multi-lined, or whether there's something special about the "References:" heder, but:
I have notification messages due to users replying to ServiceNow notification messages with "Reply-All", and for some strange reasons our SNow instance adding our verbatim mail addresses on "Cc:"
So I can't filter these messages by any "X-ServiceNow-..." headers, my only chance is that such replies sometimes contain some service-now.com mail IDs in the "In-Reply-To:" header, and always as one of the entries in the "References:" header.
Eg.:
References: <[email protected]>
<[email protected]>
<HK2PR0201MB214816514EAEDF63DC69125FAB519@HK2PR0201MB2148.apcprd02.prod.outlook.com>
In-Reply-To: <[email protected]>
The ones that have service-now.com in their "In-Reply-To:" are perfectly matched by this rule:
work_mail:contain_field("In-Reply-To", "service-now"):move_messages(work["Support/SNOW replies"])
But the very similar rule that just replaces "In-Reply-To" with "References" never matches anything:
work_mail:contain_field("References", "service-now"):move_messages(work["Support/SNOW replies"])
Not sure whether it really plays a role that the References header is multi line, I simply could not find any message with a single line "References" header to verify this.
Possibly the server doesn't implement searching on multi-line headers very well?
What if you try with work_mail:match_field("References", "service-now"):move_messages(work["Support/SNOW replies"])?