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

Re: set from don't set nothin' :-(



On Tue, Sep 30, 2003 at 10:31:26AM +0200, Andrei A. Voropaev wrote:

> On Tue, Sep 30, 2003 at 03:02:29AM -0400, David Yitzchak Cohen wrote:
> > I have a send-hook setup to change my from addy when I email lists,
> > but the change doesn't seem to take effect until the next email I send.
> > Now, TFM states that changing recipients or subject isn't immediately
> > effective, but says nothing about changing source addy.  Should it?
> > 
> > FWIW - Here are the relevant lines from my config:
> > send-hook .  'set from="dave@xxxxxxxxxxxxxx"'
> > send-hook ~l 'set from="lists@xxxxxxxxxxxxxx"'
> > 
> 
> I have  'my_hdr From: my@xxxxxxxxxx' as command for send-hook and
> everything works perfectly. To be precise
> 
> send-hook . 'unmy_hdr From'
> send-hook ~l 'my_hdr From: my@xxxxxxxxxx'

Thanks ... if that's the case, the problem is obvious: the skeleton
message has already been created when the send-hook is run.  Changing a
header (except the subject and recipients, apparently) works fine, but
changing a setting used in constructing an autogenerated header clearly
won't take effect until too late.

The only problem is that I set real_name with a whole bunch of hooks, too,
and I really don't like having to duplicate the functionality of those
hooks as well (since there are many possible combinations of realname
and emailaddy) :-(

I wonder whether something like this:
send-hook . "<shell-escape>echo dave@xxxxxxxxxxxxxx > ~/.tmp.email\n"
send-hook . "<shell-escape>echo Dave > ~/.tmp.name\n"
send-hook ~l "<shell-escape>echo lists@xxxxxxxxxxxxxx > ~/.tmp.email\n"
send-hook "some other pattern" "<shell-escape>echo Dave Cohen > ~/.tmp.name\n"
...and any other hooks for other changes, etc. would go here. . .
send-hook . "my_hdr From: `cat ~/.tmp.name` <`cat ~/.tmp.email`>'"
...is the best solution for my problem?

To be sure, it's ugly ... but having every possible combination of
name/email in a separate hook will result in _very_ ugly patterns,
as well as very many hooks.

 - Dave

-- 
Uncle Cosmo, why do they call this a word processor?
It's simple, Skyler.  You've seen what food processors do to food, right?

Please visit this link:
http://rotter.net/israel

Attachment: pgpyYaVHXKKOs.pgp
Description: PGP signature