On Mon, Mar 29, 2010 at 08:05:26PM -0700, Gary Johnson wrote: > On 2010-03-29, Nicolas Williams <[email protected]> wrote: > > I saw in the archives that this is a bit of an FAQ, and it seems that to > > this day there's not much of an answer, sadly. > > > > The best I could do was to create an index macro that pipes the current > > message to a script that then: a) pipes stdin to formail, b) saves the > > result in a tmp file, c) starts a new instance of mutt -f that_file. Or > > perhaps using -H. But that's clearly not quite what I want, nor what > > the various users who have asked for this want. > > > > Ideas: > > > > - Add a function like <pipe-message> but which instead of piping the > > message puts the message in a temp file and then allows for expansion > > of several parameters in the command line, including: > > > > %f (the address of the sender of the message) > > %r (the To: addresses of the message) > > %c (the Cc: addresses of the message) > > %a (the To: and Cc: addresses of the message) > > %l (the To: and Cc: addresses of the message that are lists) > > %R (the Reply-To: address of the message) > > %s (the Subject: of the message, with "Re: " prefixed if not %already) > > %F (the name of the file containing the message) > > > > - Same as above but also provide a Unix domain socket/door/whatever > > that mutt can listen on for commands from the external command. The > > purpose of this is to support connection sharing and avoid having to > > re-type IMAP/SMTP passwords. The main sub-command would be to send > > the message found in a given file, and also to mark a message in a > > folder as replied. The name of the rendezvous would be set in an > > environment variable and mutt would support using it. All > > send/save/*-hooks would be applied in the primary mutt. > > > > (This is not really needed when using SASL/GSSAPI, of course. It's > > primrarily useful when there are passwords to type.) > > > > Where would I start if I was to try to implement the first of the above? > > I think you can do all of your first idea with a macro. The basic > idea is: > > 1. Set 'editor' to something like 'true'; > 2. Set 'postponed' to a tmp file; > 3. Reply to the message (which will take you immediately to the > compose menu); > 4. Postpone the reply; > 5. Reset 'postponed'; > 4. Reset 'editor'; > 5. Execute a script as you did before to start mutt on that > postponed message. > > The tricky part is, and has always been in these discussions, making > sure the 'replied' flag on the original message is set properly.
Maybe I'm missing something here, but wouldn't temporarily resetting mutt's `sendmail' variable to a custom mailer (a variation on the OP's script, perhaps) take care of the replied flag issue? -- George
