]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 280911: Global symbol "$person" requires explicit package name at Bugzilla/BugMai...
authormkanat%kerio.com <>
Sat, 19 Mar 2005 19:22:53 +0000 (19:22 +0000)
committermkanat%kerio.com <>
Sat, 19 Mar 2005 19:22:53 +0000 (19:22 +0000)
Patch By Marc Schumann <wurblzap@gmail.com> r=mkanat, a=justdave

Bugzilla/BugMail.pm
Bugzilla/Token.pm
CGI.pl
docs/xml/installation.xml
globals.pl
importxml.pl
move.pl
whineatnews.pl

index 0ac3728bd879a57016360c2615cb187b2ee0a005..0c3b0b150c1b618d21310db64be96cfcad000bfd 100644 (file)
@@ -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")) {
index 90efe99bda499769b9c8625d0c3141e0ea828946..7e77a6835b68176b9b965812d329758be4c16284 100644 (file)
@@ -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 e648bd64ca95ebd24cdc197534be9335f6e4d2b1..2af838dc210979bf2d4d9b78bd6d36f2bac65a92 100644 (file)
--- 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 {
index 62bd0f7fd9256896bfefd543e1e5753da4cf8667..8b6aac68db3e33d8c2dd87f516612407d3678a12 100644 (file)
@@ -1,5 +1,5 @@
 <!-- <!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"> -->
-<!-- $Id: installation.xml,v 1.72.2.20 2005/03/09 18:58:23 travis%sedsystems.ca Exp $ -->
+<!-- $Id: installation.xml,v 1.72.2.21 2005/03/19 11:22:55 mkanat%kerio.com Exp $ -->
 <chapter id="installing-bugzilla">
   <title>Installing Bugzilla</title>
 
@@ -1408,16 +1408,16 @@ C:\perl&gt; <command>ppm install &lt;module name&gt;</command>
       </section>
 
       <section id="win32-code-changes">
-        <title>Code changes required to run on win32</title>
+        <title>Code changes required to run on Win32</title>
 
         <para>
-          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
           <ulink url="http://bugzilla.mozilla.org/show_bug.cgi?id=49893">bug
           49893</ulink> 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:
         </para>
 
         <programlisting>
@@ -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.
         </para>
+        <para>
+          Please be aware that flag email will continue not to work.
+        </para>
       </section>
 
       <section id="win32-http">
index 4f607ad224483331277ab0890798f2ff5de0a609..c4cb8d33a298035702b962be5c281f3af437ed7a 100644 (file)
@@ -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();
index f0208448bdab8bedf6f9517850eb9fbc2fc98d57..71328aae7b9132dc2b9d8fc165a820b174af6a0d 100755 (executable)
@@ -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 328671f8170898af8be2cbe8a933626fedbbbfd0..e6d18d3c1b300f1dc1da14a3cd784097eafba105 100755 (executable)
--- 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);
index 8e73e1b6d2f9578e8871806f0c2b11b3e7342498..c8bad23d77cb6dbeb39fdcbf2276bfed07e155ff 100755 (executable)
@@ -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";
 }