Re: [exim] Router, once per message

Top Page
Delete this message
Reply to this message
Author: W B Hacker
Date:  
To: exim users
Subject: Re: [exim] Router, once per message
Mike Cardwell wrote:
> Hi,
>
> I'd like to run an unseen router once per message. At the moment, to
> prevent it running for each recipient, I'm doing this in my predata acl:
>
> warn set acl_m_firstrecipient = ${lc:${sg{$recipients}{,.*}{}}}
>
> And then this in the router:
>
> condition = ${if eq{$acl_m_firstrecipient}{$local_part@$domain}}
>
> Is there a "cleaner" way of doing this?
>
>


That's fairly clean as is, but..

Untested and unresearched, but probably viable:

- Exim 'has to know' as it make deliveries from queue when the *last* one has
been encountered, (even if it is also the FIRST) as only then will it delete the
message & attachment(s), headers, and stored variables from that part of the fs.

- Without having (yet) looked at either queue-as-it-is-traversed to observe a
chane, or grep'ed the code, I suspect this is triggered when the last address
has been 'used up'.

Question is how practical it would be to tap into that as either a flag (BEFORE
erasure, of course..) or as a declining count.

There may already be such a 'hook' used to prevent router looping or some such
that could be put to this purpose...

HTH,

Bill