a8c837
Resolves: #1123093
a8c837
a8c837
--- a/scripts/logwatch.pl	2016-03-16 14:27:25.770098250 +0100
a8c837
+++ b/scripts/logwatch.pl	2016-03-16 14:28:46.689067743 +0100
a8c837
@@ -1469,14 +1469,15 @@ sub parselogs {
a8c837
    if (defined fileno OUTFILE) {
a8c837
       print OUTFILE $out_mime if $out_mime;
a8c837
       if ( $Config{'encode'} eq "base64" ) {
a8c837
-         print OUTFILE encode_base64($out_head) if $out_head;
a8c837
-         print OUTFILE encode_base64($out_reference) if $out_reference;
a8c837
+         my $out = '';
a8c837
+         $out .= $out_head if $out_head;
a8c837
+         $out .= $out_reference if $out_reference;
a8c837
          foreach ( 0 .. $index_par ) {
a8c837
-            print OUTFILE encode_base64($out_body{$_}) if defined( $out_body{$_} );
a8c837
-#fixme
a8c837
+            $out .= $out_body{$_} if defined( $out_body{$_} );
a8c837
             $out_body{$_} = ''; #We should track this down out_body could be an array instead also -mgt
a8c837
          }
a8c837
-         print OUTFILE encode_base64($out_foot) if $out_foot;
a8c837
+         $out .= $out_foot if $out_foot;
a8c837
+         print OUTFILE encode_base64($out);
a8c837
       } else {
a8c837
          print OUTFILE $out_head if $out_head;
a8c837
          print OUTFILE $out_reference if $out_reference;