Hi John,
Many thanks for the replies.
I like the idea of an ACL variable. Provided that the address hasn't
been rewritten by that time (like with routers) then that should do it
and I can use it later in a router. However, from the debug outputs I've
seen until now global rewrites happen really early in the processing
chain (it's pretty much the first thing Exim appears to do) ... but I'll
remain hopeful :)
Regarding your first suggestion, yes headers_rewrite doesn't rewrite
envelope headers whereas "To:" it does, which causes some MTAs to class
the routed mail as spam. That's one reason why I went with a global
rewrite (the other being that I couldn't get headers_rewrite to work at
first).
I'll report about the ACL variable idea.
Alex.
On 4-Jul-13 2:49 pm, John Burnham wrote:
> Ah, one thing that just occurred to me is that you can't use the E,F,T or S rewrite flags on a headers_rewrite option. So, you may have to have a redirect router that detects your local part format and then redirects the mail to the gmail address. After some messing around how about:
>
> 1) You go back to your rewrite
> 2) You use an acl variable in the rcpt acl to note when the localpart matches what you want
> 3) You have an unseen redirect router that notes the acl variable is set.
>
> So:
> Stick the rewrite rule back in as before.
> In the ACL where you are doing rcpt checking add at an appropriate place something like:
>
> warn local_parts = ^[.]\+onbehalf\$
> set acl_c1 = foo
>
> So you have an acl variable set then use that in a redirect router:
>
> Special:
> Driver = redirect
> condition = ${if !eq{acl_c1}{foo}}
> data = <whatever>
> unseen
>
>
> Does that sound reasonable to people ?
>
>
>