Author: ashish
Date: Mon Nov 22 20:56:07 2010
New Revision: 1037883
URL:
http://svn.apache.org/viewvc?rev=1037883&view=revLog:
Bug fix. Code should not read all the message from the Inbox. Code will only fetch the newly received message. Currently it is generating log message for all the Inbox message that is of no use and unnecessarily keeps system busy.
Modified:
ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java
Modified: ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java?rev=1037883&r1=1037882&r2=1037883&view=diff==============================================================================
--- ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java (original)
+++ ofbiz/trunk/framework/service/src/org/ofbiz/service/mail/JavaMailContainer.java Mon Nov 22 20:56:07 2010
@@ -34,6 +34,7 @@ import javax.mail.Session;
import javax.mail.Store;
import javax.mail.URLName;
import javax.mail.internet.MimeMessage;
+import javax.mail.search.FlagTerm;
import javax.mail.event.StoreEvent;
import javax.mail.event.StoreListener;
@@ -301,7 +302,7 @@ public class JavaMailContainer implement
}
// get all messages
- Message[] messages = folder.getMessages();
+ Message[] messages = folder.search(new FlagTerm(new Flags(Flags.Flag.SEEN), false));
FetchProfile profile = new FetchProfile();
profile.add(FetchProfile.Item.ENVELOPE);
profile.add(FetchProfile.Item.FLAGS);