<<< Date Index >>>     <<< Thread Index >>>

Re: send-hook regex



On Tue, Aug 15, 2006 at 03:56:22AM -0400, Brian Sutherland wrote:

> I am trying to use a send-hook regex with a back reference.. Is this  
> even possible?
> For example:
> send-hook ~C(.*)@(.*) my_hdr from: r.%1.%2@xxxxxxxxxxxx
> 
> When I use this it sends a literal %1 and %2 instead of what was  
> captured by (.*).

That pretty definitely won't work. I think the regexp is just the part
within the pattern itself, and AFAIK, there isn't support for backrefs.
Plus, what is mutt going to do in situations with multiple recipients?
I'm sure there are some potential workarounds - I imagine doing
something in your editor would probably be the easiest, but maybe
someone else has some other ideas.

Of course, setting the address the way you want the first time you email
someone or create an account somewhere and then setting $reverse_name
and defining $alternates properly might come close to doing what you
want.

w