--- src/java/org/apache/james/transport/mailets/AddFooter.java	2006-03-01 10:09:49.000000000 +0100
+++ src/java/org/apache/james/transport/mailets/AddFooterFixed.java	2006-03-07 07:56:29.000000000 +0100
@@ -34,7 +34,7 @@
  * This mailet will attach text to the end of the message (like a footer).  Right
  * now it only supports simple messages without multiple parts.
  */
-public class AddFooter extends GenericMailet {
+public class AddFooterFixed extends GenericMailet {
 
     /**
      * This is the plain text version of the footer we are going to add
@@ -214,9 +214,13 @@
             MimeMultipart multipart = (MimeMultipart)part.getContent();
             MimeBodyPart firstPart = (MimeBodyPart)multipart.getBodyPart(0);
             boolean isFooterAttached = attachFooter(firstPart);
-            //We have to do this because of a bug in JavaMail (ref id 4403733)
-            //http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4403733
-            part.setContent(multipart);
+            
+            //Only set the new Content if the isFooterAttached return true
+            if (isFooterAttached == true) {
+                //We have to do this because of a bug in JavaMail (ref id 4403733)
+                //http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4403733
+                part.setContent(multipart);
+            }
             return isFooterAttached;
         } else if (part.isMimeType("multipart/alternative")) {
             MimeMultipart multipart = (MimeMultipart)part.getContent();
@@ -228,9 +232,13 @@
                 MimeBodyPart mimeBodyPart = (MimeBodyPart)multipart.getBodyPart(index);
                 isFooterAttached |= attachFooter(mimeBodyPart);
             }
-            //We have to do this because of a bug in JavaMail (ref id 4403733)
-            //http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4403733
-            part.setContent(multipart);
+            
+            //Only set the new Content if the isFooterAttached return true
+            if (isFooterAttached == true) {
+                //We have to do this because of a bug in JavaMail (ref id 4403733)
+                //http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4403733
+                part.setContent(multipart);
+            }
             return isFooterAttached;
         } else {
             //Give up... we won't attach the footer to this MimePart
