[Rtir] ScriptedAction not sending mail
Gorazd Božič
gorazd.bozic at arnes.si
Thu Jul 15 08:12:23 EDT 2010
Hi all,
Today we tried using ScriptedAction for the first time since installing RTIR 2.4.3. Investigations were created, but our logs were showing an error:
Jul 15 12:51:11 ostrv RT: <rt-3.8.7-28730-1279191071-65.37311-92-0 at arnes.si> #37311/268782 - Scrip 92 CreateInvestigation (/opt/rt3/bin/../lib/RT/Action/SendEmail.pm:300)
Jul 15 12:51:11 ostrv RT: <rt-3.8.7-28730-1279191071-65.37311-92-0 at arnes.si> No recipients found. Not sending. (/opt/rt3/bin/../lib/RT/Interface/Email.pm:342)
After going through the code I found out that requestor is not set to the correct e-mail address before ScriptedAction.html calls CreateTicket( %ARGS, ... ). So you should stuff that address in the %ARGS hash (the third change in the diff below). I took the opportunity to add a field where you can specify the parent incident for all investigations being created (first two changes in the diff).
# diff -c /opt/src/RT-IR-2.4.3/html/RTIR/Tools/ScriptedAction.html local/plugins/RT-IR/html/RTIR/Tools/ScriptedAction.html
*** /opt/src/RT-IR-2.4.3/html/RTIR/Tools/ScriptedAction.html 2009-08-18 17:26:46.000000000 +0200
--- local/plugins/RT-IR/html/RTIR/Tools/ScriptedAction.html 2010-07-15 13:38:14.000000000 +0200
***************
*** 31,37 ****
<& /Elements/ListActions, actions => \@finalresults &>
<form method="get" action="ScriptedAction.html" name="ScriptedAction" enctype="multipart/form-data">
- <input type="hidden" name="incidentid" value="<%$incidentid%>" />
<input type="hidden" name="loop" value="<%$ARGS{'loop'}%>" />
<input type="hidden" name="UpdateType" value="response" />
<input type="hidden" name="Action" value="Respond" />
--- 31,36 ----
***************
*** 132,137 ****
--- 131,144 ----
<input name="TemplateArg" size="60" value="<% $ARGS{'TemplateArg'} %>" />
</td>
</tr>
+ <tr>
+ <td class="label">
+ <&|/l&>Link to incident</&>:
+ </td>
+ <td>
+ <input type="text" name="incidentid" value="<%$incidentid%>" />
+ </td>
+ </tr>
<tr>
<td align="right" colspan="2">
</td>
***************
*** 313,318 ****
--- 320,326 ----
$ARGS{'Subject'} = $original_subject;
$ARGS{'Content'} = $original_content;
+ $ARGS{'Requestors'} = $addr;
for (qw/Subject Content/) {
$ARGS{$_} =~ s/_ADDR_/$addr/g;
--- end of diff ---
I noticed this further down:
my @watchresults = ProcessTicketWatchers(
TicketObj => $Ticket,
ARGSRef => { %ARGS, AddRequestor => $addr },
);
This meant that we could see requestors in investigation tickets OK, but no mail was being sent out! Confusing.
Well - of course, since at the time the ticket was created, the requestor was not specified yet (thus the corresponding Scrip error that no recipients are listed). Later in the loop when the requestor was added this does not trigger any scrips that deal with correspondence! IMO.
Regards,
Gorazd
--
Gorazd Bozic <gorazd.bozic at arnes.si>
ARNES SI-CERT, Tehnološki park 18, p.p. 7, SI-1001 Ljubljana, Slovenia
tel: +386 1 479 88 22, fax: +386 1 479 88 23
More information about the Rtir
mailing list