james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Danny Angus" <da...@apache.org>
Subject Message-ID bug
Date Wed, 05 Feb 2003 14:52:38 GMT
Guys, specially Serge,
 please examine this patch and tell me why I shouldn't commit it.

The symptom: setting headers on a MimeMessageWrapper object appeared to cause the message-id
to change

The problem: MimeMessageWrapper was calling saveChanges() in writeTo(), and saveChanges()
sets a new Message_Id every time, regardless.

The solution: remove saveChanges from writeTo() 

Any other solution to the same problem would be OK by me, but its my firm belief that we should
not change message-ID's unless we clone the message.

d.

Index: MimeMessageWrapper.java
===================================================================
RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/core/MimeMessageWrapper.java,v
retrieving revision 1.19
diff -u -r1.19 MimeMessageWrapper.java
--- MimeMessageWrapper.java	7 Jan 2003 11:06:35 -0000	1.19
+++ MimeMessageWrapper.java	5 Feb 2003 14:44:35 -0000
@@ -200,7 +200,10 @@
             }
             in.close();
         } else {
-            message.saveChanges();
+            if(message.getMessageID()!=null){
+
+            }
+           // message.saveChanges();
             message.writeTo(os);
         }
     }
@@ -263,7 +266,7 @@
             MimeMessageWrapper wrapper = (MimeMessageWrapper)message;
             wrapper.writeTo(headerOs, bodyOs, ignoreList);
         } else {
-            message.saveChanges();
+            //message.saveChanges();
 
             //Write the headers (minus ignored ones)
             Enumeration headers = message.getNonMatchingHeaderLines(ignoreList);
Mime
View raw message