From: mkanat%kerio.com <> Date: Sat, 19 Mar 2005 19:22:53 +0000 (+0000) Subject: Bug 280911: Global symbol "$person" requires explicit package name at Bugzilla/BugMai... X-Git-Tag: bugzilla-2.18.1~21 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7e1b39fbf78eb1d6659f0ad6e30b4cf0e63f3fbf;p=thirdparty%2Fbugzilla.git Bug 280911: Global symbol "$person" requires explicit package name at Bugzilla/BugMail.pm line 879 (Fix Win32 SMTP) Patch By Marc Schumann r=mkanat, a=justdave --- diff --git a/Bugzilla/BugMail.pm b/Bugzilla/BugMail.pm index 0ac3728bd8..0c3b0b150c 100644 --- a/Bugzilla/BugMail.pm +++ b/Bugzilla/BugMail.pm @@ -850,16 +850,14 @@ sub NewProcessOnePerson ($$$$$$$$$$$$$) { my $msg = PerformSubsts($template, \%substs); - MessageToMTA($msg); + MessageToMTA($msg, $person); push(@sentlist, $person); return 1; } -# XXX: Should eventually add $mail_from and $mail_to options to -# control the SMTP Envelope. -mkanat -sub MessageToMTA ($) { - my ($msg) = (@_); +sub MessageToMTA ($;$$) { + my ($msg, $rcpt_to) = (@_); my $sendmailparam = ""; unless (Param("sendmailnow")) { diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm index 90efe99bda..7e77a6835b 100644 --- a/Bugzilla/Token.pm +++ b/Bugzilla/Token.pm @@ -92,7 +92,7 @@ sub IssueEmailChangeToken { $template->process("account/email/change-old.txt.tmpl", $vars, \$message) || ThrowTemplateError($template->error()); - Bugzilla::BugMail::MessageToMTA($message); + Bugzilla::BugMail::MessageToMTA($message, $vars->{'emailaddress'}); $vars->{'token'} = $newtoken; $vars->{'emailaddress'} = $new_email . Param('emailsuffix'); @@ -101,7 +101,7 @@ sub IssueEmailChangeToken { $template->process("account/email/change-new.txt.tmpl", $vars, \$message) || ThrowTemplateError($template->error()); - Bugzilla::BugMail::MessageToMTA($message); + Bugzilla::BugMail::MessageToMTA($message, $vars->{'emailaddress'}); } sub IssuePasswordToken { @@ -153,7 +153,7 @@ sub IssuePasswordToken { $vars, \$message) || ThrowTemplateError($template->error()); - Bugzilla::BugMail::MessageToMTA($message); + Bugzilla::BugMail::MessageToMTA($message, $vars->{'emailaddress'}); } @@ -229,7 +229,7 @@ sub Cancel { $template->process("account/cancel-token.txt.tmpl", $vars, \$message) || ThrowTemplateError($template->error()); - Bugzilla::BugMail::MessageToMTA($message); + Bugzilla::BugMail::MessageToMTA($message, $vars->{'emailaddress'}); # Delete the token from the database. &::SendSQL("LOCK TABLES tokens WRITE"); diff --git a/CGI.pl b/CGI.pl index e648bd64ca..2af838dc21 100644 --- a/CGI.pl +++ b/CGI.pl @@ -226,7 +226,7 @@ sub MailPassword { "login" => $login, "password" => $password}); - Bugzilla::BugMail::MessageToMTA($msg); + Bugzilla::BugMail::MessageToMTA($msg, $login . Param('emailsuffix')); } sub PutHeader { diff --git a/docs/xml/installation.xml b/docs/xml/installation.xml index 62bd0f7fd9..8b6aac68db 100644 --- a/docs/xml/installation.xml +++ b/docs/xml/installation.xml @@ -1,5 +1,5 @@ - + Installing Bugzilla @@ -1408,16 +1408,16 @@ C:\perl> ppm install <module name>
- Code changes required to run on win32 + Code changes required to run on Win32 - Bugzilla on win32 is mostly supported out of the box; one + Bugzilla on Win32 is mostly supported out of the box; one remaining issue is related to bug email. To make bug email work on Win32 (until bug 49893 lands), the simplest way is to have the Net::SMTP Perl module installed and - change this line in the file Bugzilla/Bugmail.pm: + change these lines in the file Bugzilla/Bugmail.pm: @@ -1436,13 +1436,15 @@ close SENDMAIL; use Net::SMTP; my $smtp_server = 'smtp.mycompany.com'; # change this +($enableSendMail && $rcpt_to) || return; + # Use die on error, so that the mail will be in the 'unsent mails' and # can be sent from the sanity check page. my $smtp = Net::SMTP->new($smtp_server) || die 'Cannot connect to server \'$smtp_server\''; $smtp->mail('bugzilla-daemon@mycompany.com'); # change this -$smtp->to($person); +$smtp->to($rcpt_to); $smtp->data(); $smtp->datasend($msg); $smtp->dataend(); @@ -1454,6 +1456,9 @@ $smtp->quit; domain of the sending email address (after the '@') in the above lines of code. + + Please be aware that flag email will continue not to work. +
diff --git a/globals.pl b/globals.pl index 4f607ad224..c4cb8d33a2 100644 --- a/globals.pl +++ b/globals.pl @@ -1390,7 +1390,7 @@ sub RemoveVotes { my $msg = PerformSubsts(Param("voteremovedmail"), \%substs); - Bugzilla::BugMail::MessageToMTA($msg); + Bugzilla::BugMail::MessageToMTA($msg, $substs{'to'}); } SendSQL("SELECT SUM(vote_count) FROM votes WHERE bug_id = $id"); my $v = FetchOneColumn(); diff --git a/importxml.pl b/importxml.pl index f0208448bd..71328aae7b 100755 --- a/importxml.pl +++ b/importxml.pl @@ -115,7 +115,7 @@ sub MailMessage { $header.= "Subject: $subject\n\n"; my $sendmessage = $header . $message . "\n"; - Bugzilla::BugMail::MessageToMTA($sendmessage); + Bugzilla::BugMail::MessageToMTA($sendmessage, $recipients[0]); Log($subject . " sent to: $to"); } diff --git a/move.pl b/move.pl index 328671f817..e6d18d3c1b 100755 --- a/move.pl +++ b/move.pl @@ -168,7 +168,7 @@ $template->process("bug/show.xml.tmpl", { bugs => \@bugs, $msg .= "\n"; -Bugzilla::BugMail::MessageToMTA($msg); +Bugzilla::BugMail::MessageToMTA($msg, $to); my $logstr = "XML: bugs $buglist sent to $to"; Log($logstr); diff --git a/whineatnews.pl b/whineatnews.pl index 8e73e1b6d2..c8bad23d77 100755 --- a/whineatnews.pl +++ b/whineatnews.pl @@ -70,7 +70,7 @@ foreach my $email (sort (keys %bugs)) { $msg .= " -> ${urlbase}show_bug.cgi?id=$i\n"; } - Bugzilla::BugMail::MessageToMTA($msg); + Bugzilla::BugMail::MessageToMTA($msg, $substs{'email'}); print "$email " . join(" ", @{$bugs{$email}}) . "\n"; }