On Tue, 22 Jun 2010 09:23:53 -0400 John Jetmore wrote: > On Tue, Jun 22, 2010 at 5:51 AM, Dave Evans > <[email protected]> wrote: > > On Mon, Jun 21, 2010 at 02:38:37PM +0300, Nikita Koshikov wrote: > >> Hello exim experts, > >> > >> I need exim to rewrite addresses like: <u...@domain*admin> to the form > >> <u...@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 ? > > > > Well on my box, rewriting aside, > > > > # exim4 -brw '[email protected]*admin' > > Syntax error in [email protected]*admin > > Malformed address: *admin may not follow [email protected] > > > > Since [email protected]*admin isn't a valid address (on account of "*" not > > being > > allowed in domain names), it looks to me like you're going to have a really > > hard time making it work. > > Dave's right, though it took me a few minutes to prove it to myself. > I thought the "Malformed address" error was lingering from other > checks, but it seems to be core to rewriting. The address won't even > be considered if it's invalid like that. For instance, this logically > behaves the way you want, rewriting both the SMTP and Message headers > when tested against user*[email protected]. > > \N^(.*)\*admin(.*)?$\N $1$2 Sh > > However, when tested against [email protected]*admin, the SMTP-time > rewrite works because it is defined as not caring about the syntax. > However, it looks like exim's concept of what a domain is is so > ingrained that it doesn't recognize [email protected]*admin as a valid > email and therefore never even attempts to apply a rewrite rule to it. > I did prove to myself that the one rule/two rule thing is a red > herring - it doesn't work because, in header rewrites, exim doesn't > see it as an email address. > > I don't really understand whether this is a bug or not. My initial > impression is that, in address rewriting, this is the correct behavior > because it's not actually an address. I wonder if any of the more > generic rewriting functionality available in routers and transports > might be of more use to you.
Thanks John, for time you spent checking and clearing this. I will try try transport section, but it's not so handy as global rewrite for me. -- ## 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/
