[
https://issues.apache.org/jira/browse/JAMES-1554?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17409874#comment-17409874
]
Benoit Tellier commented on JAMES-1554:
---------------------------------------
I was shocked to discover just this on a customer mission!
I was unaware of this issue and of this ticket.
You would be glad to know https://issues.apache.org/jira/browse/JAMES-3589
solved this...
> 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
> Attachments: 2014-07-21_175109.png
>
>
> 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
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]