On Fri, Apr 23, 2010 at 13:01:11 +0200, Jan-Herbert Damm wrote: > i have spent over an hour on a *really* simple issue and experimented wildly > but i can't find just the right spot in the manual or elsewhere. please give > me a hint on tfm: > > i have addresses "[email protected]" and "[email protected]". > i have > set from="[email protected]" > send-hook . 'set from="[email protected]"' > set use_from=yes > set envelope_from=yes > > when replying to mails sent to my adress "[email protected]" i want the from-header > to show > "[email protected]" not "[email protected]". > > jan > > ps. some of what i've tried > > # > reply-hook '~t [email protected]' 'set [email protected]' > reply-hook '.*two' 'set from="[email protected]"'
As Monte mentioned, the "reverse_name" option is probably the easiest way to do what you are trying to do. Personally, I use "reverse_name" to handle cases where I'm replying to an incoming message, but I also have set up a send-hook so that the correct From address gets set when compose new messages to certain recipient addresses. This is similar to what you tried to do above, but instead of trying to change the "from=" setting in my hook, I instead use the "my_hdr" command to set the header directly for the given message. (Note that the documentation for the "from" option mentions that a "my_hdr" setting will over-ride the "from" value.) Putting it all together, the commands to configure for your example would look something like this: set from="o...@web\.de" set use_from alternates "t...@web\.de" set reverse_name send-hook . "unmy_hdr From:" send-hook [email protected] my_hdr "From: [email protected]" Hope that helps. Nathan p.s. You didn't say what exactly happened when you tried the reply-hook commands you listed, but I'm guessing this sentence from the Mutt manual explains why they didn't do as you hoped: Note: reply-hooks are matched before the send-hook, regardless of the order specified in the users's configuration file. So I think the from= setting given in the send-hook . 'set from="[email protected]"' line will always override the one you are attempting to set in the reply-hook command.
