From eedbd699a1aa0f44e7dda37b4d524902a864b783 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sat, 21 Oct 2006 04:22:54 +0000 Subject: Bug 135812: Add a 'mailfrom' parameter to unify bugmail originating address - Patch by Cedric Caron r=LpSolit a=myk --- Bugzilla/Config/MTA.pm | 6 ++++++ template/en/default/account/cancel-token.txt.tmpl | 3 ++- template/en/default/account/email/change-new.txt.tmpl | 3 ++- template/en/default/account/email/change-old.txt.tmpl | 3 ++- template/en/default/account/email/request-new.txt.tmpl | 3 ++- template/en/default/account/password/forgotten-password.txt.tmpl | 3 ++- template/en/default/admin/params/mta.html.tmpl | 3 +++ template/en/default/email/newchangedmail.txt.tmpl | 3 ++- template/en/default/email/sudo.txt.tmpl | 3 ++- template/en/default/email/votes-removed.txt.tmpl | 3 ++- template/en/default/email/whine.txt.tmpl | 3 ++- template/en/default/request/email.txt.tmpl | 3 ++- whine.pl | 6 +++--- 13 files changed, 32 insertions(+), 13 deletions(-) diff --git a/Bugzilla/Config/MTA.pm b/Bugzilla/Config/MTA.pm index 4364db49b..53340dc13 100644 --- a/Bugzilla/Config/MTA.pm +++ b/Bugzilla/Config/MTA.pm @@ -50,6 +50,12 @@ sub get_param_list { checker => \&check_mail_delivery_method }, + { + name => 'mailfrom', + type => 't', + default => 'bugzilla-daemon' + }, + { name => 'sendmailnow', type => 'b', diff --git a/template/en/default/account/cancel-token.txt.tmpl b/template/en/default/account/cancel-token.txt.tmpl index f9d310534..4afada50c 100644 --- a/template/en/default/account/cancel-token.txt.tmpl +++ b/template/en/default/account/cancel-token.txt.tmpl @@ -22,9 +22,10 @@ [% PROCESS global/variables.none.tmpl %] -From: bugzilla-admin-daemon +From: [% Param('mailfrom') %] To: [% emailaddress %] Subject: [% PROCESS subject %] +X-Bugzilla-Type: admin A request was cancelled from [% remoteaddress %]. diff --git a/template/en/default/account/email/change-new.txt.tmpl b/template/en/default/account/email/change-new.txt.tmpl index 7113504d8..13162bf34 100644 --- a/template/en/default/account/email/change-new.txt.tmpl +++ b/template/en/default/account/email/change-new.txt.tmpl @@ -22,9 +22,10 @@ [% 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-Bugzilla-Type: admin [%+ terms.Bugzilla %] has received a request to change the email address for the account [% oldemailaddress %] to your address. diff --git a/template/en/default/account/email/change-old.txt.tmpl b/template/en/default/account/email/change-old.txt.tmpl index 272f6d4e5..2035390a0 100644 --- a/template/en/default/account/email/change-old.txt.tmpl +++ b/template/en/default/account/email/change-old.txt.tmpl @@ -27,12 +27,13 @@ [% 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-Bugzilla-Type: admin [%+ terms.Bugzilla %] has received a request to change the email address for your account to [%+ newemailaddress %]. diff --git a/template/en/default/account/email/request-new.txt.tmpl b/template/en/default/account/email/request-new.txt.tmpl index 85fdec157..7a0e10a15 100644 --- a/template/en/default/account/email/request-new.txt.tmpl +++ b/template/en/default/account/email/request-new.txt.tmpl @@ -23,9 +23,10 @@ [% PROCESS global/variables.none.tmpl %] [% expiration_ts = token_ts + (constants.MAX_TOKEN_AGE * 86400) %] -From: bugzilla-admin-daemon +From: [% Param('mailfrom') %] To: [% email %] Subject: [% terms.Bugzilla %]: confirm account creation +X-Bugzilla-Type: admin [%+ terms.Bugzilla %] has received a request to create a user account using your email address ([% email %]). diff --git a/template/en/default/account/password/forgotten-password.txt.tmpl b/template/en/default/account/password/forgotten-password.txt.tmpl index 5ac3ed75c..75720e7c8 100644 --- a/template/en/default/account/password/forgotten-password.txt.tmpl +++ b/template/en/default/account/password/forgotten-password.txt.tmpl @@ -22,9 +22,10 @@ [% 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-Bugzilla-Type: admin You have (or someone impersonating you has) requested to change your [%+ terms.Bugzilla %] password. To complete the change, visit the following link: diff --git a/template/en/default/admin/params/mta.html.tmpl b/template/en/default/admin/params/mta.html.tmpl index 357193c3d..4089820b5 100644 --- a/template/en/default/admin/params/mta.html.tmpl +++ b/template/en/default/admin/params/mta.html.tmpl @@ -44,6 +44,9 @@ ", + 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' " _ "can achieve a significant performance increase in the " _ "UI -- at the cost of delaying the sending of mail -- by " _ diff --git a/template/en/default/email/newchangedmail.txt.tmpl b/template/en/default/email/newchangedmail.txt.tmpl index d0bc8b124..ad7d564b4 100644 --- a/template/en/default/email/newchangedmail.txt.tmpl +++ b/template/en/default/email/newchangedmail.txt.tmpl @@ -20,10 +20,11 @@ #%] [% PROCESS "global/field-descs.none.tmpl" %] -From: bugzilla-daemon +From: [% Param('mailfrom') %] To: [% to %] Subject: [[% terms.Bug %] [%+ bugid %]] [% neworchanged %][%+ summary %] X-Bugzilla-Reason: [% reasonsheader %] +X-Bugzilla-Type: newchanged X-Bugzilla-Watch-Reason: [% reasonswatchheader %] X-Bugzilla-Product: [% product %] X-Bugzilla-Component: [% comp %] diff --git a/template/en/default/email/sudo.txt.tmpl b/template/en/default/email/sudo.txt.tmpl index 06026cf39..758c67b02 100644 --- a/template/en/default/email/sudo.txt.tmpl +++ b/template/en/default/email/sudo.txt.tmpl @@ -22,10 +22,11 @@ [% PROCESS global/variables.none.tmpl %] Content-Type: text/plain -From: [% Param("maintainer") %] +From: [% Param('mailfrom') %] To: [% user.email %] Subject: [[% terms.Bugzilla %]] Your account [% user.login -%] is being impersonated +X-Bugzilla-Type: admin [%+ sudoer.identity %] has used the 'sudo' feature to access [%+ terms.Bugzilla %] using your account. diff --git a/template/en/default/email/votes-removed.txt.tmpl b/template/en/default/email/votes-removed.txt.tmpl index e9f1db34c..6bf2afd8c 100644 --- a/template/en/default/email/votes-removed.txt.tmpl +++ b/template/en/default/email/votes-removed.txt.tmpl @@ -21,9 +21,10 @@ [% PROCESS global/variables.none.tmpl %] -From: bugzilla-daemon +From: [% Param('mailfrom') %] To: [% to %] 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 %]. diff --git a/template/en/default/email/whine.txt.tmpl b/template/en/default/email/whine.txt.tmpl index 214231394..e50964e8a 100644 --- a/template/en/default/email/whine.txt.tmpl +++ b/template/en/default/email/whine.txt.tmpl @@ -20,9 +20,10 @@ #%] [% PROCESS "global/field-descs.none.tmpl" %] -From: [% Param("maintainer") %] +From: [% Param("mailfrom") %] To: [% email %][% Param("emailsuffix") %] Subject: Your [% terms.Bugzilla %] buglist needs attention. +X-Bugzilla-Type: whine [This e-mail has been automatically generated.] diff --git a/template/en/default/request/email.txt.tmpl b/template/en/default/request/email.txt.tmpl index ac6de50ad..76267e3a0 100644 --- a/template/en/default/request/email.txt.tmpl +++ b/template/en/default/request/email.txt.tmpl @@ -36,9 +36,10 @@ [% END %] [% subject_status = statuses.${flag.status} %] [% END %] -From: bugzilla-request-daemon +From: [% Param('mailfrom') %] To: [% to %] Subject: [% flag.type.name %] [%+ subject_status %]: [[% terms.Bug %] [%+ bug.bug_id %]] [% bug.short_desc %] +X-Bugzilla-Type: request [%- IF attachment %] : [Attachment [% attachment.id %]] [% attachment.description %][% END %] diff --git a/whine.pl b/whine.pl index 12b03fb62..0cfee8eab 100755 --- a/whine.pl +++ b/whine.pl @@ -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 # 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. -my $fromaddress = Bugzilla->params->{'maintainer'}; +my $fromaddress = Bugzilla->params->{'mailfrom'}; if ($fromaddress !~ Bugzilla->params->{'emailregexp'}) { 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 -- cgit v1.2.3-24-g4f1b