Hello Conor Daly,
on Sat, Nov 11, 2000 at 02:30:15PM +0000, Conor Daly wrote:
> mutt do it automatically or set up some macro to do it (can I execute a
> shell script with a macro and what do I use to pass the current mailbox
> name to the script?).
Warning: this mail contains bad english and insane mutt-configuration :-)
Yes, having a more scriptable mutt would be very nice (there are some
slang-patches for pre-1.0-mutts, but I think they aren't maintained any
longer).
But nevertheless you can do a lot of things in mutt's configuration with
shellscripts useing backticks (like in save-hook . +companymail-`date
%m%y`). For example
folder-hook =adrA `~/.mutt/mkfrom '[EMAIL PROTECTED]'`
folder-hook =adrB `~/.mutt/mkfrom '[EMAIL PROTECTED]'`
with mkfrom looking like this:
------------------------------------------------------------
#!/bin/sh
configSenderInfo=$(cat<<EOF
set sendmail='/usr/lib/sendmail -t -oi -oem -f$1';
my_hdr From: $1;
EOF
)
echo $configSenderInfo
------------------------------------------------------------
sets my from-headers depending on the folder I'm sending the mail from
(trivial, but saves boring cut'n'paste configuration).
Without testing it, I'd say you could use the same trick for settig up your
key-macro:
macro index \en ":source ~/.mutt/dummyrc\n"
where dummyrc is
$ cat .mutt/dummyrc
save-hook adr-ill-never-use +dummyfolder`touch -m ~/Mail/existingFolder`
The real problem with mutt here is getting information about its state
(questions like "in which folder are we?"). If I haven't missed someting in
the man-pages all these neat %<anything> information is available only in
very rare contexts.
In this case I think it would be necessary/possible to put the touch in a
shellscript ("touchme") and populate (pollute) a directory with symlinks to
this script having the folder the script should touch in their names
(touchme-muttusers, touchme-girlfriendno1,....). In "touchme" you should be
able to extract the foldername from $0. Then you can have a folder-hook for
every of these mailboxes pointing to the appropriate symlink (this is a good
point to go back to the from-header-example and think about how to generate
these folder-hooks...:-) )
Ah, BTW: I think you can create the symlinks on mutt-startup with another
script called by
macro index \en ":source ~/.mutt/dummyrc`~/.mutt/mkfolderlinks`\n"
which extracts your mailboxes from your muttrc. This would also be a good
place for generating the folder-hooks (just be carefull with the \n, I think
one has to place it in the script und then output the folder-hook-lines).
Anybody awake? :-)
ciao,
markus
--
Dieses Dokument wurde elektronisch erstellt und ist auch ohne Umlaute gueltig.
PIRONET NDH
Markus Muss - Webentwickler
Theodor-Heuss-Straße 92-100 - 51149 Cologne - Germany
Phone: +49 (0)2203 935 300 - Fax: +49 (0)2203 935 3099
mailto:[EMAIL PROTECTED] - http://www.ndh.net