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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: IMAP connection failed.
 
Similar Threads
Help me please.......
connect to an IMAP server
Nonblocking socket for IMAP Client
Reading email messages
JavaMail API: how to use nonblocking sockets for IMAP?