svn commit: r575491 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r575491 - /ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java

jonesde
Author: jonesde
Date: Thu Sep 13 15:49:17 2007
New Revision: 575491

URL: http://svn.apache.org/viewvc?rev=575491&view=rev
Log:
Small improvement to log more info and normally just log one persist or ignore message per email rather that two

Modified:
    ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java

Modified: ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java?rev=575491&r1=575490&r2=575491&view=diff
==============================================================================
--- ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java (original)
+++ ofbiz/trunk/applications/content/src/org/ofbiz/content/email/EmailServices.java Thu Sep 13 15:49:17 2007
@@ -735,9 +735,11 @@
             Address[] addressesCC = message.getRecipients(MimeMessage.RecipientType.CC);
             Address[] addressesBCC = message.getRecipients(MimeMessage.RecipientType.BCC);
             String messageId = message.getMessageID();
-            Debug.logInfo("Processing Incoming Email message [" + messageId + "] from: " +
-                    (addressesFrom[0] == null? "not found" : addressesFrom[0].toString()) + " to: " +
-                            (addressesTo[0] == null? "not found" : addressesTo[0].toString()), module);
+            
+            String aboutThisEmail = "message [" + messageId + "] from [" +
+                (addressesFrom[0] == null? "not found" : addressesFrom[0].toString()) + "] to [" +
+                (addressesTo[0] == null? "not found" : addressesTo[0].toString()) + "]";
+            if (Debug.verboseOn()) Debug.logVerbose("Processing Incoming Email " + aboutThisEmail, module);
 
             // ignore the message when the spam status = yes
             String spamHeaderName = UtilProperties.getPropertyValue("general.properties", "mail.spam.name", "N");
@@ -766,8 +768,10 @@
                 return ServiceUtil.returnError(e.getMessage());
             }
             if (commEvents != null && commEvents.size() > 0) {
-                Debug.logInfo("Incoming Email message ignored, duplicate 'messageId' : " + messageId, module);
+                Debug.logInfo("Ignoring Duplicate Email: " + aboutThisEmail, module);
                 return ServiceUtil.returnSuccess(" Message Ignored: deplicate messageId");
+            } else {
+                Debug.logInfo("Persisting New Email: " + aboutThisEmail, module);
             }
 
             // get the 'To' partyId