Re: [exim] Odd delivery failure msg

Top Page
Delete this message
Reply to this message
Author: Phil Pennock
Date:  
To: John Horne
CC: Exim users
Subject: Re: [exim] Odd delivery failure msg
On 2009-09-26 at 23:55 +0100, John Horne wrote:
> Okay, after more debugging I found the problem. Our config has an 'or'
> condition containing:
>
>     {match_address {${address:$h_To:}} {${address:$h_From:}} }

>
> This is the only instance where the From: header (in fact any header) is
> used as a list, rather than an item to be looked up in a list. The
> debugging shows:


> As can be seen the From: address gets treated as two items.


Oh dear. Looks like Exim's lack of "real" arrays/lists is biting you,
when combined with a curious choice of operators.

The second parameter of ${match_address...} is a list, delimited by
default by a colon.

And a colon is valid within double-quotes as part of an email address.

The question I have is: Why are you using match_address?

match_address is geared for looking data up against an addresslist,
which typically does not come from untrusted content. It's something
like +foo from an addresslist you've defined. match_address does
pattern matches and more. Eg:

$ exim -be
> ${if match_address{foo@???}{*@example.org}}

true

You've already used the ${address:...} expansion operator to extract the
actual addresses from the headers. Surely you just want to use the eqi
comparison operator, to do a case-insensitive string match on the two?

${if eqi{${address:$h_To:}}{${address:$h_From:}}}

Regards,
-Phil