use quoted-printable encoding for html mail
authorTony Cook <tony@develop-help.com>
Fri, 20 Dec 2013 04:05:43 +0000 (15:05 +1100)
committerTony Cook <tony@develop-help.com>
Fri, 20 Dec 2013 04:05:43 +0000 (15:05 +1100)
site/cgi-bin/modules/BSE/ComposeMail.pm
site/docs/config.pod

index 33c31998e49880a27cca5a3fd75311a75e6a3a07..cee174ed1c5d5c6af95a99027c6644a83574b1bc 100644 (file)
@@ -6,7 +6,7 @@ use Carp 'confess';
 use Digest::MD5 qw(md5_hex);
 use BSE::Variables;
 
-our $VERSION = "1.008";
+our $VERSION = "1.009";
 
 =head1 NAME
 
@@ -340,11 +340,20 @@ sub _build_mime_lite {
      Subject => $self->{subject},
      Type => 'multipart/alternative',
     );
-  my $text_part = $msg->attach(Type => 'text/plain',
-                              Data => [ $text_content ]);
+  my $text_part = $msg->attach
+    (
+     Type => 'text/plain',
+     Data => [ $text_content ],
+     $text_content =~ /.{79}/ || $text_content =~ /[^ -~\x0d\x0a]/
+     ? ( Encoding => 'quoted-printable' ) : (),
+    );
   my $html_part = $msg->attach(Type => 'multipart/related');
-  $html_part->attach(Type => 'text/html',
-                    Data => $html_content);
+  $html_part->attach
+    (
+     Type => 'text/html',
+     Data => $html_content,
+     Encoding => 'quoted-printable',
+    );
 
   for my $attachment (@{$self->{attachments}}) {
     my $data;
@@ -412,7 +421,7 @@ sub extra_headers {
 sub _log_dump {
   my ($self, $headers, $message) = @_;
 
-  my $max = $self->{cfg}->entry("audit log", "mail_max_dump", 10000);
+  my $max = $self->{cfg}->entry("audit log", "mail_max_dump", 50000);
   my $msg = "$headers\n\n$message";
   if (length($msg) > $max) {
     substr($msg, $max-3) = "...";
index 8d42a55c5e19cd6589f504195dd60076d0c17f19..7a8a54a6a94ceff9e6832bf0ded289d1c6869cb2 100644 (file)
@@ -2505,7 +2505,7 @@ in the audit log.  Default: 0.
 =item *
 
 mail_max_dump - if non-zero this is the size limit of the dump stored
-in the audit log when [audit log].mail is enabled.
+in the audit log when [audit log].mail is enabled.  Default: 50000.
 
 =back