On Thu, Aug 06, 2009 at 09:35:09AM -0500, Kyle Wheeler wrote: > On Friday, August 7 at 12:04 AM, quoth Erik Christiansen: > > Well, send-hook is slightly mis-named. A more accurate name would be > compose-hook, because it's triggered whenever a new message is being > composed.
Sounds good so far, because in this case it's the composed message's headers which need to be processed by the "compose-hook". :-) > > "Also note that my_hdr commands which modify recipient headers, or > > the message's subject, don't have any effect on the current message > > when executed from a send-hook." > > Right. Here's the reasoning: the message needs to be built *before* > the send-hook triggers. For example, what would you expect the > following to do? > > send-hook '~h Reply-to:' 'my_hdr Reply-to: m...@here.com' > > When should the Reply-to header be constructed? When $edit_headers is set, it can only be fully effectively constructed on exit from the editor. > Now consider the impact of the $edit_headers setting, which allows you > to edit your email headers in your $editor. When should the send-hook > trigger, before you enter your editor or after you exit the editor? > See what I mean? That is precisely what I am attempting. Edited headers can only be seen by mutt on exit from the editor, so that's when it is able to process them. From this side of the briar patch, that seems pretty straightforward. > > If I'm allowed to infer that the statement generalises to include > > the "Reply-To:" header, then it would explain why the send-hook is > > ineffectual. > > Ineffectual for what *you* want it to do. I use send-hook for lots of > things, and it works quite well. OK, despite being a "compose-hook", send-hook does not "have any effect on the current message" in this context. I'll have to find another way to suppress the list-specific "Reply-to:" header when composing a new email. Whereas I'd thought to do it only for known recipients, it's probably just as good to clobber Reply-to: unconditionally on compose. That avoids the need to respect the edited headers. I'll give your example above a try, but not at 2 a.m. Many thanks for prodding me toward something that should work.. Erik -- If at first you don't succeed, try again. Then Quit. No use being a damn fool about it. - W.C. Fields