Re: [exim] Tainting & rewrite rules

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Evgeniy Berdnikov
Datum:  
To: exim-users
Betreff: Re: [exim] Tainting & rewrite rules
On Mon, Jan 13, 2020 at 05:00:31PM +0000, Andrew C Aitchison wrote:
> On Mon, 13 Jan 2020, Evgeniy Berdnikov via Exim-users wrote:
> > *@XXX.msk.ru        ${lookup{$0}wildlsearch{/path/to/maps/XXX.msk.ru.map}{$value}{
>                 ${sg{$local_part}{_}{.}}@???}} Fcbtrf

> >

...
>
> What happens if you replace $local_part with $1, ie:
> *@XXX.msk.ru        ${lookup{$0}wildlsearch{/path/to/maps/XXX.msk.ru.map}{$value}{${sg{$1}{_}{.}}@???}} Fcbtrf
> ?


This variant leads to the same error "421 Unexpected failure" and similar
records in panic log.

However, running "exim -brw" displays anomaly:
if lookup succeeds then output is correct (with substitution from map-file),
if lookup does not succeed exim says:

2020-01-13 21:58:56.367 [171495] Rewrite of evgeniy_berdnikov@??? yielded unqualified address "evgeniy.berdnikov"
      to: evgeniy_berdnikov@???


I lead to conclusion that variables $0, $1, etc are not visible inside ${sg}.
Suprising. My experiments with "exim -be" show that those variables are
passed clean from 'match' to ${sg}, for example:

-- try $0:
exim4 -be '${if match{aa__bb}{a+(_+)b+}{${sg{$0}{_}{.}}}{NONE}}'
aa..bb

-- try $1:
exim4 -be '${if match{aa__bb}{a+(_+)b+}{${sg{$1}{_}{.}}}{NONE}}'
..

Probably there is some specific for rewriting which I do not understand.
--
Eugene Berdnikov