You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by "Eric Charles (JIRA)" <se...@james.apache.org> on 2014/07/20 09:09:38 UTC

[jira] [Commented] (JAMES-1554) Matched Mail could be routed more than once

    [ https://issues.apache.org/jira/browse/JAMES-1554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14067823#comment-14067823 ] 

Eric Charles commented on JAMES-1554:
-------------------------------------

Some more background can be read on http://markmail.org/message/pyhd4wgyyheqmgbc

Could you send a mail to the dev james mailing list so we can discuss this and verify if the implementation fully maps what we expect for the mailet.
I will after document our findings;

> Matched Mail could be routed more than once
> -------------------------------------------
>
>                 Key: JAMES-1554
>                 URL: https://issues.apache.org/jira/browse/JAMES-1554
>             Project: James Server
>          Issue Type: Bug
>          Components: SpoolManager & Processors
>    Affects Versions: 3.0-beta4
>         Environment: James server 3.0-Beta4 on Win7
>            Reporter: Yin,Shiwu
>            Priority: Critical
>
> While I was debugging a mail with multiple recipients, I found that if the mail was divided into two mails by a matcher, The matched mail was routed again starting from root processor. it could lead to some unexpected results. I dig into...
> (see org.apache.james.mailetcontainer.impl.camel.MatcherSplitter line 130~140)
> {quote}
>                     mail.setRecipients(rcpts);
>                     Mail newMail = new MailImpl(mail);
>                     newMail.setRecipients(matchedRcpts);
>                     // Set a header because the matcher matched. This can be
>                     // used later when processing the route
>                     newMail.setAttribute(MATCHER_MATCHED_ATTRIBUTE, true);
>                     // add the new generated mail to the mails list
>                     mails.add(newMail);
> {quote}
> The variable newMail (a.k.a. matched mail) don't inherit state from the original mail. For example, I configured my Matcher-Mailet pair in the transport processor. the state of the original mail is *transport*, but the state of  newMail is *root*.
> (see org.apache.james.mailetcontainer.impl.camel.CamelMailetProcessor line 159~166)
> {quote}
>                     .split().method(MatcherSplitter.class).aggregationStrategy(aggr)
>                         .choice().when(new MatcherMatch()).process(mailetProccessor).end()
>                         .choice().when(new MailStateEquals(Mail.GHOST)).process(disposeProcessor).stop().otherwise().process(removePropsProcessor).end()
>                         .choice().when(new MailStateNotEquals(state)).process(stateChangedProcessor).process(completeProcessor).stop().end();
> {quote}
> The newMail could be matched by MatcherMatch, and it is going to be processed by mailetProccessor.
> The newMail could be matched by MailStateNotEquals, and it will be routed again starting from root processor.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org