[ http://issues.apache.org/jira/browse/JAMES-421?page=all ]

Stefano Bagnara updated JAMES-421:
----------------------------------

    Attachment: MimeMessageCopyOnWriteProxy.java

Here is a possible fix.

The attached class should be named MimeMessageWrapper and MimeMessageWrapper 
should be renamed to MimeMessageLazyLoader so we should be more backward 
compatible (most code now create MimeMessageWrapper and we want the 
copy-on-write shield since from the beginning).

Then the only change needed is update the MailImpl constructor from:
    public MailImpl(String name, MailAddress sender, Collection recipients, 
MimeMessage message) {
        this(name, sender, recipients);
        this.setMessage(message);
    }
to:
    public MailImpl(String name, MailAddress sender, Collection recipients, 
MimeMessage message) throws MessagingException {
        this(name, sender, recipients);
        this.setMessage(new MimeMessageWrapper(message));
    }

This is the constructor used in the MailImpl.duplicate, that is called by the 
LinearProcessor when splitting the messages.


> MailImpls sharing MimeMessages / LinearProcessor not cloning it after a 
> partial match.
> --------------------------------------------------------------------------------------
>
>          Key: JAMES-421
>          URL: http://issues.apache.org/jira/browse/JAMES-421
>      Project: James
>         Type: Bug
>   Components: James Core
>     Versions: 2.2.0, 2.3.0
>     Reporter: Stefano Bagnara
>     Assignee: Stefano Bagnara
>     Priority: Critical
>      Fix For: 2.3.0
>  Attachments: LinearProcessorTest.java, MimeMessageCopyOnWriteProxy.java
>
> LinearProcessor match a single recipient for a 2 recipient mail.
> it run "MailImpl.duplicate". duplicate DOES NOT clone the "MimeMessage".
> The following mailet will handle 2 different MailImpl sharing the same 
> MimeMessage.
> Attached is the proving test.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to