]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 135812 : Add a 'mailfrom' parameter to unify bugmail originating address
authortravis%sedsystems.ca <>
Wed, 16 Mar 2005 00:44:06 +0000 (00:44 +0000)
committertravis%sedsystems.ca <>
Wed, 16 Mar 2005 00:44:06 +0000 (00:44 +0000)
Patch by Cedric Caron <cedric.caron@urbanet.ch>   r=wurblzap  a=justdave

Bugzilla/Config.pm
defparams.pl
template/en/default/account/cancel-token.txt.tmpl
template/en/default/account/email/change-new.txt.tmpl
template/en/default/account/email/change-old.txt.tmpl
template/en/default/account/password/forgotten-password.txt.tmpl
template/en/default/request/email.txt.tmpl
template/en/default/whine/multipart-mime.txt.tmpl
whine.pl

index 6bc149be9203f3192496c6328450acfe61da830c..c1c317d57604fed94711adb6c5a7dbdc0df4e301 100644 (file)
@@ -251,6 +251,18 @@ sub UpdateParams {
         delete $param{'enablequips'};
     }
 
+    # Update e-mail text to use new mailfrom param (Bug 135812)
+    if (!exists $param{'mailfrom'}) {
+        $param{'passwordmail'} =~ s/^From: bugzilla-daemon$/From: %mailfrom%/mi;
+        $param{'passwordmail'} =~ s/\n\n/\nX-Bugzilla-Type: admin\n\n/;
+        $param{'newchangedmail'} =~ s/^From: bugzilla-daemon$/From: %mailfrom%/mi;
+        $param{'newchangedmail'} =~ s/\n\n/\nX-Bugzilla-Type: newchanged\n\n/;
+        $param{'voteremovedmail'} =~ s/^From: bugzilla-daemon$/From: %mailfrom%/mi;
+        $param{'voteremovedmail'} =~ s/\n\n/\nX-Bugzilla-Type: voteremoved\n\n/;
+        $param{'whinemail'} =~ s/^From: %maintainer%$/From: %mailfrom%/mi;
+        $param{'whinemail'} =~ s/\n\n/\nX-Bugzilla-Type: whine\n\n/;
+    }
+
     # --- DEFAULTS FOR NEW PARAMS ---
 
     foreach my $item (@param_list) {
index 5e2110d6143b26bb2ae984af23705738cbf305ef..30e7ed72abc398edf85609a10cdfa2c9cd92ea89 100644 (file)
@@ -307,6 +307,14 @@ sub find_languages {
    default => 'THE MAINTAINER HAS NOT YET BEEN SET'
   },
 
+  {
+   name => 'mailfrom',
+   desc => 'The email address of the Bugzilla mail daemon.  Some email systems ' .
+           'require this to be a valid email address.',
+   type => 't',
+   default => 'bugzilla-daemon'
+  },
+
   {
    name => 'urlbase',
    desc => 'The URL that is the common initial leading part of all Bugzilla ' .
@@ -718,9 +726,10 @@ sub find_languages {
            'password.  %<i>anythingelse</i>% gets replaced by the ' .
            'definition of that parameter (as defined on this page).',
    type => 'l',
-   default => 'From: bugzilla-daemon
+   default => 'From: %mailfrom%
 To: %mailaddress%
 Subject: Your Bugzilla password.
+X-Bugzilla-Type: admin
 
 To use the wonders of Bugzilla, you can use the following:
 
@@ -753,11 +762,12 @@ To use the wonders of Bugzilla, you can use the following:
            'replaced by the definition of that parameter (as defined on ' .
            'this page).',
    type => 'l',
-   default => 'From: bugzilla-daemon
+   default => 'From: %mailfrom%
 To: %to%
 Subject: [Bug %bugid%] %neworchanged%%summary%
 %threadingmarker%
 X-Bugzilla-Reason: %reasonsheader%
+X-Bugzilla-Type: newchanged
 
 %urlbase%show_bug.cgi?id=%bugid%
 
@@ -789,9 +799,10 @@ Configure bugmail: %urlbase%userprefs.cgi?tab=email
            'address, so that if the mail bounces, a real person can know '.
            'that there are bugs assigned to an invalid address.',
    type => 'l',
-   default => 'From: %maintainer%
+   default => 'From: %mailfrom%
 To: %email%
 Subject: Your Bugzilla buglist needs attention.
+X-Bugzilla-Type: whine
 
 [This e-mail has been automatically generated.]
 
@@ -1032,9 +1043,10 @@ You will get this message once a day until you\'ve dealt with these bugs!
            'compatibility. %<i>anythingelse</i>% gets replaced by the ' .
            'definition of that parameter (as defined on this page).',
    type => 'l',
-   default => 'From: bugzilla-daemon
+   default => 'From: %mailfrom%
 To: %to%
 Subject: [Bug %bugid%] Some or all of your votes have been removed.
+X-Bugzilla-Type: voteremoved
 
 Some or all of your votes have been removed from bug %bugid%.
 
index de2278419409673b004005afc57c8a6f8666e2e4..38ad37bef4156536737fde742a99e595c3d48e4d 100644 (file)
 
 [% PROCESS global/variables.none.tmpl %]
 
-From: bugzilla-admin-daemon
+From: [% Param('mailfrom') %]
 To: [% emailaddress %]
 Subject: [% PROCESS subject %]
+X-B[%#%]ugzilla-Type: admin
 
 A request was cancelled from [% remoteaddress %].
 
index 7113504d8a17a01c8d4e16879075fa5dbb288f70..cbc0af1e72ebe1d41ad1f2004279fc97293c4c2b 100644 (file)
 [% PROCESS global/variables.none.tmpl %]
 
 [% expiration_ts = token_ts + (max_token_age * 86400) %]
-From: bugzilla-admin-daemon
+From: [% Param('mailfrom') %]
 To: [% emailaddress %]
 Subject: [% terms.Bugzilla %] Change Email Address Request
+X-B[%#%]ugzilla-Type: admin
 
 [%+ terms.Bugzilla %] has received a request to change the email address
 for the account [% oldemailaddress %] to your address.
index 272f6d4e525975dd0b1bf392f3b14f7449d6ff3e..12de7530d425880101bd5d981c9f63427ebb8d35 100644 (file)
 [% PROCESS global/variables.none.tmpl %]
 
 [% expiration_ts = token_ts + (max_token_age * 86400) %]
-From: bugzilla-admin-daemon
+From: [% Param('mailfrom') %]
 To: [% emailaddress %]
 Subject: [% terms.Bugzilla %] Change Email Address Request
 Importance: High
 X-MSMail-Priority: High
 X-Priority: 1
+X-B[%#%]ugzilla-Type: admin
 
 [%+ terms.Bugzilla %] has received a request to change the email address
 for your account to [%+ newemailaddress %].
index 5ac3ed75c9ffba3524e40ca131bd68dae11ff75a..b56e930fdc451740580c7979c69919f565e7b69d 100644 (file)
 [% PROCESS global/variables.none.tmpl %]
 
 [% expiration_ts = token_ts + (max_token_age * 86400) %]
-From: bugzilla-admin-daemon
+From: [% Param('mailfrom') %]
 To: [% emailaddress %]
 Subject:  [% terms.Bugzilla %] Change Password Request
+X-B[%#%]ugzilla-Type: admin
 
 You have (or someone impersonating you has) requested to change your 
 [%+ terms.Bugzilla %] password. To complete the change, visit the following link:
index 719f9d8696c4bdc42ede8b30fa10f06773913ef1..f34227a5655be59cda3a40ad7a458bc7f174ee2d 100644 (file)
    [% to_identity = flag.setter.identity _ "'s request" %]
    [% subject_status = statuses.${flag.status} %]
 [% END %]
-From: bugzilla-request-daemon
+From: [% Param('mailfrom') %]
 To: [% to_email %]
 CC: [% flag.type.cc_list %]
 Subject: [% flag.type.name %] [%+ subject_status %]: [[% terms.Bug %] [%+ flag.target.bug.id %]] [% flag.target.bug.summary %]
+X-B[%#%]ugzilla-Type: request
 [%- IF flag.target.attachment.exists %] :
   [Attachment [% flag.target.attachment.id %]] [% flag.target.attachment.summary %][% END %]
 
index 5e597d8990ee8f222a0316545a7203334cc1a44c..855cbd06632b490c57bee3326d9167f1fd2f3252 100644 (file)
@@ -34,6 +34,7 @@
 From: [% from %]
 To: [% recipient.email %]
 Subject: [[% terms.Bugzilla %]] [% subject %]
+X-B[%#%]ugzilla-Type: whine
 MIME-Version: 1.0
 Content-Type: multipart/alternative; boundary="[% boundary %]"
 
index a13a129b4a585e2e117d7a6fa84afef192d37c11..0642ec5ab67f534b65ad9d779fafcd8881368082 100755 (executable)
--- a/whine.pl
+++ b/whine.pl
@@ -99,14 +99,13 @@ if (Param('shutdownhtml')) {
 }
 
 
-# Send whines from the maintainer address. It's not a good idea to use
-# the whine creator address because the admin can make more use of bounces and
-# other replies.
-my $fromaddress = Param('maintainer');
+# Send whines from the address in the 'mailfrom' Parameter so that all
+# Bugzilla-originated mail appears to come from a single address.
+my $fromaddress = Param('mailfrom');
 
 if ($fromaddress !~ Param('emailregexp')) {
     die "Cannot run.  " .
-        "The maintainer email address has not been properly set!\n";
+        "The Bugzilla email address has not been properly set!\n";
 }
 
 # Check the nomail file for users who should not receive mail