Re: [Exim] rewriting, redirecting, and the sendmail "+ hack"

Top Page
Delete this message
Reply to this message
Author: Noah Meyerhans
Date:  
To: exim-users
Subject: Re: [Exim] rewriting, redirecting, and the sendmail "+ hack"
--
On Fri, Jul 11, 2003 at 10:00:05PM +0200, Kirill Miazine wrote:
> > redirect:
> >     driver = redirect
> >     domains = ...
> >     local_parts = dbm;/path/to/map.db
> >     local_part_suffix = +*
> >     local_part_suffix_optional
> >     data = ${quote:\
> >             ${extract{local_part}{$address_data}}$local_part_suffix\
> >         }@${extract{domain}{$address_data}}

>
> Bummer!
>
> s/address_data/local_part_data/ in the above two lines.


Hey, cool. That certainly seems to work, and it's definitely cleaner
than the rewriting rule I was experimenting with before.

The one question I have is: Why do you use the quote operator on the
last line? That seems to double-quote the local part in the final
destination, so envelope-to ends up containing addresses like
"noahm+foo"@domain, which certainly doesn't seem right. The Exim spec
makes it clear that quote needs to be used if $local_part is in the
expansion string somewhere, but it isn't present here. Removing the
quote operator seems to result in a proper envelope-to header.

Just for fun, here's the bits of sendmail cf code to accomplish this in
that other MTA:
R$+ + $* < @ $=w . >    $: < $(xalias $1 $@ $1 $@ +$2 $: @ $) > $1 < @ $3 . >
R$+ < @ $=w . >         $: < $(xalias $1 $@ $1 $: @ $) > $1 < @ $2 . >
R$- + $-                $: < $(xalias $1 $@ $1 $@ +$2 $: @ $) > $1 < @ $j . >
R$-                     $: < $(xalias $1 $@ $1 $: @ $) > $1 < @ $j . >
R<@> $+                 $: $1
R< error : $- $+ > $*   $#error $@ $(dequote $1 $) $: $2
R< $+ > $+ < @ $+ >     $: $>97 $1


Cute, huh?

Thanks!
noah

--
[ Content of type application/pgp-signature deleted ]
--