Rt-crontool not sending mail, no errors

View this message in context: http://requesttracker.8502.n7.nabble.com/rt-crontool-not-sending-mail-no-errors-tp60081p60082.html

Hi,

I’m trying to use rt-crontool, to send out reminders when a ticket expires due date.

The command and output is like this, but no mail is sent:

[root@ ~]# /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \

    --search-arg 'Queue = "The Queue" and (Status = "open" or Status = "new")' \
    --condition RT::Condition::BeforeDue \
    --condition-arg 0d2h3m1s \
    --action RT::Action::NotifyGroup \
    --action-arg 'mail@domain.se' \
    --transaction first \
    --template 'Reminder due soon' \
    --verbose \
    --log debug

[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)

18079:

    Using transaction #111037...

18331:

    Using transaction #113770...

Does anyone know, what could be the problem here?

And, yes, mailing works, when you for exapmle resolve a ticket from the web interface.

BR

Fredrik

Hi Fredrik,

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.
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.

I have similar notifications for Reminders working with the following
command, just in case it’s useful:

/opt/rt4/bin/rt-crontool
–search RT::Search::FromSQL
–search-arg ‘Type = “reminder” and (Status = “open” or
Status = “new”) and Due > “now”’
–condition RT::Condition::BeforeDue
–condition-arg 5m
–action RT::Action::Notify
–action-arg Owner,AlwaysNotifyActor
–transaction first
–template ‘Reminder’

Regards.2015-05-22 13:03 GMT+02:00 Fredrik Nyström Fredrik.Nystrom@prevas.se:

Hi,

I’m trying to use rt-crontool, to send out reminders when a ticket expires
due date.

The command and output is like this, but no mail is sent:

[root@ ~]# /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL
\

    --search-arg 'Queue = "The Queue" and (Status = "open" or Status

= “new”)’ \

    --condition RT::Condition::BeforeDue \
    --condition-arg 0d2h3m1s \
    --action RT::Action::NotifyGroup \
    --action-arg 'mail@domain.se' \
    --transaction first \
    --template 'Reminder due soon' \
    --verbose \
    --log debug

[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)

18079:

    Using transaction #111037...

18331:

    Using transaction #113770...

Does anyone know, what could be the problem here?

And, yes, mailing works, when you for exapmle resolve a ticket from the
web interface.

BR

Fredrik

Hi,
Thanks for your reply.
If I try your command example, I get an debug output of:

[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)

And the output from the command in my previous mail, shows result of two tickets:

18079:

    Using transaction #111037...

18331:

    Using transaction #113770...

The two ticket I have “faked” and set a due date in.
I can’t find what is wrong. No error, but there is no mail sent.

/FredrikFrom: marcosorallo@gmail.com [mailto:marcosorallo@gmail.com] On Behalf Of Marcos Orallo
Sent: Saturday, May 23, 2015 4:58 PM
To: Fredrik Nyström
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] rt-crontool not sending mail, no errors

Hi Fredrik,

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.
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.

I have similar notifications for Reminders working with the following command, just in case it’s useful:
/opt/rt4/bin/rt-crontool
–search RT::Search::FromSQL
–search-arg ‘Type = “reminder” and (Status = “open” or Status = “new”) and Due > “now”’
–condition RT::Condition::BeforeDue
–condition-arg 5m
–action RT::Action::Notify
–action-arg Owner,AlwaysNotifyActor
–transaction first
–template 'Reminder’
Regards.

2015-05-22 13:03 GMT+02:00 Fredrik Nyström <Fredrik.Nystrom@prevas.semailto:Fredrik.Nystrom@prevas.se>:

Hi,

I’m trying to use rt-crontool, to send out reminders when a ticket expires due date.

The command and output is like this, but no mail is sent:

[root@ ~]# /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \

    --search-arg 'Queue = "The Queue" and (Status = "open" or Status = "new")' \
    --condition RT::Condition::BeforeDue \
    --condition-arg 0d2h3m1s \
    --action RT::Action::NotifyGroup \
    --action-arg 'mail@domain.se<mailto:mail@domain.se>' \
    --transaction first \
    --template 'Reminder due soon' \
    --verbose \
    --log debug

[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)

18079:

    Using transaction #111037...

18331:

    Using transaction #113770...

Does anyone know, what could be the problem here?

And, yes, mailing works, when you for exapmle resolve a ticket from the web interface.

BR

Fredrik

I may be suggesting the obvious again but did you make sure the template
works? Does it have any perl code?

Do you get the transactions showed in your output registered in the
database?El 25/5/2015 8:53 a. m., “Fredrik Nyström” Fredrik.Nystrom@prevas.se escribió:

Hi,

Thanks for your reply.

If I try your command example, I get an debug output of:

[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)

And the output from the command in my previous mail, shows result of two
tickets:

18079:

    Using transaction #111037...

18331:

    Using transaction #113770...

The two ticket I have “faked” and set a due date in.

I can’t find what is wrong. No error, but there is no mail sent.

/Fredrik

From: marcosorallo@gmail.com [mailto:marcosorallo@gmail.com] *On Behalf
Of *Marcos Orallo
Sent: Saturday, May 23, 2015 4:58 PM
To: Fredrik Nyström
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] rt-crontool not sending mail, no errors

Hi Fredrik,

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.

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.

I have similar notifications for Reminders working with the following
command, just in case it’s useful:

/opt/rt4/bin/rt-crontool
–search RT::Search::FromSQL
–search-arg ‘Type = “reminder” and (Status = "open"
or Status = “new”) and Due > “now”’
–condition RT::Condition::BeforeDue
–condition-arg 5m
–action RT::Action::Notify
–action-arg Owner,AlwaysNotifyActor
–transaction first
–template ‘Reminder’

Regards.

2015-05-22 13:03 GMT+02:00 Fredrik Nyström Fredrik.Nystrom@prevas.se:

Hi,

I’m trying to use rt-crontool, to send out reminders when a ticket expires
due date.

The command and output is like this, but no mail is sent:

[root@ ~]# /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL
\

    --search-arg 'Queue = "The Queue" and (Status = "open" or Status

= “new”)’ \

    --condition RT::Condition::BeforeDue \
    --condition-arg 0d2h3m1s \
    --action RT::Action::NotifyGroup \
    --action-arg 'mail@domain.se' \
    --transaction first \
    --template 'Reminder due soon' \
    --verbose \
    --log debug

[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)

18079:

    Using transaction #111037...

18331:

    Using transaction #113770...

Does anyone know, what could be the problem here?

And, yes, mailing works, when you for exapmle resolve a ticket from the
web interface.

BR

Fredrik

This is the output from one of the transaction id’s:

| id | ObjectType | ObjectId | TimeTaken | Type | Field | OldValue | NewValue | ReferenceType | OldReference | NewReference | Data | Creator | Created |
| 113770 | RT::Ticket | 18331 | 0 | Create | NULL | NULL | NULL | NULL | NULL | NULL | NULL | 198 | 2015-05-18 07:24:56 |

I followed the “Reminder due soon” example, from http://requesttracker.wikia.com/wiki/RemindersTo: { $Target = $Ticket->RefersTo->First->TargetObj; ($Argument eq ‘TicketOwner’ ? $Target : $Ticket)->OwnerObj->EmailAddress }
Subject: {$Ticket->Subject} is due {$Ticket->DueAsString}

Just a friendly heads up. This reminder is for ticket #{$Target->Id}.

{RT->Config->Get(‘WebURL’)}Ticket/Display.html?id={$Target->Id}

BR
Fredrik

From: marcosorallo@gmail.com [mailto:marcosorallo@gmail.com] On Behalf Of Marcos Orallo
Sent: Monday, May 25, 2015 10:08 AM
To: Fredrik Nyström
Cc: rt-users@lists.bestpractical.com
Subject: RE: [rt-users] rt-crontool not sending mail, no errors

I may be suggesting the obvious again but did you make sure the template works? Does it have any perl code?

Do you get the transactions showed in your output registered in the database?

Hi,
Thanks for your reply.
If I try your command example, I get an debug output of:

[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)

And the output from the command in my previous mail, shows result of two tickets:

18079:

    Using transaction #111037...

18331:

    Using transaction #113770...

The two ticket I have “faked” and set a due date in.
I can’t find what is wrong. No error, but there is no mail sent.

/Fredrik

From: marcosorallo@gmail.commailto:marcosorallo@gmail.com [mailto:marcosorallo@gmail.commailto:marcosorallo@gmail.com] On Behalf Of Marcos Orallo
Sent: Saturday, May 23, 2015 4:58 PM
To: Fredrik Nyström
Cc: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com
Subject: Re: [rt-users] rt-crontool not sending mail, no errors

Hi Fredrik,

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.
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.

I have similar notifications for Reminders working with the following command, just in case it’s useful:
/opt/rt4/bin/rt-crontool
–search RT::Search::FromSQL
–search-arg ‘Type = “reminder” and (Status = “open” or Status = “new”) and Due > “now”’
–condition RT::Condition::BeforeDue
–condition-arg 5m
–action RT::Action::Notify
–action-arg Owner,AlwaysNotifyActor
–transaction first
–template 'Reminder’
Regards.

2015-05-22 13:03 GMT+02:00 Fredrik Nyström <Fredrik.Nystrom@prevas.semailto:Fredrik.Nystrom@prevas.se>:

Hi,

I’m trying to use rt-crontool, to send out reminders when a ticket expires due date.

The command and output is like this, but no mail is sent:

[root@ ~]# /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \

    --search-arg 'Queue = "The Queue" and (Status = "open" or Status = "new")' \
    --condition RT::Condition::BeforeDue \
    --condition-arg 0d2h3m1s \
    --action RT::Action::NotifyGroup \
    --action-arg 'mail@domain.se<mailto:mail@domain.se>' \
    --transaction first \
    --template 'Reminder due soon' \
    --verbose \
    --log debug

[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)

18079:

    Using transaction #111037...

18331:

    Using transaction #113770...

Does anyone know, what could be the problem here?

And, yes, mailing works, when you for exapmle resolve a ticket from the web interface.

BR

Fredrik

Hi,
I gave up solving this, and scheduled this perl script http://requesttracker.wikia.com/wiki/DueDateRemindersByEmail, instead of using rt-crontool.

Works like a charm.

BR
FredrikFrom: rt-users [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Fredrik Nyström
Sent: Monday, May 25, 2015 12:55 PM
To: 'Marcos Orallo’
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] rt-crontool not sending mail, no errors

This is the output from one of the transaction id’s:

| id | ObjectType | ObjectId | TimeTaken | Type | Field | OldValue | NewValue | ReferenceType | OldReference | NewReference | Data | Creator | Created |
| 113770 | RT::Ticket | 18331 | 0 | Create | NULL | NULL | NULL | NULL | NULL | NULL | NULL | 198 | 2015-05-18 07:24:56 |

I followed the “Reminder due soon” example, from http://requesttracker.wikia.com/wiki/Reminders

To: { $Target = $Ticket->RefersTo->First->TargetObj; ($Argument eq ‘TicketOwner’ ? $Target : $Ticket)->OwnerObj->EmailAddress }
Subject: {$Ticket->Subject} is due {$Ticket->DueAsString}

Just a friendly heads up. This reminder is for ticket #{$Target->Id}.

{RT->Config->Get(‘WebURL’)}Ticket/Display.html?id={$Target->Id}

BR
Fredrik

From: marcosorallo@gmail.commailto:marcosorallo@gmail.com [mailto:marcosorallo@gmail.com] On Behalf Of Marcos Orallo
Sent: Monday, May 25, 2015 10:08 AM
To: Fredrik Nyström
Cc: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com
Subject: RE: [rt-users] rt-crontool not sending mail, no errors

I may be suggesting the obvious again but did you make sure the template works? Does it have any perl code?

Do you get the transactions showed in your output registered in the database?

Hi,
Thanks for your reply.
If I try your command example, I get an debug output of:

[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)

And the output from the command in my previous mail, shows result of two tickets:

18079:

    Using transaction #111037...

18331:

    Using transaction #113770...

The two ticket I have “faked” and set a due date in.
I can’t find what is wrong. No error, but there is no mail sent.

/Fredrik

From: marcosorallo@gmail.commailto:marcosorallo@gmail.com [mailto:marcosorallo@gmail.commailto:marcosorallo@gmail.com] On Behalf Of Marcos Orallo
Sent: Saturday, May 23, 2015 4:58 PM
To: Fredrik Nyström
Cc: rt-users@lists.bestpractical.commailto:rt-users@lists.bestpractical.com
Subject: Re: [rt-users] rt-crontool not sending mail, no errors

Hi Fredrik,

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.
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.

I have similar notifications for Reminders working with the following command, just in case it’s useful:
/opt/rt4/bin/rt-crontool
–search RT::Search::FromSQL
–search-arg ‘Type = “reminder” and (Status = “open” or Status = “new”) and Due > “now”’
–condition RT::Condition::BeforeDue
–condition-arg 5m
–action RT::Action::Notify
–action-arg Owner,AlwaysNotifyActor
–transaction first
–template 'Reminder’
Regards.

2015-05-22 13:03 GMT+02:00 Fredrik Nyström <Fredrik.Nystrom@prevas.semailto:Fredrik.Nystrom@prevas.se>:

Hi,

I’m trying to use rt-crontool, to send out reminders when a ticket expires due date.

The command and output is like this, but no mail is sent:

[root@ ~]# /opt/rt4/bin/rt-crontool --search RT::Search::FromSQL \

    --search-arg 'Queue = "The Queue" and (Status = "open" or Status = "new")' \
    --condition RT::Condition::BeforeDue \
    --condition-arg 0d2h3m1s \
    --action RT::Action::NotifyGroup \
    --action-arg 'mail@domain.se<mailto:mail@domain.se>' \
    --transaction first \
    --template 'Reminder due soon' \
    --verbose \
    --log debug

[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)

18079:

    Using transaction #111037...

18331:

    Using transaction #113770...

Does anyone know, what could be the problem here?

And, yes, mailing works, when you for exapmle resolve a ticket from the web interface.

BR

Fredrik