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

Re: Order of send-hook and folder-hook options.



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

On Wednesday, October 10 at 11:00 PM, quoth Benjamin A'Lee:
>I can do a):
>
>       folder-hook .           my_hdr From: address_a
>       folder-hook =lists      my_hdr From: address_b
>
>Or, I can do b):
>
>       send-hook .             my_hdr From: address_a
>       send-hook @example.com  my_hdr From: address_c
>
>What I can't do is have both. The send-hook runs on every message, so
>overrides the configured address for the folder.

What about something like this:

     folder-hook .      my_hdr From: address_a
     folder-hook =lists my_hdr From: address_b
     send-hook '!~f address_b' 'my_hdr From: address_a'
     send-hook '~C @example.com' 'my_hdr From: address_c'

Thus, the first send-hook will only trigger if the second folder-hook 
didn't trigger (i.e. it shouldn't override your folder-hook), and the 
second send-hook will override things if your recipient is 
@example.com. You could make the second send-hook subservient to the 
folder hooks by simply adding another condition, e.g.:

     send-hook '~C @example.com !~f address_b' 'my_hdr From: address_c'

But, if send-hooks don't want to match on your currently-configured 
from address (and I see no reason why they'd be so persnickety), you 
could use a variable to gate them, like this (again, I haven't tested 
this):

     folder-hook . 'set my_stophook=no; my_hdr From: address_a'
     folder-hook =lists 'set my_stophook=yes; my_hdr From: address_b'
     send-hook . \
         '`[ $my_stophook == yes ] && echo set my_stophook || echo my_hdr From: 
address_a`'
     send-hook '~C @example.com' 'my_hdr From: address_c'

Of course, you may want to do something a little simpler, and a little 
more effective than using a folder-hook to set your return address. 
Personally, I'd do something like this:

     send-hook .            my_hdr From: address_a
     send-hook ~l           my_hdr From: address_b
     send-hook @example.com my_hdr From: address_c

~Kyle
- -- 
Look, I can surely say by now that I've got the antibodies to 
communism inside me. But when I think of consumer society, with all 
its tragedies, I wonder which of the two systems is better.
                                             -- Pope John Paul II, 1979
-----BEGIN PGP SIGNATURE-----
Comment: Thank you for using encryption!

iD8DBQFHDVWgBkIOoMqOI14RArJsAJ955XQ4lWyBM9UtBlUzTXc9S2EwHACguuN9
yJ9hH4FhTAW3j5oPiccMGpI=
=kVni
-----END PGP SIGNATURE-----