FolderClosedException: * BYE JavaMail Exception: java.io.IOException: Connection dropped by server?


I'm using javamail 1.5.5 and I want to listen for new messages in a GMail mailbox.

I have an implementation of MessageCountListener, on its messagesAdded method, at the end I do:

try { // process new messages idleManager.watch(ifo); // keep watching for new messages } catch (MessagingException mex) { logger.error(".....", mex); }

I'm not sure to understand because I get that exception...

I believe that I'm doing what said here https://javamail.java.net/nonav/docs/api/com/sun/mail/imap/IdleManager.html#watch-javax.mail.Folder-

Follows some mail debug log, consider that after that exception, no new messages arrived anymore to the listner.

DEBUG IMAP: IdleManager selected 1 channels DEBUG IMAP: IdleManager selected folder: imaps://xxxxxxxxxx@imap.gmail.com:993/INBOX * 1026 FETCH (UID 4284 FLAGS (\Answered \Seen)) DEBUG IMAP: IdleManager continue watching folder imaps://xxxxxxx@imap.gmail.com:993/INBOX DEBUG IMAP: IdleManager adding imaps://xxxxxxxxx@imap.gmail.com:993/INBOX to selector DEBUG IMAP: IdleManager waiting... DEBUG IMAP: IdleManager selected 1 channels DEBUG IMAP: IdleManager selected folder: imaps://xxxxxxxxxxx@imap.gmail.com:993/INBOX DEBUG IMAP: handleIdle: set to RUNNING DEBUG IMAP: IdleManager got exception for folder: imaps://prismatest@imap.gmail.com:993/INBOX, THROW: javax.mail.FolderClosedException: * BYE JavaMail Exception: java.io.IOException: Connection dropped by server? at com.sun.mail.imap.IMAPFolder.handleIdle(IMAPFolder.java:3199) at com.sun.mail.imap.IdleManager.processKeys(IdleManager.java:370) at com.sun.mail.imap.IdleManager.select(IdleManager.java:281) at com.sun.mail.imap.IdleManager.access$200(IdleManager.java:137) at com.sun.mail.imap.IdleManager$1.run(IdleManager.java:164) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) DEBUG IMAP: IdleManager waiting...

Thanks, bye



  • FolderClosedException: * BYE JavaMail Exception: java.io.IOException: Connection dropped by server?
  • BLoC does not yield state when requesting for a location in Flutter
  • Decoupling backing store with Spring Web MVC
  • how to count horizontal values on a database?
  • Android VpnService protect socket that's stored in native code?
  • heroku and sails app | crashes and timeouts
  • Full calendar not showing inside bootstrap modal
  • Nodejs Hapi - How to enable cross origin access control
  • SQL Server unpivot multiple columns
  • How to upgrade javax.naming.* and javax.xml.* imports to be compatible with java 10
  • Heroku server error (500) when Debug = False , whitenoise could not find style.css
  • gtk TextView widget doesn't update during function
  • JSF 2 OpenJPA 2 Glassfish 3.1 WEB9031 Error
  • JavaScript Interface not working in my Android Application
  • How to detect a memory leak?
  • how to animate two continuous popup windows with jquery mobile?
  • dropdown value null when using, viewmodel & modelbinder in asp.net mvc
  • Overlaying text on video with required angle using FFMPEG
  • Keep play application running after putty terminal closed
  • Android sharing intent with google maps location and URL Shortener API
  • JSON.stringify() - Escaping Issue
  • How to show functions callback and errors on UI with bloc pattern in Flutter?
  • Using XPATH to isolate inline javascript
  • Implementing type equation generator in OCaml
  • iOS App crash issue `[UIWindow warpPoint:]`
  • Selenium Webdriver IE could not find element
  • SpringBoot don't replacen System variable {user.home} in Spring Tool Suite Version: 3.8.4.RELEA
  • Pick Out Specific Number from Array? [duplicate]
  • Arraylist of strings into one comma separated string
  • Reload Page with Javascript after Database changes
  • Ember.js + JQuery-UI Tooltip - Tooltip does not reflect the model / controller changes
  • trigger ontouch event programmatically
  • How to merge objects within array based on attribute
  • Content-Type alternative in MQTT
  • Python 3x- Compression Makes File Bigger :(
  • How to turn off notice reporting in xampp?
  • how to run ejabberd with Erlang on Heroku?
  • Capture SIGFPE from SIMD instruction
  • Python Flask - GUI for client
  • Call Microservice from another Microservice within Docker