[freeside-commits] branch FREESIDE_4_BRANCH updated. b98d00cb2a8c49b3aa4836fde7d3dd485a567efd

Mitch Jackson mitch at freeside.biz
Wed Jul 18 15:39:13 PDT 2018


The branch, FREESIDE_4_BRANCH has been updated
       via  b98d00cb2a8c49b3aa4836fde7d3dd485a567efd (commit)
       via  596f08196fd33e134009833b6453809789088dc8 (commit)
      from  95b5826ecc5685680480367d9fe531d03f735233 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b98d00cb2a8c49b3aa4836fde7d3dd485a567efd
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Wed Jul 18 22:38:44 2018 +0000

    RT# 79705 fakesmtpserver - saved messages viewable with e-mail client

diff --git a/bin/fakesmtpserver.pl b/bin/fakesmtpserver.pl
index 1f2ca3f31..5da6cb5cb 100755
--- a/bin/fakesmtpserver.pl
+++ b/bin/fakesmtpserver.pl
@@ -10,6 +10,9 @@ it could be updated to fork on client connections.
 When an e-mail is delivered, the TO and FROM are printed to STDOUT.
 The TO, FROM and MSG are saved to a file in $message_save_dir
 
+Open a saved .eml file with Mozilla Thunderbird (or other mail clients)
+to review e-mail with all html/pdf attachments
+
 =cut
 
 use strict;
@@ -33,21 +36,21 @@ while(my $conn = $server->accept()) {
 
   $client->process || next;
 
-  open my $fh, '>', $message_save_dir.'/'.time().'.txt'
+  open my $fh, '>', $message_save_dir.'/'.time().'.eml'
     or die "error: $!";
 
   for my $f (qw/TO FROM/) {
 
       if (ref $client->{$f} eq 'ARRAY') {
         print "$f: $_\n" for @{$client->{$f}};
-        print $fh "$f: $_\n" for @{$client->{$f}};
+        # print $fh "$f: $_\n" for @{$client->{$f}};
       } else {
         print "$f: $client->{$f}\n";
-        print $fh "$f: $client->{$f}\n";
+        # print $fh "$f: $client->{$f}\n";
       }
 
   }
-  print $fh "\n\n$client->{MSG}\n";
+  print $fh "$client->{MSG}\n";
   print "\n";
   close $fh;
 }

commit 596f08196fd33e134009833b6453809789088dc8
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Tue May 22 23:44:21 2018 -0500

    RT# 79705 Correct UTF-8 output for generated E-Mail

diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm
index 4d1079a04..38c506692 100644
--- a/FS/FS/Template_Mixin.pm
+++ b/FS/FS/Template_Mixin.pm
@@ -2274,8 +2274,7 @@ sub generate_email {
       warn "$me generating plain text invoice"
         if $DEBUG;
 
-      # 'print_text' argument is no longer used
-      @text = map Encode::encode_utf8($_), $self->print_text(\%args);
+      @text = $self->print_text(\%args);
 
     } else {
 
@@ -2291,7 +2290,11 @@ sub generate_email {
     'Encoding'    => 'quoted-printable',
     'Charset'     => 'UTF-8',
     #'Encoding'    => '7bit',
-    'Data'        => \@text,
+    'Data'        => [
+      map
+        { Encode::encode('UTF-8', $_, Encode::FB_WARN | Encode::LEAVE_SRC ) }
+        @text
+    ],
     'Disposition' => 'inline',
   );
 
@@ -2370,7 +2373,11 @@ sub generate_email {
                          '    </title>',
                          '  </head>',
                          '  <body bgcolor="#e8e8e8">',
-                         Encode::encode_utf8($html),
+                         Encode::encode(
+                           'UTF-8',
+                           $html,
+                           Encode::FB_WARN | Encode::LEAVE_SRC
+                         ),
                          '  </body>',
                          '</html>',
                        ],

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

Summary of changes:
 FS/FS/Template_Mixin.pm | 15 +++++++++++----
 bin/fakesmtpserver.pl   | 11 +++++++----
 2 files changed, 18 insertions(+), 8 deletions(-)




More information about the freeside-commits mailing list