Re: [exim] How to check the lookup as many times as possible…

Top Page
Delete this message
Reply to this message
Author: Henry Pootel
Date:  
To: ellen@ekrus.org, exim-users
Subject: Re: [exim] How to check the lookup as many times as possible?
I've finished...

Remember, I'm looking for messages to user@domain with subject which
begin from 1234 or 5678 or abCD

config_file.cfg:

user@domain: ^(?-i)1234 : ^(?-i)5678 : ^(?-i)abCD

exim_config_file:

my_redirect:
driver = redirect
data = :blackhole:
condition = ${filter
{${lookup{$local_part@$domain}lsearch{/etc/exim/config_file.cfg}}}
{match{$h_subject:}{$item}}}
debug_print = "HENRY: === ${filter
{${lookup{$local_part@$domain}lsearch{/etc/exim/config_file.cfg}}}
{match{$h_subject:}{$item}}} ==="

So, all messages are delivered to user@domain, but messages with
described subject are delivered to blackhole.

I think, it work.

Thanks, dear List!!!

P.S. the result of the filter will be not 'true' or '1' or 'yes', but
will be not empty. Is it ok? May be, a convertion of the filter result
to 'true' or '1' or 'yes' value will be better.




16.02.2020 20:09, ellen@??? пишет:
> More easily done in a filter, I think.
>
>> On Feb 16, 2020, at 10:51 AM, Henry Pootel via Exim-users <exim-users@???> wrote:
>>
>> Well, I remake test.txt to view
>>
>> user@domain: Hello : GoodLuck : blablabla
>> user2@domain: qwerty
>>
>> Yes? I don't know how check all of values.
>>
>> So I need to make a loop with extract of string...
>>
>> I've invented this configuration string:
>>
>> condition = ${filter {${lookup{$local_part@$domain}lsearch{/etc/exim/test.txt}}} {match{$item}{$h_subject:}}}
>>
>> Is it right way?
>>
>> Thank you!!!
>>
>>
>>
>> 16.02.2020 16:58, Jeremy Harris via Exim-users пишет:
>>> On 16/02/2020 14:31, Henry Pootel via Exim-users wrote:
>>>> condition = ${if
>>>> match{$h_subject:}{${lookup{$local_part@$domain}wildlsearch{/etc/exim/test.txt}}}}
>>>>
>>>>
>>>> File test.txt with subject templates:
>>>>
>>>> user@domain: Hello
>>>> user@domain: GoodLuck
>>>> user@domain: blablabla
>>>> user2@domain: qwerty
>>>> ....
>>>>
>>>> Of course the exim take first matched template only with key
>>>> "user@domain" - "Hello". Next pairs are ignored at all.
>>> You could have a single line for each account, with a list of strings -
>>> and then interpret the list using Exim's list-handling string
>>> expansions.
>>> Or you could used a real database rather than a file.
>>
>> --
>>
>> === Henry Pootel ===
>>
>> --
>> ## 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/
>
> Ellen Van Landingham
> —
> mailto: ellen@???
>
>
>


--

=== Henry Pootel ===