On Tue, Aug 04, 2009 at 12:45:38PM +0200, Rocco Rutte wrote:
> * Erik Christiansen wrote:
> > When composing an email to e.g. family, while in a list-related mailbox,
> > I'd like to temporarily reassign "Reply-To:", overriding the current
> > folder-hook. Using the manual, and experiences found on the list, I've
> > come as far as this in .muttrc:
> > 
> > send2-hook '~t t...@theirdomain\\.net\\.au' 'my_hdr  Reply-To: 
> > m...@mydomain.on.net'
> > 
> > Even when I precede that with:
> > 
> > send2-hook .* 'unmy_hdr  Reply-To:'
> 
> Why send2-hook? Why not send-hook? IIRC send2-hook only triggers from
> the compose menu by editing the recipient list and/or re-editing the
> message.

Well, in the manual I'd read "send2-hook is matched every time a message
is changed, either by editing it, or by using the compose menu to change
its recipients or subject." I thought that might be useful, but have yet
to find out.

> > I've also scanned the manual for a way to use an alias or similar to
> > match a group of addresses in the hook, so any pointers on that would
> > also help an awful lot.
> 
> Mutt 1.5.12. comes with address group support. In your case it could be
> used as:
> 
>      send-hook . 'unmy_hdr Reply-To:'
>      send-hook '^~C family' 'my_hdr Reply-To: ...'
> 
> and add all addresses for the group "family" like so:
> 
>      group -group family -addr ad...@... ad...@...

Ah, grateful thanks for that. It seemed to work with '^%C family', 
but then I realised that the Reply-To: header was being changed
unconditionally. Even 'L' "list reply" no longer obeys:

folder-hook mutt.*        my_hdr  Reply-To: mutt-users@mutt.org

when these lines are present in .muttrc:

group -group family -addr o...@example.com t...@example.com

send-hook '^%C family' 'my_hdr  Reply-To: m...@example.on.net'

The folder-hook my_hdr is overridden before we enter the editor during
compose. No conditionality at all. I'll lay my hands on a newer mutt,
and try with that. 

> See http://dev.mutt.org/doc/manual.html#addrgroup on address groups.
> 
> (though for 1.5.20, these counts count for 1.5.12. onwards)

Thanks. I'd just been making do with /usr/share/doc/mutt/manual.txt

Erik

Reply via email to