Skip to content
Browse files

use quoted-printable encoding for html mail

  • Loading branch information...
1 parent 139d9a1 commit 08a49f2d8e1cf0275afd356041155c4102951284 @tonycoz committed
Showing with 16 additions and 7 deletions.
  1. +15 −6 site/cgi-bin/modules/BSE/ComposeMail.pm
  2. +1 −1 site/docs/config.pod
View
21 site/cgi-bin/modules/BSE/ComposeMail.pm
@@ -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) = "...";
View
2 site/docs/config.pod
@@ -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

0 comments on commit 08a49f2

Please sign in to comment.
Something went wrong with that request. Please try again.