Auteur: W B Hacker Date: À: exim users Sujet: Re: [exim] Ha: Re: How many times does router run for multiple
recipients?
vitas1@??? wrote: > Hmmm, I think I find the problem. Thanks for all pieces of advice. :-)
>
> When recipient addresses belongs to the same domain router runs only ONCE
> for this domain.
>
> So if one of recipients does NOT match the condition criteria ("condition
> failure")
> the router doesn't process the remaining recipients for THIS domain.
>
> But it WILL process recipients in another domain.
>
>
> Example:
>
> #Router configuration
> blackholes:
> # Only addr1 should be blackholed!
> condition = ${if match{$local_part}{addr1}{1}{0}}
> driver = redirect
> data = :blackhole:
> no_verify
>
>
> Assume message has 2 recipients in the same domain: addr1@??? and
> addr2@???
>
> If router "sees" addr1 first it will blackhole it (as it matches condition
> criteria) and then will process addr2.
>
> If router "sees" addr2 first it will finish it's work for this domain
> (because of "condition failure").
>
> "Unseen" option doesn't help.
>
> So situation looks a little strange: some recipients could be processed by
> router by some couldn't be -
> it depends on order in which recipient addresses are "seen" by router.
>
>
> Regards,
>
> Vitas.
Ummhh.. moving from general case to specific case.....
On re-reading, I suspect you are making an erroneous assumption about
how smtp works, based on which 'you cannot get there from here' as an
old expression goes.
w/r first or subsequent recipient...
During acl_smtp_rcpt there IS NO COPY of the message or even the 'full'
headers yet available to Exim [1]. At that stage, the sending server and
Exim are just 'negotiating' as to whether each specified recipient will
or will not be accepted.
As the servers reach agreement, the sending server is building a list.
Some addressees to be listed on the ONE message+header+attachment set
that will LATER be transmitted, possibly OTHER recipients to NOT be
listed, but rather to be given a rejection notice.
Neither server much cares about the sequential order - quite often the
list is built in reverse order of that of the composing MUA.
So -- to the extent you are trying to 'mark' a message with whether a
given recipient is the 'nth' addressee, (recipients_count or your own
flags) that will come undone once you pass to acl_smtp_data.
At that stage, having 'agreed to transfer', the sending server will, for
the first and only time [2] - hand Exim a single copy of the full
message, headers, and attachments along with the agreed list of
recipients. Though these will appear in the header, Exim actually stores
a 'working list' (and acl_m's) separate from the message itself.
Your attempt to attach info that this is the first, second, or 'nth'
addressee is meaningless to acl_smtp_data. It runs once per *message*,
not per-recipient.
What you have afterwards is akin to a 'Xerox master' in one hand, a
scrap of paper with a list of those for whom copies are desired in the
other...
..and a pad of sticky-notes (acl_m and/or X-headers) that says it is the
first, AND second ...... AND nth recipient's message. Any flags you
attempted to set up in acl_smtp_rcpt end up on the singular 'set' when
it is handed off to the router/transport sets.
Now .. there are ways to make routers 'aware' that they are handling the
first delivery of a given message (or NOT). And 'gotcha's' to go with that.
But before you go down that road - 'Gotch' number one:
- are you comfortable with the reality that the first addressee listed
when the message left the source may very well be the LAST one exim saw
on incoming? Or that attempts to deliver locally may be either in-order,
reverse-order, or neither?
BTW - if your goal is something like insuring that a 'pool' of NOC,
Helpdesk, or Customer-Service staff handle each query ONCE, AND NOT have
two folks jump on the same query while leaving others untouched, there
are other means to do that.
IMAP, sync, shared folders, and placing a copy of 'sent' in the same
folder as the incoming is cheap and cheerful. All hands see what has,
and has not, been read, replied to, and by whom.
Bill
[1] If 'pipelining' is allowed, more may have moved over the wire in
anticipation than we have yet agreed to take responsibility for
delivering. But Exim won't 'look at it' until acl_smtp_recpt has been
agreed. Should agreement not be reached for ANY reciepent, anyhtign
pipelined will be discarded. or so ISTR. We have never permitted
piplelining, nor plan to do.
[2] if the far-end is running Qmail or imitaotrs, all bets are off.
Qmail makes parallel deliveries - if you permit such - ELSE, if you
limit per-IP simultaneous connections, a succession of single
deliveries. Either way, each connection is carrying one message copy for
one recipient.