[Rt-commit] r11085 - rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Action

audreyt at bestpractical.com audreyt at bestpractical.com
Mon Mar 17 14:51:33 EDT 2008


Author: audreyt
Date: Mon Mar 17 14:51:33 2008
New Revision: 11085

Modified:
   rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Action/SendEmail.pm

Log:
* Resolve https://tickets.bestpractical.com/Ticket/Display.html?id=11962

  (Attachments to multipart/alternative should be listed in a separate
  toplevel multipart/mixed.)

  This bug affected multipart RT Templates, but those are probably very
  rare in practice until ABERDEEN.


Modified: rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Action/SendEmail.pm
==============================================================================
--- rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Action/SendEmail.pm	(original)
+++ rt/branches/3.6-EXPERIMENTAL-ABERDEEN/lib/RT/Action/SendEmail.pm	Mon Mar 17 14:51:33 2008
@@ -404,6 +404,7 @@
     my $transaction_content_obj = $self->TransactionObj->ContentObj;
 
     # attach any of this transaction's attachments
+    my $seen_attachment = 0;
     while ( my $attach = $attachments->Next ) {
 
         # Don't attach anything blank
@@ -414,7 +415,12 @@
           if ( $transaction_content_obj
             && $transaction_content_obj->Id == $attach->Id
             && $transaction_content_obj->ContentType =~ qr{text/plain}i );
-        $MIMEObj->make_multipart('mixed');
+
+        if (!$seen_attachment) {
+            $MIMEObj->make_multipart('mixed', Force => 1);
+            $seen_attachment = 1;
+        }
+
         $MIMEObj->attach(
             Type     => $attach->ContentType,
             Charset  => $attach->OriginalEncoding,


More information about the Rt-commit mailing list