On Fri, 01 Oct 1999, David DeSimone <[EMAIL PROTECTED]> wrote:
> That's strange, because send-hook is exactly what you would use to
> accomplish this.
That's what I thought as well, but it seemed like the send hook was being
executed when the message was being sent, after the headers had been
generated. The change in From: addresses was reflected on the next message I
composed, but not the one that I'd composed that met the To: rule.
> Perhaps you could post what you tried to do.
I did on 9/28, with the subject "recipient-based hooks". It's inserted below.
Specifically #3, but advice on any question would be appreciated.
-----
Date: Tue, 28 Sep 1999 19:56:50 -0700
From: Troy Davis <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: recipient-based hooks
Greetings,
I'm trying to achieve the following 4 behaviors:
1. In the folder "stuff", use the signature file ~/.sig and the address
[EMAIL PROTECTED]
otherwise, use the default From: address and no sig
2. On any new message or replies to *@stuff.com, use the address
[EMAIL PROTECTED]
otherwise, default From: address
3. On any new message or replies From: [EMAIL PROTECTED], use the signature file
~/.sig
otherwise, no sig
4. Reply to *all* messages with the realname set to Troy Davis but using the
address that the message was sent to if it's one of my alternates -- a
halfbaked reverse_name.
Towards #1, #2, and #3, I have:
set reverse_name
set alternates=troy@(nack.net|stuff.com)
# defaults
send-hook . "unset signature"
send-hook . "set hostname='nack.com'"
# if it's To: or Cc: *@stuff.com, make it From: [EMAIL PROTECTED]
send-hook '~C stuff\.com' "set hostname='stuff.com'"
# if it's From: [EMAIL PROTECTED], use the sig
send-hook '~f troy@stuff\.com' "set signature=~/.sig"
# defaults
folder-hook . "set hostname='nack.net'"
folder-hook . "unset signature"
# if it's in the encoding folder
folder-hook =stuff "set hostname='stuff.com'"
folder-hook =stuff "set signature=~/.sig"
This has some definite inconsistencies. I think the biggest problem is that
send-hook is just that: evaluated when the message is sent. I want it to be
evaluated for the current message, when I hit reply or enter the To: address
(ie, when it puts me into the body editing).
Is there a hook like that is evaluated early enough in the message that I can
make these determinations?
I may be entirely missing something - if anyone does this or something like
it, examples are welcome.
As for #4 above, I have no idea. Do I need to code a reverse_addr?
Thanks for any help.
Cheers,
Troy
-----