Commit 5d6b815d authored by travis%sedsystems.ca's avatar travis%sedsystems.ca

Bug 135812 : Add a 'mailfrom' parameter to unify bugmail originating address

Patch by Cedric Caron <cedric.caron@urbanet.ch> r=wurblzap a=justdave
parent a54f3f23
...@@ -251,6 +251,18 @@ sub UpdateParams { ...@@ -251,6 +251,18 @@ sub UpdateParams {
delete $param{'enablequips'}; 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 --- # --- DEFAULTS FOR NEW PARAMS ---
foreach my $item (@param_list) { foreach my $item (@param_list) {
......
...@@ -308,6 +308,14 @@ sub find_languages { ...@@ -308,6 +308,14 @@ sub find_languages {
}, },
{ {
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', name => 'urlbase',
desc => 'The URL that is the common initial leading part of all Bugzilla ' . desc => 'The URL that is the common initial leading part of all Bugzilla ' .
'URLs.', 'URLs.',
...@@ -718,9 +726,10 @@ sub find_languages { ...@@ -718,9 +726,10 @@ sub find_languages {
'password. %<i>anythingelse</i>% gets replaced by the ' . 'password. %<i>anythingelse</i>% gets replaced by the ' .
'definition of that parameter (as defined on this page).', 'definition of that parameter (as defined on this page).',
type => 'l', type => 'l',
default => 'From: bugzilla-daemon default => 'From: %mailfrom%
To: %mailaddress% To: %mailaddress%
Subject: Your Bugzilla password. Subject: Your Bugzilla password.
X-Bugzilla-Type: admin
To use the wonders of Bugzilla, you can use the following: 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: ...@@ -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 ' . 'replaced by the definition of that parameter (as defined on ' .
'this page).', 'this page).',
type => 'l', type => 'l',
default => 'From: bugzilla-daemon default => 'From: %mailfrom%
To: %to% To: %to%
Subject: [Bug %bugid%] %neworchanged%%summary% Subject: [Bug %bugid%] %neworchanged%%summary%
%threadingmarker% %threadingmarker%
X-Bugzilla-Reason: %reasonsheader% X-Bugzilla-Reason: %reasonsheader%
X-Bugzilla-Type: newchanged
%urlbase%show_bug.cgi?id=%bugid% %urlbase%show_bug.cgi?id=%bugid%
...@@ -789,9 +799,10 @@ Configure bugmail: %urlbase%userprefs.cgi?tab=email ...@@ -789,9 +799,10 @@ Configure bugmail: %urlbase%userprefs.cgi?tab=email
'address, so that if the mail bounces, a real person can know '. 'address, so that if the mail bounces, a real person can know '.
'that there are bugs assigned to an invalid address.', 'that there are bugs assigned to an invalid address.',
type => 'l', type => 'l',
default => 'From: %maintainer% default => 'From: %mailfrom%
To: %email% To: %email%
Subject: Your Bugzilla buglist needs attention. Subject: Your Bugzilla buglist needs attention.
X-Bugzilla-Type: whine
[This e-mail has been automatically generated.] [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! ...@@ -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 ' . 'compatibility. %<i>anythingelse</i>% gets replaced by the ' .
'definition of that parameter (as defined on this page).', 'definition of that parameter (as defined on this page).',
type => 'l', type => 'l',
default => 'From: bugzilla-daemon default => 'From: %mailfrom%
To: %to% To: %to%
Subject: [Bug %bugid%] Some or all of your votes have been removed. 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%. Some or all of your votes have been removed from bug %bugid%.
......
...@@ -22,9 +22,10 @@ ...@@ -22,9 +22,10 @@
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
From: bugzilla-admin-daemon From: [% Param('mailfrom') %]
To: [% emailaddress %] To: [% emailaddress %]
Subject: [% PROCESS subject %] Subject: [% PROCESS subject %]
X-B[%#%]ugzilla-Type: admin
A request was cancelled from [% remoteaddress %]. A request was cancelled from [% remoteaddress %].
......
...@@ -22,9 +22,10 @@ ...@@ -22,9 +22,10 @@
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[% expiration_ts = token_ts + (max_token_age * 86400) %] [% expiration_ts = token_ts + (max_token_age * 86400) %]
From: bugzilla-admin-daemon From: [% Param('mailfrom') %]
To: [% emailaddress %] To: [% emailaddress %]
Subject: [% terms.Bugzilla %] Change Email Address Request Subject: [% terms.Bugzilla %] Change Email Address Request
X-B[%#%]ugzilla-Type: admin
[%+ terms.Bugzilla %] has received a request to change the email address [%+ terms.Bugzilla %] has received a request to change the email address
for the account [% oldemailaddress %] to your address. for the account [% oldemailaddress %] to your address.
......
...@@ -27,12 +27,13 @@ ...@@ -27,12 +27,13 @@
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[% expiration_ts = token_ts + (max_token_age * 86400) %] [% expiration_ts = token_ts + (max_token_age * 86400) %]
From: bugzilla-admin-daemon From: [% Param('mailfrom') %]
To: [% emailaddress %] To: [% emailaddress %]
Subject: [% terms.Bugzilla %] Change Email Address Request Subject: [% terms.Bugzilla %] Change Email Address Request
Importance: High Importance: High
X-MSMail-Priority: High X-MSMail-Priority: High
X-Priority: 1 X-Priority: 1
X-B[%#%]ugzilla-Type: admin
[%+ terms.Bugzilla %] has received a request to change the email address [%+ terms.Bugzilla %] has received a request to change the email address
for your account to [%+ newemailaddress %]. for your account to [%+ newemailaddress %].
......
...@@ -22,9 +22,10 @@ ...@@ -22,9 +22,10 @@
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[% expiration_ts = token_ts + (max_token_age * 86400) %] [% expiration_ts = token_ts + (max_token_age * 86400) %]
From: bugzilla-admin-daemon From: [% Param('mailfrom') %]
To: [% emailaddress %] To: [% emailaddress %]
Subject: [% terms.Bugzilla %] Change Password Request Subject: [% terms.Bugzilla %] Change Password Request
X-B[%#%]ugzilla-Type: admin
You have (or someone impersonating you has) requested to change your You have (or someone impersonating you has) requested to change your
[%+ terms.Bugzilla %] password. To complete the change, visit the following link: [%+ terms.Bugzilla %] password. To complete the change, visit the following link:
......
...@@ -36,10 +36,11 @@ ...@@ -36,10 +36,11 @@
[% to_identity = flag.setter.identity _ "'s request" %] [% to_identity = flag.setter.identity _ "'s request" %]
[% subject_status = statuses.${flag.status} %] [% subject_status = statuses.${flag.status} %]
[% END %] [% END %]
From: bugzilla-request-daemon From: [% Param('mailfrom') %]
To: [% to_email %] To: [% to_email %]
CC: [% flag.type.cc_list %] CC: [% flag.type.cc_list %]
Subject: [% flag.type.name %] [%+ subject_status %]: [[% terms.Bug %] [%+ flag.target.bug.id %]] [% flag.target.bug.summary %] 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 %] : [%- IF flag.target.attachment.exists %] :
[Attachment [% flag.target.attachment.id %]] [% flag.target.attachment.summary %][% END %] [Attachment [% flag.target.attachment.id %]] [% flag.target.attachment.summary %][% END %]
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
From: [% from %] From: [% from %]
To: [% recipient.email %] To: [% recipient.email %]
Subject: [[% terms.Bugzilla %]] [% subject %] Subject: [[% terms.Bugzilla %]] [% subject %]
X-B[%#%]ugzilla-Type: whine
MIME-Version: 1.0 MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="[% boundary %]" Content-Type: multipart/alternative; boundary="[% boundary %]"
......
...@@ -99,14 +99,13 @@ if (Param('shutdownhtml')) { ...@@ -99,14 +99,13 @@ if (Param('shutdownhtml')) {
} }
# Send whines from the maintainer address. It's not a good idea to use # Send whines from the address in the 'mailfrom' Parameter so that all
# the whine creator address because the admin can make more use of bounces and # Bugzilla-originated mail appears to come from a single address.
# other replies. my $fromaddress = Param('mailfrom');
my $fromaddress = Param('maintainer');
if ($fromaddress !~ Param('emailregexp')) { if ($fromaddress !~ Param('emailregexp')) {
die "Cannot run. " . 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 # Check the nomail file for users who should not receive mail
......
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