Commit eedbd699 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

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

Bug 135812: Add a 'mailfrom' parameter to unify bugmail originating address - Patch by Cedric Caron <cedric.caron@citycable.ch> r=LpSolit a=myk
parent ac3fe407
...@@ -51,6 +51,12 @@ sub get_param_list { ...@@ -51,6 +51,12 @@ sub get_param_list {
}, },
{ {
name => 'mailfrom',
type => 't',
default => 'bugzilla-daemon'
},
{
name => 'sendmailnow', name => 'sendmailnow',
type => 'b', type => 'b',
default => 1 default => 1
......
...@@ -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-Bugzilla-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-Bugzilla-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-Bugzilla-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 %].
......
...@@ -23,9 +23,10 @@ ...@@ -23,9 +23,10 @@
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
[% expiration_ts = token_ts + (constants.MAX_TOKEN_AGE * 86400) %] [% expiration_ts = token_ts + (constants.MAX_TOKEN_AGE * 86400) %]
From: bugzilla-admin-daemon From: [% Param('mailfrom') %]
To: [% email %] To: [% email %]
Subject: [% terms.Bugzilla %]: confirm account creation Subject: [% terms.Bugzilla %]: confirm account creation
X-Bugzilla-Type: admin
[%+ terms.Bugzilla %] has received a request to create a user account [%+ terms.Bugzilla %] has received a request to create a user account
using your email address ([% email %]). using your email address ([% email %]).
......
...@@ -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-Bugzilla-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:
......
...@@ -44,6 +44,9 @@ ...@@ -44,6 +44,9 @@
</li> </li>
</ul>", </ul>",
mailfrom => "The email address of the $terms.Bugzilla mail daemon. Some email systems " _
"require this to be a valid email address.",
sendmailnow => "Sites using anything older than version 8.12 of 'sendmail' " _ sendmailnow => "Sites using anything older than version 8.12 of 'sendmail' " _
"can achieve a significant performance increase in the " _ "can achieve a significant performance increase in the " _
"UI -- at the cost of delaying the sending of mail -- by " _ "UI -- at the cost of delaying the sending of mail -- by " _
......
...@@ -20,10 +20,11 @@ ...@@ -20,10 +20,11 @@
#%] #%]
[% PROCESS "global/field-descs.none.tmpl" %] [% PROCESS "global/field-descs.none.tmpl" %]
From: bugzilla-daemon From: [% Param('mailfrom') %]
To: [% to %] To: [% to %]
Subject: [[% terms.Bug %] [%+ bugid %]] [% neworchanged %][%+ summary %] Subject: [[% terms.Bug %] [%+ bugid %]] [% neworchanged %][%+ summary %]
X-Bugzilla-Reason: [% reasonsheader %] X-Bugzilla-Reason: [% reasonsheader %]
X-Bugzilla-Type: newchanged
X-Bugzilla-Watch-Reason: [% reasonswatchheader %] X-Bugzilla-Watch-Reason: [% reasonswatchheader %]
X-Bugzilla-Product: [% product %] X-Bugzilla-Product: [% product %]
X-Bugzilla-Component: [% comp %] X-Bugzilla-Component: [% comp %]
......
...@@ -22,10 +22,11 @@ ...@@ -22,10 +22,11 @@
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
Content-Type: text/plain Content-Type: text/plain
From: [% Param("maintainer") %] From: [% Param('mailfrom') %]
To: [% user.email %] To: [% user.email %]
Subject: [[% terms.Bugzilla %]] Your account [% user.login -%] Subject: [[% terms.Bugzilla %]] Your account [% user.login -%]
is being impersonated is being impersonated
X-Bugzilla-Type: admin
[%+ sudoer.identity %] has used the 'sudo' feature to access [%+ sudoer.identity %] has used the 'sudo' feature to access
[%+ terms.Bugzilla %] using your account. [%+ terms.Bugzilla %] using your account.
......
...@@ -21,9 +21,10 @@ ...@@ -21,9 +21,10 @@
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
From: bugzilla-daemon From: [% Param('mailfrom') %]
To: [% to %] To: [% to %]
Subject: [% terms.Bug %] [%+ bugid %] Some or all of your votes have been removed. Subject: [% terms.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 [% terms.bug %] [%+ bugid %]. Some or all of your votes have been removed from [% terms.bug %] [%+ bugid %].
......
...@@ -20,9 +20,10 @@ ...@@ -20,9 +20,10 @@
#%] #%]
[% PROCESS "global/field-descs.none.tmpl" %] [% PROCESS "global/field-descs.none.tmpl" %]
From: [% Param("maintainer") %] From: [% Param("mailfrom") %]
To: [% email %][% Param("emailsuffix") %] To: [% email %][% Param("emailsuffix") %]
Subject: Your [% terms.Bugzilla %] buglist needs attention. Subject: Your [% terms.Bugzilla %] buglist needs attention.
X-Bugzilla-Type: whine
[This e-mail has been automatically generated.] [This e-mail has been automatically generated.]
......
...@@ -36,9 +36,10 @@ ...@@ -36,9 +36,10 @@
[% END %] [% END %]
[% subject_status = statuses.${flag.status} %] [% subject_status = statuses.${flag.status} %]
[% END %] [% END %]
From: bugzilla-request-daemon From: [% Param('mailfrom') %]
To: [% to %] To: [% to %]
Subject: [% flag.type.name %] [%+ subject_status %]: [[% terms.Bug %] [%+ bug.bug_id %]] [% bug.short_desc %] Subject: [% flag.type.name %] [%+ subject_status %]: [[% terms.Bug %] [%+ bug.bug_id %]] [% bug.short_desc %]
X-Bugzilla-Type: request
[%- IF attachment %] : [%- IF attachment %] :
[Attachment [% attachment.id %]] [% attachment.description %][% END %] [Attachment [% attachment.id %]] [% attachment.description %][% END %]
......
...@@ -93,13 +93,13 @@ my $sth_schedules_by_event = $dbh->prepare( ...@@ -93,13 +93,13 @@ my $sth_schedules_by_event = $dbh->prepare(
# After that, it looks over each user to see if they have schedules that need # After that, it looks over each user to see if they have schedules that need
# running, then runs those and generates the email messages. # running, then runs those and generates the email messages.
# Send whines from the address in the 'maintainer' Parameter so that all # Send whines from the address in the 'mailfrom' Parameter so that all
# Bugzilla-originated mail appears to come from a single address. # Bugzilla-originated mail appears to come from a single address.
my $fromaddress = Bugzilla->params->{'maintainer'}; my $fromaddress = Bugzilla->params->{'mailfrom'};
if ($fromaddress !~ Bugzilla->params->{'emailregexp'}) { if ($fromaddress !~ Bugzilla->params->{'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";
} }
# get the current date and time # get the current date and time
......
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