classpathx-javamail
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Classpathx-javamail] Bug in 1.1.2: Folder.search() alters Folder.mo


From: Chris Burdess
Subject: Re: [Classpathx-javamail] Bug in 1.1.2: Folder.search() alters Folder.mode (works with 1.1.1)
Date: Fri, 13 Nov 2009 07:23:22 +0000

Boris Folgmann wrote:
I've got a code that worked perfectly with mail 1.1.1 but has problems with 1.1.2.

----------------------------------------------------------------
store.connect();
Folder folder = store.getFolder("a cyrus imap folder");
folder.open(Folder.READ_WRITE);
log.info("Total messages: " + folder.getMessageCount());

Message[] msgs = folder.search(aTerm);
processMessages(msgs);
folder.expunge();
// folder.getMode() still returns Folder.READ_WRITE here

msgs = folder.search(aDifferentTerm);
// folder.getMode() now returns Folder.READ_ONLY!!
processMessages(msgs);
folder.expunge();

----------------------------------------------------------------

The second folder.expunge() throws

javax.mail.MessagingException: Folder was opened read-only
at gnu.mail.providers.imap.IMAPFolder.expunge(IMAPFolder.java: 530)

Using some more log.info() I found out that the Folder.mode is altered by the second search. I couldn't find anything in the JavaDocs that this is a regular behaviour. As it worked with the previous release, you may know what the problem could be.


The mode is only changed from a call to update(MailboxStatus, boolean). This can happen during various method calls, but not search (). Are you sure this is your complete code with respect to IMAPFolder?
--
Chris Burdess






reply via email to

[Prev in Thread] Current Thread [Next in Thread]