aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes IMAP connection failed. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "IMAP connection failed." Watch "IMAP connection failed." New topic
Author

IMAP connection failed.

evelyn ong
Greenhorn

Joined: Aug 03, 2010
Posts: 13
Hi,

I am trying to connect to mail server using IMAP, however sometime i do get the following errors:

javax.mail.MessagingException: * BYE Disconnected for inactivity.

How do i overcome the problem? Is there a way to keep the connection alive?
gx glix
Greenhorn

Joined: Mar 08, 2011
Posts: 2
Hi evelyn, what are you doing that takes so long after opening an imap folder?

I usually open the folder scan messages parse them insert to db and close the session.
You could create a timer task to do getmessagecount every so often but its just a dirty workaround.
why not design your app to open a connection when needed rather than open and wait for activity


GX
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: IMAP connection failed.