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

Re: problem with send-hooks



* Per Carlson on Wednesday, March 15, 2006 at 15:33:07 +0100:
> i've tried to set the From: header based on whom i send a email to
> using send-hooks. what puzzels me that the hooks seams to work
> partly, but not fully.
> 
> here is my (relevant) .muttrc:
> 
> +++
> 
> set from="Foo <foo@xxxxxxxxxxx>"
> 
> send-hook . \
>        set signature=.sig_foo; \
>        set from="Foo <foo@xxxxxxxxxxx>"
> 
> send-hook '~t "(user1|user2|user3)@.*"' \
>       set signature=.sig_bar; \
>       set from="Bar <bar@xxxxxxxxxxx>"
> 
> +++
> 
> when componing emails, the signature is correctly choosen, but the
> From: header does always show "Bar <bar@xxxxxxxxxxx>". so, of some
> reason does the regexp part work, but i can't understand why the
> "set from=" part doesn't.
> 
> i've tried replacing "set from=" with "my_hdr From: ", switching
> the order of "set sig..." and "set from", but that didn't help at
> all...

As far as I understand "set from" doesn't work with send-hooks.
And as for "my_hdr From:" my wild guess would be that you forgot
to unmy_hdr in the "."-loop ... Anyway, something like the
following at least works for me:

#v+
set from="Foo <foo@xxxxxxxxxxx>"
 
send-hook . "\
set signature=.sig_foo; \
unmy_hdr From"
 
send-hook '~t "(user1|user2|user3)@.*"' "\
set signature=.sig_bar; \
my_hdr From: Bar <bar@xxxxxxxxxxx>"
#v-

c
-- 
_B A U S T E L L E N_ lesen!  --->> <http://www.blacktrash.org/baustellen.html>