issues@javamail.java.net

Re: Mailserver reports two login/logouts

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Thu, 22 Oct 2009 09:50:20 -0700

Frank Schruefer wrote:
> Bill Shannon schrieb:
>> getFolder doesn't create a connection, Folder.open does.
>
> Yes, the open method is also used by the code.
> So as I see it, it boils down to the question:
>
> Is it OK for the open method to open a second connection to the
> mailserver if the POP3 protocol is used (which actually doesn't
> have folders)?
>
> If you agree this is abnormal behaviour I'll provide a testcase.

It's all a matter of how you use the APIs. Since POP3 only has the
INBOX folder, and the JavaMail API provides a much richer model of
Stores and Folders, it does its best to maintain that illusion using
the limited POP3 protocol.

Again, without knowing exactly what API calls you're making, it's
hard to say whether this is expected behavior or not. It would be
trivial to write a program that causes the behavior you're seeing.
But obviously you're expecting different behavior based on the calls
you're making. I need to know what those calls are. If you can
extract the relevant parts of your program into a simple test program,
I'd be happy to look at it and tell you what you might be doing wrong.