On 1/31/07, Stefano Bagnara <[EMAIL PROTECTED]> wrote:
robert burrell donkin wrote:
> On 1/15/07, Joachim Draeger <[EMAIL PROTECTED]> wrote:
>
> <snip>
>
>> Another important open task is to clone Mail objects for multiple
>> recipients.
>
> what's needed to do this properly?
>
> - robert

Loop over the recipients and:
----
Mail newMail = new MailImpl(mail);
newMail.setRecipients(notRecipients);
newMail.setState(originalState);
newMail.setRecipients(recipient1);
mail.getRecipients().remove(recipient1);
----

When mail remain one single message you can avoid the clone.
Remember to call ContainerUtil.dispose() on each copy.
The underlying MimeMessage is shared using a Copy-on-Write proxy.

thanks

added subtask (https://issues.apache.org/jira/browse/JAMES-772)

if no one beats me to it (i'll assign the issue to me when i start
implementing) i might find time to take a look at this one in the next
week or so

- robert

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

Reply via email to