Hi,
I'm replying to an old message, I know...
Dan Lipofsky <[EMAIL PROTECTED]> wrote on Fri, 07 Apr 2000:
> I administer an ezmlm mailing list. I would like to make answering
> YES to confirm requests easier. Ezmlm encodes administrative commands
> as part of the mail address, and you confirm by replying to a special
> one time email address (placed into the Reply-To: field). I have never
> made a macro before, but this is what I would like it to do
Did you come up with this macro? There would probably be others who
would find it useful, if you've got something. :-)
Assuming that you haven't got anything yet, here's a list of the Mutt
commands to do what you want.
> * Reply to the Reply-To: address
set reply_to=yes
> * do NOT pop up the editor
I don't think there's any way to avoid Mutt executing the editor,
however you can make the editor command into something that exits
immediately. I recommend "touch" because that way Mutt won't complain
about the file not being modified. :-) So:
set editor=touch
> * unset Fcc
push "<edit-fcc><kill-line><enter>"
(or something like that)
> * construct a message with no subject and no body
Okay, this gets trickier. The way to get an empty message body is to
make sure have edit_headers unset, and then truncate the default body
to length zero. This should be easy to do with some shell script or
perl script, which then could be set to be the $editor. I'm not sure,
maybe even "set editor='cp /dev/null'" would do the trick. (The command
"cp /dev/null file" makes file size 0.) Anyway, it's pretty easy.
> * do not ask me the usual questions about subjectless messages
But the message can contain a subject, ezmlm doesn't care? So you could
just leave the default subject in place... Anyway, if you want to make
the subject empty that's done with:
push "<edit-subject><kill-line><enter>"
and to tell Mutt to not confirm empty subject:
set abort_nosubject=no
> * actually, if it is easier to put in a dummy subject than deal
> with subjectless messages, that is fine too. Subject is ignored.
Oh, right. So you did think of this. :-)
> * all effects should last just for that message
That is also a bit tricky. There's no way to "save" a state of any
variable. The only way is to just re-set everything to their defaults.
The most important thing would probably be to restore the $editor
setting. :-)
You probably need a sub-macro for establishing the defaults that is
called at the end of your main macro with the "push" command.
> Can anyone help me build this macro? Or tell me something better
> than a macro (hooks?).
I'm not sure if you can set $editor from a send-hook, but if you can
then you could probably make Mutt recognise whenever you're sending an
ezmlm approval message and not prompt you anything at all after the To:
and Subject: prompts. However those two prompts you do need to go
through, so it really might be better to set up a macro that you can
invoke with just one key and that will take care of everything.
Anyway, to put such a macro together, this probably requires a bit of
designing and some trial-and-error experimentation to get it working.
It should be perfectly doable though.
Something like this:
macro index \ea "<enter-command>source ~/ezmlm-approve.muttrc<enter>" "approve ezmlm
request"
This just sources the file ~/ezmlm-approve.muttrc, I think it's easier
to have all the commands in a separate file, than with the huge single
command line you'd end up with otherwise -- but that would work too.
The macro key \ea is Esc-a.
Here's then what would be in ezmlm-approve.muttrc:
set reply_to=yes
set editor=script_to_zero_file.sh
push "<reply><enter><enter><edit-fcc><kill-line><enter><send-message>\
<enter-command>source ~/ezmlm-approve-restore.muttrc<enter>"
You might want to also include a <delete-message> at the end of that
long push-command to delete the approve request. Here is the other
file, ezmlm-approve-restore.muttrc that restores your settings (of
course, you should substitute your own default settings here):
set reply_to=ask-yes
set editor=vi
All this is untested, I just typed it in here, but it might get you
started hopefully. :-) (Boy, after writing all this I sort of hope
you don't have that macro done yet! <g>)
Regards,
Mikko
--
// Mikko Hänninen, aka. Wizzu // [EMAIL PROTECTED] // http://www.iki.fi/wiz/
// The Corrs list maintainer // net.freak // DALnet IRC operator /
// Interests: roleplaying, Linux, the Net, fantasy & scifi, the Corrs /
We're not surrounded, we're in a target-rich environment!