Fix for bug 117055: Emails were being truncated if they contained a line with…

Fix for bug 117055: Emails were being truncated if they contained a line with nothing but a period on them. We now pass -i to sendmail and its clones to tell it to ignore periods (since we close the pipe when we're done, rather than signalling it with a period). Has been tested with sendmail and postfix. Patch by Dave Miller <justdave@syndicomm.com> r= afranke, bugzilla@bkor.dhs.org, jake
parent 9612f5b8
...@@ -101,7 +101,7 @@ sub MailPasswordToken { ...@@ -101,7 +101,7 @@ sub MailPasswordToken {
my $emailsuffix = &::Param('emailsuffix'); my $emailsuffix = &::Param('emailsuffix');
$token = &::url_quote($token); $token = &::url_quote($token);
open SENDMAIL, "|/usr/lib/sendmail -t"; open SENDMAIL, "|/usr/lib/sendmail -ti";
print SENDMAIL qq|From: bugzilla-daemon print SENDMAIL qq|From: bugzilla-daemon
To: $emailaddress$emailsuffix To: $emailaddress$emailsuffix
...@@ -144,7 +144,7 @@ sub Cancel { ...@@ -144,7 +144,7 @@ sub Cancel {
my $username = $realname ? $realname . " <" . $loginname . ">" : $loginname; my $username = $realname ? $realname . " <" . $loginname . ">" : $loginname;
# Notify the user via email about the cancellation. # Notify the user via email about the cancellation.
open SENDMAIL, "|/usr/lib/sendmail -t"; open SENDMAIL, "|/usr/lib/sendmail -ti";
print SENDMAIL qq|From: bugzilla-daemon print SENDMAIL qq|From: bugzilla-daemon
To: $username To: $username
Subject: "$tokentype" token cancelled Subject: "$tokentype" token cancelled
......
...@@ -762,7 +762,7 @@ sub MailPassword { ...@@ -762,7 +762,7 @@ sub MailPassword {
"login" => $login, "login" => $login,
"password" => $password}); "password" => $password});
open SENDMAIL, "|/usr/lib/sendmail -t"; open SENDMAIL, "|/usr/lib/sendmail -ti";
print SENDMAIL $msg; print SENDMAIL $msg;
close SENDMAIL; close SENDMAIL;
} }
......
...@@ -101,7 +101,7 @@ sub MailPasswordToken { ...@@ -101,7 +101,7 @@ sub MailPasswordToken {
my $emailsuffix = &::Param('emailsuffix'); my $emailsuffix = &::Param('emailsuffix');
$token = &::url_quote($token); $token = &::url_quote($token);
open SENDMAIL, "|/usr/lib/sendmail -t"; open SENDMAIL, "|/usr/lib/sendmail -ti";
print SENDMAIL qq|From: bugzilla-daemon print SENDMAIL qq|From: bugzilla-daemon
To: $emailaddress$emailsuffix To: $emailaddress$emailsuffix
...@@ -144,7 +144,7 @@ sub Cancel { ...@@ -144,7 +144,7 @@ sub Cancel {
my $username = $realname ? $realname . " <" . $loginname . ">" : $loginname; my $username = $realname ? $realname . " <" . $loginname . ">" : $loginname;
# Notify the user via email about the cancellation. # Notify the user via email about the cancellation.
open SENDMAIL, "|/usr/lib/sendmail -t"; open SENDMAIL, "|/usr/lib/sendmail -ti";
print SENDMAIL qq|From: bugzilla-daemon print SENDMAIL qq|From: bugzilla-daemon
To: $username To: $username
Subject: "$tokentype" token cancelled Subject: "$tokentype" token cancelled
......
...@@ -1433,7 +1433,7 @@ sub RemoveVotes { ...@@ -1433,7 +1433,7 @@ sub RemoveVotes {
if (Param('sendmailnow')) { if (Param('sendmailnow')) {
$sendmailparm = ''; $sendmailparm = '';
} }
if (open(SENDMAIL, "|/usr/lib/sendmail $sendmailparm -t")) { if (open(SENDMAIL, "|/usr/lib/sendmail $sendmailparm -ti")) {
my %substs; my %substs;
$substs{"to"} = $name; $substs{"to"} = $name;
......
...@@ -114,7 +114,7 @@ sub MailMessage { ...@@ -114,7 +114,7 @@ sub MailMessage {
$header.= "Subject: $subject\n\n"; $header.= "Subject: $subject\n\n";
open(SENDMAIL, open(SENDMAIL,
"|/usr/lib/sendmail -ODeliveryMode=background -t") || "|/usr/lib/sendmail -ODeliveryMode=background -ti") ||
die "Can't open sendmail"; die "Can't open sendmail";
print SENDMAIL $header . $message . "\n"; print SENDMAIL $header . $message . "\n";
close SENDMAIL; close SENDMAIL;
......
...@@ -150,7 +150,7 @@ $msg .= "Subject: Moving bug(s) $buglist\n\n"; ...@@ -150,7 +150,7 @@ $msg .= "Subject: Moving bug(s) $buglist\n\n";
$msg .= $xml . "\n"; $msg .= $xml . "\n";
open(SENDMAIL, open(SENDMAIL,
"|/usr/lib/sendmail -ODeliveryMode=background -t") || "|/usr/lib/sendmail -ODeliveryMode=background -ti") ||
die "Can't open sendmail"; die "Can't open sendmail";
print SENDMAIL $msg; print SENDMAIL $msg;
close SENDMAIL; close SENDMAIL;
......
...@@ -771,7 +771,7 @@ sub NewProcessOnePerson ($$$$$$$$$$$$) { ...@@ -771,7 +771,7 @@ sub NewProcessOnePerson ($$$$$$$$$$$$) {
} }
if ($enableSendMail == 1) { if ($enableSendMail == 1) {
open(SENDMAIL, "|/usr/lib/sendmail $sendmailparam -t") || open(SENDMAIL, "|/usr/lib/sendmail $sendmailparam -ti") ||
die "Can't open sendmail"; die "Can't open sendmail";
print SENDMAIL trim($msg) . "\n"; print SENDMAIL trim($msg) . "\n";
......
...@@ -64,7 +64,7 @@ foreach my $email (sort (keys %bugs)) { ...@@ -64,7 +64,7 @@ foreach my $email (sort (keys %bugs)) {
} }
my $sendmailparam = Param('sendmailnow') ? '' : "-ODeliveryMode=deferred"; my $sendmailparam = Param('sendmailnow') ? '' : "-ODeliveryMode=deferred";
open SENDMAIL, "|/usr/lib/sendmail $sendmailparam -t" open SENDMAIL, "|/usr/lib/sendmail $sendmailparam -ti"
or die "Can't open sendmail"; or die "Can't open sendmail";
print SENDMAIL $msg; print SENDMAIL $msg;
close SENDMAIL; close SENDMAIL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment