Closed Bug 778069 Opened 12 years ago Closed 12 years ago

whineatnews.pl doesn't use Bugzilla->params->{'mailfrom'};

Categories

(Bugzilla :: Whining, defect)

4.2.1
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: henrik, Unassigned)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:14.0) Gecko/20100101 Firefox/14.0.1
Build ID: 20120713134347

Steps to reproduce:

Has my whineatnews.pl script running every day


Actual results:

Mail sent from this script doesn't use the Bugzilla->params->{'mailfrom'} when sending out email. 
Mail from address becomes bugzilla-daemon@hostname_running_bugzilla


Expected results:

Mail from address should have been what I've configured in Bugzilla->params->{'mailfrom'};
email/whine.txt.tmpl has:

From: [% Param("mailfrom") %]

as for all other email templates. The From: header is correctly filled with the content of the mailfrom parameter. Maybe you didn't enter a full email address for the mailfrom parameter.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
I would say I did enter a full emailaddress for my mailfrom setting.
All other email from my bugzilla installation uses the emailadresse I entered. just not the whineatnews.pl email.
Problem seems to be that the whineatnews.pl script doesn't set the mailfrom parameter for the template to use.
The template gets the mailfrom information itself. whineatnews.pl has nothing to do here.
OK, so how do I get whineatnews.pl to use the configured mailfrom address ?
(In reply to Henrik Schack from comment #5)
> OK, so how do I get whineatnews.pl to use the configured mailfrom address ?

look in the file template/en/default/email/whine.txt.tmpl for the line which starts with "From: "

as frédéric indicated in comment 1, bugzilla sets this to 'mailfrom' by default.  if you're seeing different behavour, perhaps you have a modified template.  note -- you may have a whine.txt.tmpl file installed under a different language, or location (custom, or part of an extension).
I'm using the original template file, here is the mentioned part :
--cut--
[% PROCESS "global/field-descs.none.tmpl" %]
From: [% Param("mailfrom") %]
To: [% email %][% Param("emailsuffix") %]
Subject: Your [% terms.Bugzilla %] [%+ terms.bug %] list needs attention.
X-Bugzilla-Type: whine
--cut--
I've patched my whineatnews,pl and now everything is working as supposed to:

--- schack-whineatnews.pl	2012-07-31 15:51:35.000000000 +0200
+++ whineatnews.pl	2012-07-24 10:35:21.000000000 +0200
@@ -76,7 +76,7 @@
     my $user = new Bugzilla::User({name => $email});
     next if $user->email_disabled;
 
-    my $vars = {'email' => $email,'mailfrom' => Bugzilla->params->{'mailfrom'}};
+    my $vars = {'email' => $email};
 
     my @bugs = ();
     foreach my $i (@{$bugs{$email}}) {
You need to log in before you can comment on or make changes to this bug.