]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 455430: Add an X-Bugzilla-URL header to identify what install this email comes...
authormkanat%bugzilla.org <>
Tue, 16 Sep 2008 06:34:34 +0000 (06:34 +0000)
committermkanat%bugzilla.org <>
Tue, 16 Sep 2008 06:34:34 +0000 (06:34 +0000)
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bbaetz, a=mkanat

Bugzilla/Mailer.pm

index c790d179fd2e2805a0a71130a04d5c321947ebf1..0fee0a3ec2d8e2f7a3cbf6659701ed8450c0b2b8 100644 (file)
@@ -57,6 +57,18 @@ sub MessageToMTA {
     return if $method eq 'None';
 
     my $email = ref($msg) ? $msg : Email::MIME->new($msg);
+
+    # We add this header to uniquely identify all email that we
+    # send as coming from this Bugzilla installation.
+    #
+    # We don't use correct_urlbase, because we want this URL to
+    # *always* be the same for this Bugzilla, in every email,
+    # and some emails we send when we're logged out (in which case
+    # some emails might get urlbase while the logged-in emails might 
+    # get sslbase). Also, we want this to stay the same even if
+    # the admin changes the "ssl" parameter.
+    $email->header_set('X-Bugzilla-URL', Bugzilla->params->{'urlbase'});
+
     $email->walk_parts(sub {
         my ($part) = @_;
         return if $part->parts > 1; # Top-level