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

Re: folder-hook in my .muttrc doesn't work



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday, June  2 at 12:29 PM, quoth Rudolf Bahr:
>folder-hook     +fanciulla/lisa       'set use_from=no'
>folder-hook     +fanciulla/lisa       'unmy_hdr *'
>folder-hook     +fanciulla/lisa       'my_hdr     From: thats-me@xxxxxxxxxxxxx'

Those three should work fine.

>folder-hook     +fanciulla/lisa       'my_hdr       To: lisa@xxxxxxxxxxxxx'
>folder-hook     +fanciulla/lisa       'my_hdr      Fcc: 
>=fanciulla/lisa'

Those two won't do anything (well... they will, but not what you 
expect). First of all, every time you compose a message, mutt asks you 
who the recipient is. Setting a To: header ahead of time doesn't 
change that, so whatever To: header you had set before will get 
overwritten. Secondly, the Fcc: setting isn't a *header*, it's a 
*setting* (that mutt displays in the compose screen as if it was a 
header). Here's how you'd do it the "right" way:

     folder-hook +fanciulla/lisa 'set record="=fanciulla/lisa"'

>folder-hook     +fanciulla/lisa       'my_hdr Reply-To: 
>thats-me@xxxxxxxxxxxxxxxxxxx'

That's another one that mutt often generates at compose-time (just 
like the "To:" header) and overwrites any previous settings. For 
example, mutt obeys the environment variable REPLYTO.

> Hopelessly, it doesn't work. if I answer to an e-mail in this 
> folder, I still allways have to correct some of the header fields. 

*answer* email (r), as opposed to compose new email (m)? If you're 
*replying* to email (r), then the recipient (To:) is set based on the 
message you're replying to.

What exactly are you trying to achieve?

Keep in mind, these hooks are only triggered when you enter the 
folder. If you have other hooks that override them (such as send-hooks 
or reply-hooks or message-hooks), they will not be re-triggered until 
you re-enter the folder.

~Kyle
- -- 
Suppose ye that I am come to give peace on earth? I tell you, Nay; but 
rather division: For henceforth there shall be five in one house 
divided, three against two, and two against three. The father shall be 
divided against the son, and the son against the father; the mother 
against the daughter, and the daughter against the mother; the mother 
in law against her daughter in law, and the daughter in law against 
her mother in law.
                       -- Prince of Peace, Jesus Christ (Luke 12:51-53)
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iEYEARECAAYFAkhD/lUACgkQBkIOoMqOI15TMQCgg8KKrpfe1srdiQyPGeBMPk4V
f8QAoNG85Z3RNne7p6Mka1aKXQMVlYnj
=T3JL
-----END PGP SIGNATURE-----