Mail Monitoring
843830Oct 30 2006 — edited Nov 25 2006I have an application that monitors incoming mail, parses messages, and then sends replies. A couple of things:
1. An instance of the app checks incoming mail every 10 seconds.
2. For redundancy, the app runs on two separate machines but checks the same POP3 account.
What is the best strategy for performing such mail monitoring? The monitor.java demo connects to the store, opens a folder, attaches a messageCountListener, and (without ever closing the store or folder) periodically calls folder.getMessageCount(). Is that the best way, or should I be opening and closing the connections each time I check for incoming mail? Or do I have other options?