/** @see {@link ImapHost#copyMessage } */
public void copyMessage( long uid, ImapMailbox currentMailbox, ImapMailbox toMailbox )
throws MailboxException
{
SimpleImapMessage originalMessage = currentMailbox.getMessage( uid );
MimeMessage newMime = null;
try {
newMime = new MimeMessage( originalMessage.getMimeMessage() );
}
catch ( MessagingException e ) {
// TODO chain.
throw new MailboxException( "Messaging exception: " + e.getMessage() );
}
MessageFlags newFlags = new MessageFlags();
newFlags.setAll( originalMessage.getFlags() );
Date newDate = originalMessage.getInternalDate();
toMailbox.createMessage( newMime, newFlags, newDate);
}