Re: mutt/2192: mutt save does not use alias names?
The following reply was made to PR mutt/2192; it has been noted by GNATS.
From: Kyle Wheeler <kyle-mutt-dev@xxxxxxxxxxxxxx>
To: Mutt Developers <mutt-dev@xxxxxxxx>
Cc: bug-any@xxxxxxxxxxxxx
Subject: Re: mutt/2192: mutt save does not use alias names?
Date: Fri, 3 Mar 2006 11:17:35 -0500
--QTprm0S8XgL7H0Dt
Content-Type: text/plain; charset=cp1252; format=flowed
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Friday, March 3 at 04:12 PM, quoth zimcomm@xxxxxxxxxxx:
>There is only one thing I can't figure out...=20
>
>In elm, if you have=20
>
>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=20
>the same.
There=92s no direct macro, but you can accomplish what you=92re looking=20
for by using save-hooks. For bob, here, you can add the following to=20
your muttrc:
save-hook '~f bob.barker@xxxxxxxx' =3Dbob
It may be a little annoying because of the extra typing that comes=20
with not being automatically generated from your aliases=85
On the other hand, check this out: if you have a file that consists=20
entirely of aliases (say, ~/.aliases), and you source that file from=20
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]}' =3D${line[1]}" > ~/.alias-hooks
done < ~/.aliases
That will regenerate all the hooks you need to duplicate your elm=20
behavior every time you load up mutt.
~Kyle
--=20
The chief enemy of creativity is 'good taste.'
-- Pablo Picasso
--QTprm0S8XgL7H0Dt
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!
iD4DBQFECGwfBkIOoMqOI14RAqWLAKCus8Yfn/ORlYuSNwiaPpeOdCuFfQCYjhB/
eMyYqNAZHmuFgNPStYpLIA==
=XDxN
-----END PGP SIGNATURE-----
--QTprm0S8XgL7H0Dt--