On 07/18/2012 10:53 AM, Stefano Bagnara wrote:
2012/7/18 Eric Charles <[email protected]>:
Hi Tim,

SenderIsLocal is typically used in combination with ToSenderFolder.

In that case, we need to store only once the mail in the Sent Folder, but
the current mailet architecture is designed/focused on recipients, not
senders.

Matcher/Mailets will be invoked numerous times for a single mail (for all
the local recipients, and once for the remote one).

Matchers and Mailets are invoked only once for each mail. When a
Matcher returns a partial match (and ONLY on PARTIAL) then the
original mail is splitted and from that point we will have 2 different
emails that will go through the following matchers/mailets. Otherwise
you will keep working with the same original mail.


I have rechecked it, and with the current impl, it seems what Stefano describes is valid only if all recipients are local or non-local.

I have reverted the SenderIsLocal matcher to return the complete list of recpients if the sender is local.

For recipients with a mix of local and non-local, the matcher and mailet is called twice: - A first time with the complete list (if mailet/matcher in root process,) or with the local recipient (if mailet/matcher in transport processor).
- A second time with the remote recipient.

With the current impl, we end-up with 2 mails in the Sent Folder.

Of course, anyone to confirm this behaviour?

Thx, Eric

So, if you want a matcher to match based on the sender you will have
to return all the recipients in case it matches, none in case it
doesn't match (as suggested by Tim).

A matcher should only return recipients, not other addresses.


Sounds in line with docs and code.

So we endup with multiple copies of the mail in the Sent Folder.

This will not happen, unless the "saving" mailet has a loop in its logic.


There is no loop in the ToSenderFolder.

Stefano

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



--
eric | http://about.echarles.net | @echarles


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to