Re: [exim] SMTP-time rewriting

Page principale
Supprimer ce message
Répondre à ce message
Auteur: John Jetmore
Date:  
À: Nikita Koshikov
CC: exim-users
Sujet: Re: [exim] SMTP-time rewriting
On Mon, Jun 21, 2010 at 7:38 AM, Nikita Koshikov <koshikov@???> wrote:
> Hello exim experts,
>
> I need exim to rewrite addresses like: <user@domain*admin> to the form <user@domain>.
>
> Here is the rule I made for this:
>
> \N^(.*)\*admin(.*)?$\N          $1$2 S
>
> This is working on smtp-time MAIL FROM stage as I needed, but headers doesn't touched by it.
> Adding one more rule without S flag didn't help and body headers From, Sender, etc list unrewritten data.
>
> What's wrong and how can I fix this ?


See chapter 31 on rewriting in the doc at
http://www.exim.org/exim-html-current/doc/html/spec_html/ch31.html.
Specifically 31.7, 31.8, and 31.9, which deals with rewriting flags.
I suspect that in addition to "S" you'll want "h" for "rewrite all
headers". These flags all go on the same rule-line, so it would look
something like this (I think, I didn't actually test this):

\N^(.*)\*admin(.*)?$\N          $1$2 Sh

FWIW I think that rule will match more than you expect it to if your
example is accurate. But that's a different question which you didn't
ask yet...

--John