On 09/23/2010 03:48 PM, Victor Duchovni wrote:
> On Thu, Sep 23, 2010 at 03:36:27PM +0200, Alexander 'Leo' Bergolth wrote:
>> When the owner- alias IS configured correctly, HOW is delivery
>> distributed to multiple processes?
>
> See the deliver_indirect() code. A new message is put in the queue,
> via cleanup(8). The mail logs typically show:
>
> postfix/local[pid]: old-queue-id: to=<alias>, ... forwarded as
> <new-queue-id>
>
> The code is in indirect.c and forward.c.
OK, now I know why my messages are not requeued.
First of all: The owner- alias IS REALLY set up correctly. :-)
But if members of the list are aliases themselves, requeuing via cleanup
won't work for them. Unfortunately, this is currently the case for my
recipients.
That's because deliver_switch() (with the correct owner- address set)
first calls deliver_alias(), which resolves the alias (which in my case
points to itself). But deliver_alias() also clears the owner attribute!
Then control flow returns back to deliver_switch(), but the owner-
address is still cleared.
... and the following condition won't match:
-------------------- 8< --------------------
if (state.msg_attr.owner != 0
&& strcasecmp(state.msg_attr.owner, state.msg_attr.user) != 0)
return (deliver_indirect(state));
-------------------- 8< --------------------
Here is the control flow that leads to the problem:
-------------------- 8< --------------------
deliver_recipient[9]: local rk recip [email protected] exten deliver
[email protected] exp_from rk
been_here: recipient 9 [email protected]: 0
[...]
owner: [email protected]
^^^^^^^^^^^^^^^ correctly set
[...]
deliver_switch[10]: local lhock recip [email protected] exten deliver
[email protected] exp_from rk
deliver_alias[11]: local lhock recip [email protected] exten deliver
[email protected] exp_from rk
-> finds lhock in ldap-aliases (lhock is an alias for itself)
-> resets msg_attr.owner (calls RESET_OWNER_ATTR)
deliver_resolve_tree[12]: local lhock recip [email protected] exten
deliver [email protected] exp_from lhock
deliver_recipient[13]: local lhock recip [email protected] exten
deliver [email protected] exp_from lhock
been_here: recipient 13 [email protected]: 0
[...]
owner: null
^^^^^^^^^^^ owner is cleared now
deliver_switch[14]: local lhock recip [email protected] exten deliver
[email protected] exp_from lhock
deliver_alias[15]: local lhock recip [email protected] exten deliver
[email protected] exp_from lhock
-> deliver_indirect() should be called here but owner is now null
deliver_dotforward[15]: local lhock recip [email protected] exten
deliver [email protected] exp_from lhock
-------------------- 8< --------------------
This means that requeuing via cleanup(8) doesn't work for destination
addresses that are aliases. (Which is bad.)
For those recipients, delivery is done by the same local(8) process,
that's why I didn't see different queue ids.
Cheers,
--leo
--
e-mail ::: Leo.Bergolth (at) wu.ac.at
fax ::: +43-1-31336-906050
location ::: IT-Services | Vienna University of Economics | Austria