diff options
author | wurblzap%gmail.com <> | 2005-11-03 04:50:46 +0000 |
---|---|---|
committer | wurblzap%gmail.com <> | 2005-11-03 04:50:46 +0000 |
commit | a5d2579b4d3f1ca1b8b166ea18874b7cd75d6e54 (patch) | |
tree | eedb5dcfe5663dd515088550ba4d6111001930d0 /Bugzilla | |
parent | Bug 314795: [Oracle] SQL query in query.cgi is missing a space (diff) | |
download | bugzilla-a5d2579b4d3f1ca1b8b166ea18874b7cd75d6e54.tar.gz bugzilla-a5d2579b4d3f1ca1b8b166ea18874b7cd75d6e54.tar.bz2 bugzilla-a5d2579b4d3f1ca1b8b166ea18874b7cd75d6e54.zip |
Bugzilla Bug 306207: sendmail support under Windows bypasses message encoding
Patch by byron jones (glob) <bugzilla@glob.com.au>
r=wurblzap, a=myk
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/BugMail.pm | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index c487c4a6c..e8e725011 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -630,10 +630,22 @@ sub MessageToMTA { my ($msg) = (@_); return if (Param('mail_delivery_method') eq "none"); + my ($header, $body) = $msg =~ /(.*?\n)\n(.*)/s ? ($1, $2) : ('', $msg); + my $headers; + + if (Param('utf8') and (!is_7bit_clean($header) or !is_7bit_clean($body))) { + ($headers, $body) = encode_message($header, $body); + } else { + my @header_lines = split(/\n/, $header); + $headers = new Mail::Header \@header_lines, Modify => 0; + } + if (Param("mail_delivery_method") eq "sendmail" && $^O =~ /MSWin32/i) { open(SENDMAIL, '|' . SENDMAIL_EXE . ' -t -i') || die "Failed to execute " . SENDMAIL_EXE . ": $!\n"; - print SENDMAIL $msg; + print SENDMAIL $headers->as_string; + print SENDMAIL "\n"; + print SENDMAIL $body; close SENDMAIL; return; } @@ -650,16 +662,6 @@ sub MessageToMTA { $Mail::Mailer::testfile::config{outfile} = "$datadir/mailer.testfile"; } - my ($header, $body) = $msg =~ /(.*?\n)\n(.*)/s ? ($1, $2) : ('', $msg); - my $headers; - - if (Param('utf8') and (!is_7bit_clean($header) or !is_7bit_clean($body))) { - ($headers, $body) = encode_message($header, $body); - } else { - my @header_lines = split(/\n/, $header); - $headers = new Mail::Header \@header_lines, Modify => 0; - } - $mailer->open($headers->header_hashref); print $mailer $body; $mailer->close; |