* Alexander Dahl <p...@lespocky.de> [03-10-13 13:08]:
> Hei hei, 
> 
> On Sun, Mar 10, 2013 at 07:59:01AM -0400, Patrick Shanahan wrote:
> > > >    send-hook . set from=your@emailaddy
> > > 
> > > I have this line in my send hooks:
> > > 
> > > send-hook "~C ^netz39.*@lists\\.netz39\\.de$" "my_hdr From: Alexander 
> > > Dahl <a...@netz39.de>"
> > > 
> > > Where do I put the one above, before or after? What does it actually
> > > do and why does it not affect my send hook itself?
> > 
> > You set the default "send-hook . ..." first as "send-hook" is set on the
> > *last* match when parsing the config file.  Since you only had one
> > send-hook, after it first matched, it remained "matched" until you reset
> > it by restarting mutt.  The "send-hook . ..." matches everything so the
> > second send-hook will not be matched unless it is triggered by the
> > conditions specified, and *only* for the instances where it matches.  The
> > default, "send-hook . ...", will be triggered on the next pass thru the
> > config file.
> 
> This would work for those mailing lists, but there's another problem.
> After defining my send-hooks in a file I include like this:
> 
>     source ~/.mutt/send-hooks
> 
> I set some more options:
> 
>     set reverse_name
>     set realname    = 'Alexander Dahl'
>     set from        = "p...@lespocky.de"
>     set use_from    = yes
>     alternates "lespo...@web.de|a...@netz39.de|a...@eisfair.org"
> 
> Now my previously defined send hook
> 
>     send-hook . "my_hdr From: Alexander Dahl <p...@lespocky.de>"
> 
> results in p...@lespocky.de being my from address every time where I
> could just reply and mutt chose my mail address I got the mail to as
> new from address for my reply. Is it possible to restore this
> behaviour without dropping the "default" send-hook and without having
> to write a send-hook for each and every mailing list? 

By setting the send-hook, "my_hdr From:..."? as the default, you told mutt
to use that for everything that is not matched otherwise

My default send-hook is: 
   send-hook . unmy_hdr From:
now "set from" us used unless I have another send-hook definied that
matches a particular condition.
 
> Or: can mutt somehow detect my mail address where I get the mail to on
> mailing lists and set it as from address when using (list) reply as it
> works without mailing lists where my address is directly in To or Cc?
> This is why I wrote the first send-hook, it's exactly one mailing list
> where I use another address but mutt didn't recognize this.

set reverse_name
set from = "p...@lespocky.de"
set use_from
alternates " .... "

send-hook . unmy_hdr From:
send-hook <condition> "my_hdr From: <your_choice>"


Now when you reply, mutt will use the name in the To: field to determine
which From: addr to assign, unless <condition> is met and then use
<your_choice>
 
> Bonus question while we're at it: I wrote my mutt config some years
> ago, why would I have wanted to use 'my_hdr From:
> n...@example.com' instead of 'set from=n...@example.com'?

Indeed, why would you have?

send-hook . set from = "<addr_of_your_choosing>"
send-hook <condition> "set from = <another_addr>"
// not tested or researched //

is there more than one way to "skin a cat"?
-- 
(paka)Patrick Shanahan       Plainfield, Indiana, USA      HOG # US1244711
http://wahoo.no-ip.org        Photo Album: http://wahoo.no-ip.org/gallery2
http://en.opensuse.org                           openSUSE Community Member
Registered Linux User #207535                    @ http://linuxcounter.net

Reply via email to