Re: send-hook based on what alternate was used
* Sep 04 16:23 Johan Svedberg <johan@xxxxxxxxxxxxxx>:
> * Sep 04 09:28 Andrei A. Voropaev <avorop@xxxxxxx>:
> > On Wed, Sep 03, 2003 at 10:55:12PM +0200, Johan Svedberg wrote:
> > [...]
> > > I was wondering if someone can come up with a solution to a small
> > > problem of mine. What I'm looking for is a way to use send-hook's based
> > > on what From-header (i.e. which one of my $alternates) I happend use.
> > > Can this even be done?
> >
> > manual says "the send-hook's are only executed ONCE after getting the
> > initial
> > list of recipients." Which means that if your From header is set at that
> > moment then you can match it using ~f. If you set it using the same
> > send-hook
> > then probably this would work.
> >
> > send-hook special 'set my_hdr From: my@alternative'
> > send-hook '~f my@alternative' onecommand
> > send-hook '~f my@xxxxxxxxxxxxxxxx' anothercommand
>
> Ah, yes, I should be able to use ~f. However, when trying this approach
> I ran into another problem. Earlier I used these send-hook's:
>
> send-hook . "unmy_hdr From: Johan Svedberg
> <johan@xxxxxxxxxxxxxx>"
> send-hook . 'my_hdr Message-ID: <`date +"%Y%m%d%H%M%
> S"`.GA`(id; echo $$; date) | openssl md5 | cut -c 1-5`.johan@xxxxxxxxxxxxxx>'
> send-hook @cs.umu.se "my_hdr From: Johan Svedberg
> <dv03jsg@xxxxxxxxx>"
> send-hook @cs.umu.se 'my_hdr Message-ID: <`date #
> +"%Y%m%d%H%M%S"`.GA `(id; echo $$; date) | openssl md5 | cut -c
> 1-5`.dv03jsg@xxxxxxxxx>'
>
> Which worked great. However they would be greatly improved if I can get
> them to work on my From-header which sets automagically. So I tried
> this:
>
> send-hook . "unmy_hdr From: Johan
> Svedberg <johan@xxxxxxxxxxxxxx>"
> send-hook . 'my_hdr Message-ID: <`date
> +"%Y%m%d%H%M% S"`.GA`(id; echo $$; date) | openssl md5 | cut -c
> 1-5`.johan@xxxxxxxxxxxxxx>'
> send-hook "~f dv03jsg@xxxxxxxxx" 'my_hdr Message-ID: <`date #
> +"%Y%m%d%H%M%S"`.GA `(id; echo $$; date) | openssl md5 | cut -c
> 1-5`.dv03jsg@xxxxxxxxx>'
>
> Although now I get the problem that the default (.) Message-ID is used
> even when i have dv03jsg@xxxxxxxxx in my From-header. What am I missing?
Hmmm, the order is important according to the manual. But moving it
first didn't help. Are there really no ideas how to resolve this?
--
Johan Svedberg, johan@xxxxxxxxxxxxxx, http://johan.svedberg.pp.se/