Re: [exim] Help crafting a prefix-only hostname wildcard mat…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Dan_Mitton
Datum:  
To: W B Hacker
CC: exim users
Betreff: Re: [exim] Help crafting a prefix-only hostname wildcard match
Bill,

Good, glad that works. Another way would be to use match...

/usr/local/exim/bin/exim -be
> ${if

match{:tom:dick:harry:}{:${extract{1}{.}{tom.foo.bar.com}}:}{true}{false}}
true
> ${if

match{:joe:dick:harry:}{:${extract{1}{.}{tom.foo.bar.com}}:}{true}{false}}
false
> ${if

match{:joe:tom:dick:harry:}{:${extract{1}{.}{tom.foo.bar.com}}:}{true}{false}}
true

Note the extra ':' at the front and end of the list. You can't just match
for 'foo', because 'foobar' would match, so you match for ':foo:', hence
the need to start and end with ':'.

Dan



Sent by:        exim-users-bounces@???
To:     exim users <exim-users@???>
cc:      (bcc: Dan Mitton/YD/RWDOE)
Subject:        Re: [exim] Help crafting a prefix-only hostname wildcard 
match
LSN: Not Relevant
User Filed as: Not a Record


Dan_Mitton@??? wrote:
> Maybe something like:
>

*snip*

>> ${if match_local_part{${extract{1}{.}{tom.foo.bar.com}}}{true}{false}}


Thanks, Dan,

I had either forgotten (or never known) that 'match_local_part' is not
just-and-only hard-wired to look at the string separated by a '@' from
<domain>.<tld>

Testing as:

condition = ${if match_local_part{${extract{1}{.}{$sender_host_name}}} \
              {<string(1)>:<string(n)>{true}{false}}


Which seems to be working as expected - and more effciently than an
external table search, as I am looking for only a very, very few strings
(just one at present..).

Regards,

Bill


>
> Sent by:        exim-users-bounces@???
> To:     Dave Evans <exim-users-20081202@???>
> cc:     exim-users@??? (bcc: Dan Mitton/YD/RWDOE)
> Subject:        Re: [exim] Help crafting a prefix-only hostname wildcard 


> match
> LSN: Not Relevant
> User Filed as: Not a Record
>
> Have you tried something like:
>
> ${extract{1}{.}{$sender_host_name}}
>
>
>
> Sent by:        exim-users-bounces@???
> To:     exim-users@???
> cc:      (bcc: Dan Mitton/YD/RWDOE)
> Subject:        Re: [exim] Help crafting a prefix-only hostname wildcard 


> match
> LSN: Not Relevant
> User Filed as: Not a Record
>
> On Wed, Dec 31, 2008 at 04:53:28PM +0000, W B Hacker wrote:
>> Wanted:
>>
>> A match to the first suffix *only* in a $sender_host_name or
>> $sender_helo_name, regardless of presence, absence, or count of
>> subsequent suffixes, if any, or even a proper <domain>.<tld>
>>
>> Can someone please kick me w/r what I am missing?
>
> Regex?
>
>



--
## List details at http://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/