[Rt-commit] rt branch, 4.2-trunk, updated. rt-4.2.1-25-g0e3fa48

? sunnavy sunnavy at bestpractical.com
Fri Nov 22 09:20:43 EST 2013


The branch, 4.2-trunk has been updated
       via  0e3fa48dbb4f54dc6591757030a28fbbd03756bb (commit)
       via  b7b6dc7acdbd84e4ec36ea4d5fc3421dd4ea0c6b (commit)
       via  6ba23b90f1817734313634a48692ba344a83b571 (commit)
       via  15f0a9cf23118833c4a2bf659e3cafaaf540d5bb (commit)
       via  418d9defa828925350289d9ecfa5cb103ae40fcd (commit)
      from  ec766e1831e683815b7921cb925766369799318e (commit)

Summary of changes:
 lib/RT/Dashboard/Mailer.pm |  3 +++
 t/mail/dashboards.t        | 22 +++++++++-------------
 2 files changed, 12 insertions(+), 13 deletions(-)

- Log -----------------------------------------------------------------
commit 418d9defa828925350289d9ecfa5cb103ae40fcd
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Oct 25 20:07:06 2013 +0800

    set transfer encoding to base64 for dashboard html email
    
    there is line length limit for messages in rfc 2822(section 2.1.1).
    though some email systems can auto-wrap long lines perfectly, some did it poorly.
    dashboard html can have very long lines(1000+ chars, e.g. when there are links
    to customized searches with long queries), setting to base64 here is to make sure
    it won't be cut off by buggy email systems.

diff --git a/lib/RT/Dashboard/Mailer.pm b/lib/RT/Dashboard/Mailer.pm
index c4de860..a6db75b 100644
--- a/lib/RT/Dashboard/Mailer.pm
+++ b/lib/RT/Dashboard/Mailer.pm
@@ -426,6 +426,7 @@ sub BuildEmail {
         Type        => 'text/html',
         Charset     => 'UTF-8',
         Disposition => 'inline',
+        Encoding    => "base64",
     );
 
     for my $part (@parts) {

commit 15f0a9cf23118833c4a2bf659e3cafaaf540d5bb
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Nov 21 18:48:13 2013 -0500

    Collapse the multipart/mixed if there are no attachments

diff --git a/lib/RT/Dashboard/Mailer.pm b/lib/RT/Dashboard/Mailer.pm
index a6db75b..d2527a9 100644
--- a/lib/RT/Dashboard/Mailer.pm
+++ b/lib/RT/Dashboard/Mailer.pm
@@ -433,6 +433,8 @@ sub BuildEmail {
         $entity->add_part($part);
     }
 
+    $entity->make_singlepart;
+
     return $entity;
 }
 

commit 6ba23b90f1817734313634a48692ba344a83b571
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Nov 21 18:49:41 2013 -0500

    Test that dashboards are base64 encoded

diff --git a/t/mail/dashboards.t b/t/mail/dashboards.t
index fe317d4..364ed30 100644
--- a/t/mail/dashboards.t
+++ b/t/mail/dashboards.t
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 181;
+use RT::Test tests => undef;
 use Test::Warn;
 use RT::Dashboard::Mailer;
 
@@ -102,6 +102,7 @@ sub produces_dashboard_mail_ok { # {{{
     my $mail = parse_mail( $mails[0] );
     is($mail->head->get('Subject'), $subject);
     is($mail->head->get('From'), qq{"root" <root\@localhost>\n});
+    is($mail->head->get('Content-Transfer-Encoding'), "base64\n");
     is($mail->head->get('X-RT-Dashboard-Id'), "$dashboard_id\n");
     is($mail->head->get('X-RT-Dashboard-Subscription-Id'), "$subscription_id\n");
 
@@ -368,3 +369,4 @@ produces_no_dashboard_mail_ok(
     Time    => $bad_time,
 );
 
+done_testing;

commit b7b6dc7acdbd84e4ec36ea4d5fc3421dd4ea0c6b
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Thu Nov 21 18:50:04 2013 -0500

    If decoded bodyhandles are fetched, these skipped tests pass just fine

diff --git a/t/mail/dashboards.t b/t/mail/dashboards.t
index 364ed30..d7b1ccc 100644
--- a/t/mail/dashboards.t
+++ b/t/mail/dashboards.t
@@ -106,12 +106,9 @@ sub produces_dashboard_mail_ok { # {{{
     is($mail->head->get('X-RT-Dashboard-Id'), "$dashboard_id\n");
     is($mail->head->get('X-RT-Dashboard-Subscription-Id'), "$subscription_id\n");
 
-    SKIP: {
-        skip 'Weird MIME failure', 2;
-        my $body = $mail->stringify_body;
-        like($body, qr{My dashboards});
-        like($body, qr{<a href="http://[^/]+/Dashboards/\d+/Testing!">Testing!</a>});
-    };
+    my $body = $mail->bodyhandle->as_string;
+    like($body, qr{My dashboards});
+    like($body, qr{<a href="http://[^/]+/Dashboards/\d+/Testing!">Testing!</a>});
 } # }}}
 
 sub produces_no_dashboard_mail_ok { # {{{
@@ -203,12 +200,9 @@ is($mail->head->get('From'), "dashboard\@example.com\n");
 is($mail->head->get('X-RT-Dashboard-Id'), "$dashboard_id\n");
 is($mail->head->get('X-RT-Dashboard-Subscription-Id'), "$subscription_id\n");
 
-SKIP: {
-    skip 'Weird MIME failure', 2;
-    my $body = $mail->stringify_body;
-    unlike($body, qr{My dashboards});
-    unlike($body, qr{Testing!});
-};
+my $body = $mail->bodyhandle->as_string;
+unlike($body, qr{My dashboards});
+unlike($body, qr{Testing!});
 
 delete_dashboard($dashboard_id);
 

commit 0e3fa48dbb4f54dc6591757030a28fbbd03756bb
Merge: ec766e1 b7b6dc7
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Nov 22 22:20:09 2013 +0800

    Merge branch '4.2/encode-base64-for-dashboard-html-email' into 4.2-trunk


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


More information about the rt-commit mailing list