<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Verdana;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
span.hoenzb
{mso-style-name:hoenzb;}
span.E-postmall19
{mso-style-type:personal-reply;
font-family:"Verdana",sans-serif;
color:windowtext;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="SV" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US">Thanks for your reply.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US">If I try your command example, I get an debug output of:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";mso-fareast-language:EN-US">[Mon May 25 06:41:58 2015] [debug]: RT::Date used Time::ParseDate to make 'now' 1432536118 (/opt/rt4/bin/../lib/RT/Date.pm:240)<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US">And the output from the command in my previous mail, shows result of two tickets:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";background:yellow;mso-highlight:yellow">18079</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">:
</span><span style="font-size:10.0pt"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> Using transaction #111037...
</span><span style="font-size:10.0pt"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";background:yellow;mso-highlight:yellow">18331</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">:
</span><span style="font-size:10.0pt"><o:p></o:p></span></p>
<p><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New""> Using transaction #113770...
</span><span style="font-size:10.0pt"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US">The two ticket I have “faked” and set a due date in.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US">I can’t find what is wrong. No error, but there is no mail sent.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US">/Fredrik<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> marcosorallo@gmail.com [mailto:marcosorallo@gmail.com]
<b>On Behalf Of </b>Marcos Orallo<br>
<b>Sent:</b> Saturday, May 23, 2015 4:58 PM<br>
<b>To:</b> Fredrik Nyström<br>
<b>Cc:</b> rt-users@lists.bestpractical.com<br>
<b>Subject:</b> Re: [rt-users] rt-crontool not sending mail, no errors<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi Fredrik,<o:p></o:p></p>
<div>
<p class="MsoNormal"><br>
Have you tried using a simpler BeforeDue condition to test? Something like "--condition-arg 2h". I don't think you need to specify the "0d", and it may confuse the condition module.<o:p></o:p></p>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">You can also try to modify the search to return something very specific (search by ticket id for example) so that you can verify that the --action part works properly.<br>
<br>
I have similar notifications for Reminders working with the following command, just in case it's useful:<o:p></o:p></p>
</div>
</div>
</div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">/opt/rt4/bin/rt-crontool \<br>
--search RT::Search::FromSQL \<br>
--search-arg 'Type = "reminder" and (Status = "open" or Status = "new") and Due > "now"' \<br>
--condition RT::Condition::BeforeDue \<br>
--condition-arg 5m \<br>
--action RT::Action::Notify \<br>
--action-arg Owner,AlwaysNotifyActor \<br>
--transaction first \<br>
--template 'Reminder'<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Regards.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">2015-05-22 13:03 GMT+02:00 Fredrik Nyström <<a href="mailto:Fredrik.Nystrom@prevas.se" target="_blank">Fredrik.Nystrom@prevas.se</a>>:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p><span lang="EN-US">Hi, </span><o:p></o:p></p>
<p><span lang="EN-US">I'm trying to use rt-crontool, to send out reminders when a ticket expires due date.
</span><o:p></o:p></p>
<p><span lang="EN-US"> </span><o:p></o:p></p>
<p><span lang="EN-US">The command and output is like this, but no mail is sent: </span>
<o:p></o:p></p>
<p><span lang="EN-US"> </span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">[root@<server> ~]# /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \
</span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">> --search-arg 'Queue = "The Queue" and (Status = "open" or Status = "new")' \
</span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">> --condition RT::Condition::BeforeDue \
</span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">> --condition-arg 0d2h3m1s \
</span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">> --action RT::Action::NotifyGroup \
</span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">> --action-arg '<a href="mailto:mail@domain.se" target="_blank">mail@domain.se</a>' \
</span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">> --transaction first \
</span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">> --template 'Reminder due soon' \
</span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">> --verbose \ </span>
<o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">> --log debug </span>
<o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">[3011] [Wed May 20 06:53:26 2015] [debug]: The RTAddressRegexp option is not set in the config. Not setting this option results in additional SQL queries to check whether each address belongs to RT or
not. It is especially important to set this option if RT recieves emails on addresses that are not in the database or config. (/opt/rt4/bin/../lib/RT/Config.pm:505)
</span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">18079: </span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New""> Using transaction #111037...
</span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New"">18331: </span><o:p></o:p></p>
<p><span lang="EN-US" style="font-family:"Courier New""> Using transaction #113770...
</span><o:p></o:p></p>
<p><span lang="EN-US"> </span><o:p></o:p></p>
<p><span lang="EN-US">Does anyone know, what could be the problem here? </span><o:p></o:p></p>
<p><span lang="EN-US"> </span><o:p></o:p></p>
<p><span lang="EN-US">And, yes, mailing works, when you for exapmle resolve a ticket from the web interface.
</span><o:p></o:p></p>
<p><span lang="EN-US"> </span><o:p></o:p></p>
<p>BR <o:p></o:p></p>
<p><span style="color:#888888">Fredrik<o:p></o:p></span></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#888888"> <o:p></o:p></span></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>