Re: [exim] unseen deliver with with different subjects

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Ian FREISLICH
Dátum:  
Címzett: Matthew Byng-Maddick
CC: exim-users
Tárgy: Re: [exim] unseen deliver with with different subjects
Matthew Byng-Maddick wrote:
> On Tue, Nov 15, 2005 at 03:43:22PM +0000, N. T. wrote:
> > Hi,
> >
> > I'm trying to apply an exim filter to send one mail to two different adress

es but with different subjects
> > My filter looks like this :
> > if $h_Cc: contains "@" and $h_subject: matches "([0-9a-zA-Z ,!]*) (<([0-9]*

)>) (<TOKEN>) (\[[0-9]+\])" then
> > headers remove subject
> > headers add "Subject: <Ref$3> $1"
> > unseen deliver $h_Cc:
> > headers remove subject
> > headers add "Subject: $1 $2 $4 $5"
> > headers remove cc
> > endif
> >
> > I was expecting that the mail sent to $h_Cc: contains the subject "<Ref$3>

$1", but unfortunnately it's the second one ("$1 $2 $4 $5"). Can anybody explai
n me why ?
> >
> > Any help would be really appreciated...
> > Nicolas.
> >
> > PS : I'm running Exim 3.35.
>
> This behaviour hasn't changed significantly between the 3 year old version
> you are running, and the current version (4.54).
>
> The reason that this happens is that the "unseen deliver" tells the filter
> to add this address to the delivery list, not to "deliver it right now".
> When you come to deliver the message, all of the header processing happens,
> and then the message gets delivered to its recipients.


Well maybe, but what you've said is slightly amiguous. "deliver"
tells the filter to add this address to the delivery list, not to
"deliver it right now". "unseen" tells exim not to count that
delivery as a significant delivery. If a filter (or router) sets
up no significant deliveries, routing does not stop at that router
but rather continues onto the next one.

The answer to the OP's question is that headers are modified
immediately, but deliveries do not happen immediately. Once all
routing has completed for the message and the transports have been
set up, the message is delivered by those transports. The message
with the set of headers as modified at the end of the filter.

As I see it, the only way to do what you appear to want to do is
to generate a *new* message using the 'mail' command, but even this
may be unsatisfactory due to the loss of original header data and
the size limit on the $message_body expansion variable.

There must be a way to do what you want, I just can't think of it
at the moment.

Ian

--
Ian Freislich