<<< Date Index >>>     <<< Thread Index >>>

Re: mutt/2192: mutt save does not use alias names?



On Friday, March  3 at 04:12 PM, quoth zimcomm@xxxxxxxxxxx:
There is only one thing I can't figure out... In elm, if you have
alias bob bob.barker@xxxxxxxx

and bob sends you mail.. when you save that mail it is saved by default a a 
folder using the alias name (bob), not bob.barker.

I can find no such config value to tickle for mutt that will permit the same.

There’s no direct macro, but you can accomplish what you’re looking for by using save-hooks. For bob, here, you can add the following to your muttrc:

   save-hook '~f bob.barker@xxxxxxxx' =bob

It may be a little annoying because of the extra typing that comes with not being automatically generated from your aliases…

On the other hand, check this out: if you have a file that consists entirely of aliases (say, ~/.aliases), and you source that file from your ~/.muttrc, you can do something sneaky like this in your muttrc:

   source ~/.aliases
   source `~/.genhooks.sh && echo ~/.alias-hooks`

Then create the script ~/.genhooks.sh that looks something like this:

   #!/bin/bash
   [ ~/.aliases -ot ~/.alias-hooks ] && exit
   rm ~/.alias-hooks
   while true; do
       read -a line
       [ $? -ne 0 ] && break
       echo "save-hook '~f ${line[2]}' =${line[1]}" > ~/.alias-hooks
   done < ~/.aliases

That will regenerate all the hooks you need to duplicate your elm behavior every time you load up mutt.

~Kyle
--
The chief enemy of creativity is 'good taste.'
                                                       -- Pablo Picasso

Attachment: pgp3PbkApCbdC.pgp
Description: PGP signature