JavaMail POP3 folder.close() method close also store!

  • Thread starter Daniel Albisser
  • Start date
D

Daniel Albisser

Hi @ll,

I was wondering why I lose the connection to the mail store while retrieving information from it
without
calling the method store.close()! At the end I found out that the method folder.close(boolean) also
close the store!

Following you see the debug log of the JavaMail API:
C: QUIT
S: +OK POP3 server closing connection

I really have to keep the connection alive to the server to get all messages at once from the mail
store. But after closing the folder my client is disconnected :eek:(

From my point of view it is not very correct that the API close the connection to the store in the
background
that my program has implicity opened before! I expect that the connection is alive as long I
implicity call
the method store.close()!

Is there a workaround or a patch that the store won't be closed by calling the method
folder.close(boolean)???

Thanks for helping!
Greetz,
Dan
 
G

GaryM

I really have to keep the connection alive to the server to get
all messages at once from the mail store. But after closing the
folder my client is disconnected :eek:(

POP3 only supports "INBOX" as a folder, so once you have done your
thing with it and closed it there is little else you can do with
the connection. This may have been the assumption of the author,
becuase there is no concept in POP3 of a "closed" folder, or any
kind of folder for that matter.

http://java.sun.com/products/javamail/1.3/docs/javadocs/com/sun/mail/pop3/POP3Folder.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top