[Rt-commit] rt branch, master, updated. rt-4.2.11-145-g119301e

? sunnavy sunnavy at bestpractical.com
Tue Aug 11 10:22:16 EDT 2015


The branch, master has been updated
       via  119301eb8ac527ab631bf80782e608cce4d09952 (commit)
      from  61f8eb5ff3e04e121bfeb4f5bf2523e02133f04b (commit)

Summary of changes:
 lib/RT/Action/SendEmail.pm | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 119301eb8ac527ab631bf80782e608cce4d09952
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Aug 11 22:08:11 2015 +0800

    fix mail structure if HTML templates in use thanks to cloos++
    
    Without this, if you use HTML templates, the top part is multipart/alternative,
    thus is_multipart returns true and the existing attachment is added to the
    multipart/alternative part.
    
    Mail structure is:
    multipart/alternative
      text/plain
      text/html
      image/png (the existing attachment that was added)
    
    This results in MUA display only one of the multipart/alternative parts.
    
    Fix this by checking the top part explicitly for multipart/mixed.
    
    This gives us a correct mail structure of:
    multipart/mixed
      multipart/alternative
        text/plain
        text/html
      image/png

diff --git a/lib/RT/Action/SendEmail.pm b/lib/RT/Action/SendEmail.pm
index b5df720..ce18aff 100644
--- a/lib/RT/Action/SendEmail.pm
+++ b/lib/RT/Action/SendEmail.pm
@@ -417,9 +417,8 @@ sub AddAttachmentsFromHeaders {
         next unless $attach->Id
                 and $attach->TransactionObj->CurrentUserCanSee;
 
-        if ( !$email->is_multipart ) {
-            $email->make_multipart( 'mixed', Force => 1 );
-        }
+        $email->make_multipart( 'mixed', Force => 1 )
+          unless $email->effective_type eq 'multipart/mixed';
         $self->AddAttachment($attach, $email);
     }
 }

-----------------------------------------------------------------------


More information about the rt-commit mailing list