classpathx-javamail
[Top][All Lists]
Advanced

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

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


From: Boris Folgmann
Subject: [Classpathx-javamail] Bug in 1.1.2: Folder.search() alters Folder.mode (works with 1.1.1)
Date: Wed, 11 Nov 2009 23:09:50 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; de-AT; rv:1.8.1.23) Gecko/20090916 MultiZilla/1.8.3.4e SeaMonkey/1.1.18

Hi,

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.

I also update jaf from 1.0 to 1.1.1

cu,
        boris





reply via email to

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