On 2008-01-11 at 09:02 +0100, Arkadiusz Miskiewicz wrote:
> Hello,
>
> I have few rewriting rules that apply to the same address:
>
> [EMAIL PROTECTED] "$h_from:" Ffs
> [EMAIL PROTECTED] "[EMAIL PROTECTED]" Ffs
>
> Now first rule fails because of:
Don't you want "${address:$h_from:}" ?
> Rewrite of [EMAIL PROTECTED] yielded unparseable address: malformed address:
> <[EMAIL PROTECTED]> may not follow [EMAIL PROTECTED] in address
> [EMAIL PROTECTED] <[EMAIL PROTECTED]>
>
> exim stops rewriting after this problem. I would like for second rule to be
> applied if first fails.
The string is expanded. So given that the rules are the same, you can
use:
[EMAIL PROTECTED] "${if def:h_from:{${address:$h_from:[EMAIL PROTECTED]" Ffs
(warning: untested and I no longer use any rewrites so am rusty on
those)
Exim quite happily uses multiple rules but you need to avoid giving it
bad rules. However, you can fail the expansion to force it to continue;
The Exim Specification, 31.6, "Rewriting replacements":
----------------------------8< cut here >8------------------------------
If the expansion is forced to fail by the
presence of "fail" in a conditional or lookup item, rewriting by the current
rule is abandoned, but subsequent rules may take effect. Any other expansion
failure causes the entire rewriting operation to be abandoned, and an entry
written to the panic log.
----------------------------8< cut here >8------------------------------
So yes, you can do:
[EMAIL PROTECTED] "${if def:h_from:{${address:$h_from:}}fail}" Ffs
[EMAIL PROTECTED] "[EMAIL PROTECTED]" Ffs
-Phil
--
## 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/