geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickmcgu...@apache.org
Subject svn commit: r672333 - /geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/MimeMessage.java
Date Fri, 27 Jun 2008 17:16:18 GMT
Author: rickmcguire
Date: Fri Jun 27 10:16:17 2008
New Revision: 672333

URL: http://svn.apache.org/viewvc?rev=672333&view=rev
Log:
GERONIMO-4167 MimeMesage.reply() is not setting the In-Reply-To and Responses headers in the
reply message


Modified:
    geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/MimeMessage.java

Modified: geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/MimeMessage.java
URL: http://svn.apache.org/viewvc/geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/MimeMessage.java?rev=672333&r1=672332&r2=672333&view=diff
==============================================================================
--- geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/MimeMessage.java
(original)
+++ geronimo/specs/trunk/geronimo-javamail_1.4_spec/src/main/java/javax/mail/internet/MimeMessage.java
Fri Jun 27 10:16:17 2008
@@ -982,6 +982,25 @@
             }
             reply.setSubject(newSubject);
         }
+        
+        // if this message has a message ID, then add a In-Reply-To and References
+        // header to the reply message 
+        String messageID = getSingleHeader("Message-ID"); 
+        if (messageID != null) {
+            // this one is just set unconditionally 
+            reply.setHeader("In-Reply-To", messageID); 
+            // we might already have a references header.  If so, then add our message id

+            // on the the end
+            String references = getSingleHeader("References"); 
+            if (references == null) {
+                references = messageID; 
+            }
+            else {
+                references = references + " " + messageID; 
+            }
+            // and this is a replacement for whatever might be there.              
+            reply.setHeader("References", MimeUtility.fold("References: ".length(), references));

+        }
 
         Address[] toRecipients = getReplyTo();
 



Mime
View raw message