servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lh...@apache.org
Subject svn commit: r1043046 - /servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/MailPollerEndpoint.java
Date Tue, 07 Dec 2010 13:47:29 GMT
Author: lhein
Date: Tue Dec  7 13:47:29 2010
New Revision: 1043046

URL: http://svn.apache.org/viewvc?rev=1043046&view=rev
Log:
in case of a processing error for a mail we set the original mail to UNSEEN state just for
the case the mail system automatically sets it to SEEN. (SMXCOMP-826)

Modified:
    servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/MailPollerEndpoint.java

Modified: servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/MailPollerEndpoint.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/MailPollerEndpoint.java?rev=1043046&r1=1043045&r2=1043046&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/MailPollerEndpoint.java
(original)
+++ servicemix/components/bindings/servicemix-mail/trunk/src/main/java/org/apache/servicemix/mail/MailPollerEndpoint.java
Tue Dec  7 13:47:29 2010
@@ -16,25 +16,33 @@
  */
 package org.apache.servicemix.mail;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.servicemix.common.endpoints.PollingEndpoint;
-import org.apache.servicemix.mail.marshaler.AbstractMailMarshaler;
-import org.apache.servicemix.mail.marshaler.DefaultMailMarshaler;
-import org.apache.servicemix.mail.utils.MailConnectionConfiguration;
-import org.apache.servicemix.mail.utils.MailUtils;
-
+import java.io.IOException;
+import java.util.Collections;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
 import javax.jbi.JBIException;
 import javax.jbi.messaging.ExchangeStatus;
 import javax.jbi.messaging.InOnly;
 import javax.jbi.messaging.MessageExchange;
 import javax.jbi.messaging.NormalizedMessage;
-import javax.mail.*;
+import javax.mail.Flags;
+import javax.mail.Folder;
+import javax.mail.Message;
+import javax.mail.Session;
+import javax.mail.Store;
 import javax.mail.internet.MimeMessage;
 import javax.mail.internet.ParseException;
 import javax.mail.search.FlagTerm;
-import java.io.IOException;
-import java.util.*;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.servicemix.common.endpoints.PollingEndpoint;
+import org.apache.servicemix.mail.marshaler.AbstractMailMarshaler;
+import org.apache.servicemix.mail.marshaler.DefaultMailMarshaler;
+import org.apache.servicemix.mail.utils.MailConnectionConfiguration;
+import org.apache.servicemix.mail.utils.MailUtils;
 
 /**
  * This is the polling endpoint for the mail component.
@@ -262,6 +270,11 @@ public class MailPollerEndpoint extends 
 
                     // now check if delivery succeeded or went wrong
                     if (io.getStatus() == ExchangeStatus.ERROR) {
+                        // to ensure reprocessing of the mail we set it to UNSEEN even if
we
+                        // did not mark it seen before (seems there are some mail systems
out there
+                        // which do set somehow automatically)
+                        mailMsg.setFlag(Flags.Flag.SEEN, false);
+
                         Exception e = io.getError();
                         if (e == null) {
                             e = new JBIException("Unexpected error occured...");



Mime
View raw message