<p dir="ltr">I may be suggesting the obvious again but did you make sure the template works? Does it have any perl code?</p>
<p dir="ltr">Do you get the transactions showed in your output registered in the database?</p>
<div class="gmail_quote">El 25/5/2015 8:53 a. m., "Fredrik Nyström" <<a href="mailto:Fredrik.Nystrom@prevas.se">Fredrik.Nystrom@prevas.se</a>> escribió:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="SV" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif">Hi,<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif">Thanks for your reply.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif">If I try your command example, I get an debug output of:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">[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)<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif">And the output from the command in my previous mail, shows result of two tickets:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p>
<p><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";background:yellow">18079</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">:
</span><span style="font-size:10.0pt"><u></u><u></u></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"><u></u><u></u></span></p>
<p><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New";background:yellow">18331</span><span lang="EN-US" style="font-size:10.0pt;font-family:"Courier New"">:
</span><span style="font-size:10.0pt"><u></u><u></u></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"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif">The two ticket I have “faked” and set a due date in.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif">I can’t find what is wrong. No error, but there is no mail sent.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif">/Fredrik<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:10.0pt;font-family:"Verdana",sans-serif"><u></u> <u></u></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"> <a href="mailto:marcosorallo@gmail.com" target="_blank">marcosorallo@gmail.com</a> [mailto:<a href="mailto:marcosorallo@gmail.com" target="_blank">marcosorallo@gmail.com</a>]
<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> <a href="mailto:rt-users@lists.bestpractical.com" target="_blank">rt-users@lists.bestpractical.com</a><br>
<b>Subject:</b> Re: [rt-users] rt-crontool not sending mail, no errors<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi Fredrik,<u></u><u></u></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.<u></u><u></u></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:<u></u><u></u></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'<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal">Regards.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></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>>:<u></u><u></u></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><u></u><u></u></p>
<p><span lang="EN-US">I'm trying to use rt-crontool, to send out reminders when a ticket expires due date.
</span><u></u><u></u></p>
<p><span lang="EN-US"> </span><u></u><u></u></p>
<p><span lang="EN-US">The command and output is like this, but no mail is sent: </span>
<u></u><u></u></p>
<p><span lang="EN-US"> </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">[root@<server> ~]# /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \
</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">>         --search-arg 'Queue = "The Queue" and (Status = "open" or Status = "new")' \
</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">>         --condition RT::Condition::BeforeDue \
</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">>         --condition-arg 0d2h3m1s \
</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">>         --action RT::Action::NotifyGroup \
</span><u></u><u></u></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><u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">>         --transaction first \
</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">>         --template 'Reminder due soon' \
</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">>         --verbose \ </span>
<u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">>         --log debug </span>
<u></u><u></u></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><u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">18079: </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">        Using transaction #111037...
</span><u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">18331: </span><u></u><u></u></p>
<p><span lang="EN-US" style="font-family:"Courier New"">        Using transaction #113770...
</span><u></u><u></u></p>
<p><span lang="EN-US"> </span><u></u><u></u></p>
<p><span lang="EN-US">Does anyone know, what could be the problem here? </span><u></u><u></u></p>
<p><span lang="EN-US"> </span><u></u><u></u></p>
<p><span lang="EN-US">And, yes, mailing works, when you for exapmle resolve a ticket from the web interface.
</span><u></u><u></u></p>
<p><span lang="EN-US"> </span><u></u><u></u></p>
<p>BR <u></u><u></u></p>
<p><span style="color:#888888">Fredrik<u></u><u></u></span></p>
<p class="MsoNormal"><span style="color:#888888"> <u></u><u></u></span></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>

</blockquote></div>