Hi Patrick,

On Fri, May 10, 2013 at 08:34:39PM -0400, Patrick Shanahan wrote:
> * Suvayu Ali <fatkasuvayu+li...@gmail.com> [05-10-13 20:09]:
> > On Tue, May 07, 2013 at 08:28:46PM +0200, Andre Klärner wrote:
> > > 
> > > small question: why don't you use "set from=wor...@domain.com" etc?
> > 
> > As far as I'm aware, 'set from=..' and 'my_hdr From ..' serves the same
> > purpose.
>  [...]
> 
> http://dev.mutt.org/trac/wiki/MuttFaq/Header
> 
> How do I set mutt to allow editing of the From: header during composition?
> 
> The primary way to set your default sender address is through the $from
> and $realname variables in muttrc:
> 
>     set realname="Joe User" set from="user@host" set use_from=yes
>     
>     : NOTE: Another way is to use my_hdr From: but it is discouraged
>     because it has drawbacks: It breaks the $reverse_name feature, and
>     doesn't work for messages resent using the <bounce-message> function.
>     While my_hdr From: can be a convenient temporary override of the
>     default address, it is not as convenient for setting the default
>     address.

Thank you for pointing me to the wiki.  I was not aware of the caveat.
I tried the following:

  send-hook "%C work-lists" "set from=wor...@domain.com"
  send-hook "%C foss-lists" "set from=l...@gmail.com"

  folder-hook . "set from=perso...@gmail.com"

As far as I can see, this has the same effect[1] as:

  send-hook "%C work-lists" my_hdr From: wor...@domain.com
  send-hook "%C foss-lists" my_hdr From: l...@gmail.com

  send2-hook . "unmy_hdr From:"

except for one side effect.  When using `set from=...', composing a new
message leads to a new message with the From address set to the last
hook executed.  So composing *before* changing to a new folder leads to
one of my alternates in the from address.

I see that later on the wiki goes on to say:

  Note it is generally better to manipulate $from, $realname, and
  $reverse_name. The my_hdr From: override should better be reserved for
  only where it is necessary: In send-hooks. It can be useful in
  message-hooks and macros, though, for its temporary override
  nature. But handle with care, trying to avoid as much as possible its
  drawbacks.

So I'm not sure what is appropriate here.  I'll play around some more.

Thanks a lot for all the help so far.

Cheers,


Footnotes:

[1] e.g. <list-reply> works, but <reply> on a mailing list message does not


-- 
Suvayu

Open source is the future. It sets us free.

Reply via email to