Lähettäjä: Jeremy Harris Päiväys: Vastaanottaja: exim-users Aihe: Re: [exim] Selecting rewriting flags based on a condition
On 11/01/18 17:53, Mike Brudenell via Exim-users wrote: > I'd like to rewrite both Envelope and header addresses if the connection is
> from an on-site IP address, but only the Envelope otherwise.
Since you have adopted the Mortal Sin (per Chapter 31, Section 1)...
> I assumed I could just change the Eh flags to something like
>
> ${if match_ip{$sender_host_address}{144.32.0.0/16} {Eh} {E}}
>
> But > So it looks like that whilst the pattern and replacement strings are
> expanded the flags aren't. (The documentation says that the pattern and
> replacement strings are expanded, but doesn't mention this for the flags.
> I'd lived in hope! :-)
>
> Does anyone know a way (ideally simple/elegant!) of achieving this
> selective rewriting?
Two separate rewrite rules; for E and h. Make the latter have a pattern
which expands to something that will only match for an on-site source;
never for off-site.
--
Cheers,
Jeremy