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

Re: Setting 'from' in send-hook



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

On Friday, February 29 at 03:49 PM, quoth Nathan Huesken:
>I am changing my from in a send-hook. But if my .muttrc looks like 
>this in example:
>
>set from="ls@xxxxxxxxxxxxxxx"
>
>send-hook . 'from=mutt@xxxxxxxxxxxxxxx"'
>
>The first message I write is send from ls@xxxxxxxxxxxxxxx, the second from 
>mutt@xxxxxxxxxxxxxxxx

Because of the order in which mutt evaluates things. Keep in mind that 
you can create a send-hook that matches on the From header (e.g. 
send-hook '~f addr'). What that means is that mutt already used the 
$from variable before it triggered  your send-hook. And, since $from 
is persistent, your setting stuck around to affect the next message.

If you want to change the From header in a send-hook, you need to use 
my_hdr instead. Like so:

     send-hook . 'unmy_hdr From'
     send-hook foo 'my_hdr From: me@here'
     send-hook bar 'my_hdr From: me@elsewhere'

~Kyle
- -- 
The whole problem with the world is that fools and fanatics are always 
so certain of themselves, but wiser people so full of doubts.
                                                    -- Bertrand Russell
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFHyCs7BkIOoMqOI14RArzsAJ9+Icjj3S+aKwmddXB+SrAMmrt7RgCfTO21
ZB+nYKwn6zYv+i3lLOwI4zg=
=3PIF
-----END PGP SIGNATURE-----