On Thu, Sep 28, 2000 at 01:33:59AM +0300, Mikko Hänninen wrote:
> Cameron Barry <[EMAIL PROTECTED]> wrote on Tue, 26 Sep 2000:
> > I am trying to make a Macro that will reply to emails, find a specific
> > line and append to the end of it a specific string..
> 
> > I'm sure this is a simple solution, call me stupid -- but I've just gone
> > through every sample muttrc file I can find, it just seems noone has
> > made a macro like this yet.
> 
> Well, you can't do it with a Mutt macro alone, you need a little help
> from an external script.  In fact, most of the work needs to be done by
> the script.
> 
> I can see this being doable as follows:
> 
> 1) Create a script that takes a filename as an argument.  When run, it
> will change the file by finding that one line, and then add whatever you
> want to the end of it.  The script should then exit.
> 
> 2) In the index (and/or pager), create a macro that does the following:
> 
>   - set the editor command ($editor) to your script
>   - set $fast_reply (so that you don't get prompted for recipient or
>     subject, these will mess up the macro)
>   - start a reply, the <reply-message> function
>   - set the $editor back to your normal value
>   - unset $fast_reply (unless you want it on all the time)
> 
> After this, you'll be placed in the compose menu, with the modified
> message as the message text, and you can take it from there.

So, I should speak up here... I actually use mutt for this sort of
thing.  Mostly, because I need to send a few hundred signed messages,
and prefer to not retype my passphrase.  I control a build daemon via
email.

The macros I use look like this:

macro pager <f4> ":set editor=\"buildd-reply hand\"^MryyJ:source ~/.mutt-default^M"
macro index <f4> ":set editor=\"buildd-reply hand\"^MryyJ:source ~/.mutt-default^M"

# Will corrupt passphrase first time through, use ctrl-f.
macro pager <f5> ":set editor=\"buildd-reply ok\"^MrypsyJ:source ~/.mutt-default^M"
macro index <f5> ":set editor=\"buildd-reply ok\"^MrypsyJ:source ~/.mutt-default^M"

They sign and send and advance to the next message.


Now, there is something I would like to be able to do - given that I
use maildir, I would rather have the editor invoked with the original
mail file as a source and the temp file as a destination (the logs are
often 4MB, and I read the log in and then write a 1K control message
out).  Does anyone think this is reasonable, or have ideas on an
acceptable interface for it?


Dan

/--------------------------------\  /--------------------------------\
|       Daniel Jacobowitz        |__|        SCS Class of 2002       |
|   Debian GNU/Linux Developer    __    Carnegie Mellon University   |
|         [EMAIL PROTECTED]         |  |       [EMAIL PROTECTED]      |
\--------------------------------/  \--------------------------------/

Reply via email to