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}{_}{.}}@XXX.ru}} 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}{_}{.}}@XXX.ru}} > 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_berdni...@xxx.msk.ru yielded unqualified address "evgeniy.berdnikov" to: evgeniy_berdni...@xxx.msk.ru 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 -- ## 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/