Mailing List Archive

Return Matched Condition
Hello,

If I'm running a filter file that looks for a string in the headers, is
there a variable that stores the condition when it's matched? Below is
an example of the script in question:

if $message_headers contains "Condition 1"
or $message_headers contains "Condition 2"
or $message_headers contains "Condition 3"
then
headers add (*The condition that was met*)
endif

Many Thanks!

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: Return Matched Condition [ In reply to ]
On 17/11/2021 17:13, Patrick Porteous via Exim-users wrote:
> If I'm running a filter file that looks for a string in the headers, is there a variable that stores the condition when it's matched?

Not directly. If you write that "contains" as a regex for "matches"
then the $<digit> variable are set with the results.
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/