Rt-crontool problems

I’m hoping someone can help me here. I am trying to learn how to use
rt-crontool, I have written my own very basic Search and Condition
modules and tried to use the RT::Action::SendEmail module. I am using
it as follows:

rt-crontool --search RT::Search::StatusMatches --search-arg resolved
–condition RT::Condition::ThisWeek --action RT::Action::SendEmail
–template-id 13 --verbose

The error I get is:

[Wed Jun 25 10:48:01 2003] [error]: error: unexpected end of header

(/usr/share/perl5/RT/Template_Overlay.pm:345)

for every ticket that matches my criteria.

This error seems to be coming from the line:

$self->{'MIMEObj'} = eval { $parser->parse_data($content) };

Am I setting up the template incorrectly or is this a bug of some
sort? I am using rt3.0.3 with MIME-tools 5.411.

Thanks in advance,

Stephen Quinney

Here’s the various modules and the template I’ve written:

The template (id number 13):

Name: notify_me
Description: notify me of resolved tickets
Content: some content could be here

package RT::Condition::ThisWeek;
use strict;
use warnings;

require RT::Condition::Generic;
use vars qw/@ISA/;
@ISA = qw(RT::Condition::Generic);

currently this does not do anything except return true

sub IsApplicable {
return(1);
}

1;

package RT::Search::StatusMatches;
use strict;
use warnings;

use base qw(RT::Search::Generic);

sub Describe {
my $self = shift;
return ($self->loc(“No description for [_1]”, ref $self));
}

sub Prepare {
my $self = shift;

$self->TicketsObj->LimitStatus(VALUE => $self->Argument) if $self->Argument;

return(1);
}

1;

Have you tried strace?-----Original Message-----
From: Stephen Quinney
[mailto:stephen.quinney@computing-services.oxford.ac.uk]
Sent: Wednesday,25 June,2003 13:07
To: rt-devel@lists.fsck.com
Subject: [rt-devel] rt-crontool problems

I’m hoping someone can help me here. I am trying to learn how to use
rt-crontool, I have written my own very basic Search and Condition
modules and tried to use the RT::Action::SendEmail module. I am using it
as follows:

rt-crontool --search RT::Search::StatusMatches --search-arg resolved
–condition RT::Condition::ThisWeek --action RT::Action::SendEmail
–template-id 13 --verbose

The error I get is:

[Wed Jun 25 10:48:01 2003] [error]: error: unexpected end of header

(/usr/share/perl5/RT/Template_Overlay.pm:345)

for every ticket that matches my criteria.

This error seems to be coming from the line:

$self->{'MIMEObj'} = eval { $parser->parse_data($content) };

Am I setting up the template incorrectly or is this a bug of some sort?
I am using rt3.0.3 with MIME-tools 5.411.

Thanks in advance,

Stephen Quinney

Here’s the various modules and the template I’ve written:

The template (id number 13):

Name: notify_me
Description: notify me of resolved tickets
Content: some content could be here

package RT::Condition::ThisWeek;
use strict;
use warnings;

require RT::Condition::Generic;
use vars qw/@ISA/;
@ISA = qw(RT::Condition::Generic);

currently this does not do anything except return true

sub IsApplicable {
return(1);
}

1;

package RT::Search::StatusMatches;
use strict;
use warnings;

use base qw(RT::Search::Generic);

sub Describe {
my $self = shift;
return ($self->loc(“No description for [_1]”, ref $self));
}

sub Prepare {
my $self = shift;

$self->TicketsObj->LimitStatus(VALUE => $self->Argument) if
$self->Argument;

return(1);
}

1;

rt-devel mailing list
rt-devel@lists.fsck.com http://lists.fsck.com/mailman/listinfo/rt-devel

I know I can search based on attachment criteria but my requirement is
to search for keywords that are
found in word documents that are sent to the queue as ticket attachments…
I understand that I will not be able to use Win32::OLE (the active state
package) as I am running on Linux (how feasible is it to run RT on
windows btw?). are there any other packages? has anyone done any work in
this direction yet?

All help will be very much appreciated.
Regards
Ron

found in word documents that are sent to the queue as ticket attachments…
I understand that I will not be able to use Win32::OLE (the active state
package) as I am running on Linux (how feasible is it to run RT on
windows btw?). are there any other packages? has anyone done any work in
this direction yet?

Try Wv/wvHtml (previous known as MSWordView):

http://wvware.sourceforge.net/

It worksforme. :slight_smile:

Thanks,
/Autrijus/

Autrijus Tang wrote:

found in word documents that are sent to the queue as ticket attachments…
I understand that I will not be able to use Win32::OLE (the active state
package) as I am running on Linux (how feasible is it to run RT on
windows btw?). are there any other packages? has anyone done any work in
this direction yet?

Try Wv/wvHtml (previous known as MSWordView):

http://wvware.sourceforge.net/

It worksforme. :slight_smile:

Watch out Java programmer needs help with perl… :-[

So I spent half a day getting wvware to build on my (flashing) MDK box
(turns out the source on the homepage is not compatible with the source
on abiword.org and blablabla…) and now I was thinking of doing
something like so:

whenever a new attachment is added (either on creation or on any other
stage in the ticket’s lifetime) check is the attachment is a *.doc file
and if it is, create an html version of the same file (HTML covers
directions and languages and so is better then text…) and add it to the
ticket as second attachment (later probably add a config variable to
flag this on and off etc…). I was thinking of creating an
Attachments_Local.pm module that only overrides the Create method and
does something like this:

sub Create {
my $self = shift; # I have no practical experience
with OO perl please tell me about the stuff I am doing wrong here

# get the name of the file being attached (copied from 

Attachment_Overlay)
my $Filename = $Attachment->head->recommended_filename || eval {
${ $Attachment->head->{mail_hdr_hash}{‘Content-Disposition’}[0] }
=~ /^.\bfilename="(.)"$/ ? $1 : ‘’
};

# see if we got a *.doc attachment
my @parts;
my $filename = $Filename;   # save the filename
split /./, $filename;                  # primitive, any better 

suggestions very welcome
if(lc($parts[1]) eq “doc”) {
wvHtml $Filename $parts[0]."html"; #this is where the
conversion is done
}

 #    Here is where I would like to call "super" on both $Filename 

and $filename
# I don’t know how to do this in perl, I am not sure I am even
in the right direction with the idea of Attachments_Local???

Any help will be greatly appreciated.

Regards
Ron.

I found in the log that SendEmail needs a Transactionobj and that
rt-crontool hasn’t such an object defined, and it isn’t in the search
module.
So rt-crontool does not send e-mail notification.
Do someone has a solution for sending mails throught rt-crontool in
RT3??
Also some search improvements could be interestings like, untaken in
hours or overdue by hours.

Thanks.

Samuel Senoner-----Original Message-----
From: Stephen Quinney
[mailto:stephen.quinney@computing-services.oxford.ac.uk]
Sent: Wednesday,25 June,2003 13:07
To: rt-devel@lists.fsck.com
Subject: [rt-devel] rt-crontool problems

I’m hoping someone can help me here. I am trying to learn how to use
rt-crontool, I have written my own very basic Search and Condition
modules and tried to use the RT::Action::SendEmail module. I am using it
as follows:

rt-crontool --search RT::Search::StatusMatches --search-arg resolved
–condition RT::Condition::ThisWeek --action RT::Action::SendEmail
–template-id 13 --verbose

The error I get is:

[Wed Jun 25 10:48:01 2003] [error]: error: unexpected end of header

(/usr/share/perl5/RT/Template_Overlay.pm:345)

for every ticket that matches my criteria.

This error seems to be coming from the line:

$self->{'MIMEObj'} = eval { $parser->parse_data($content) };

Am I setting up the template incorrectly or is this a bug of some sort?
I am using rt3.0.3 with MIME-tools 5.411.

Thanks in advance,

Stephen Quinney

Here’s the various modules and the template I’ve written:

The template (id number 13):

Name: notify_me
Description: notify me of resolved tickets
Content: some content could be here

package RT::Condition::ThisWeek;
use strict;
use warnings;

require RT::Condition::Generic;
use vars qw/@ISA/;
@ISA = qw(RT::Condition::Generic);

currently this does not do anything except return true

sub IsApplicable {
return(1);
}

1;

package RT::Search::StatusMatches;
use strict;
use warnings;

use base qw(RT::Search::Generic);

sub Describe {
my $self = shift;
return ($self->loc(“No description for [_1]”, ref $self));
}

sub Prepare {
my $self = shift;

$self->TicketsObj->LimitStatus(VALUE => $self->Argument) if
$self->Argument;

return(1);
}

1;

rt-devel mailing list
rt-devel@lists.fsck.com http://lists.fsck.com/mailman/listinfo/rt-devel

Have you found a possibility to use rt-crontool?
I saw that our bug requests haven’t been changed.
Also nobody could explain to me how rt-crontool works with the
TransactionObj variable.

Thanks

Samuel-----Original Message-----
From: Stephen Quinney
[mailto:stephen.quinney@computing-services.oxford.ac.uk]
Sent: Wednesday,25 June,2003 13:07
To: rt-devel@lists.fsck.com

I’m hoping someone can help me here. I am trying to learn how to use
rt-crontool, I have written my own very basic Search and Condition
modules and tried to use the RT::Action::SendEmail module. I am using it
as follows:

rt-crontool --search RT::Search::StatusMatches --search-arg resolved
–condition RT::Condition::ThisWeek --action RT::Action::SendEmail
–template-id 13 --verbose

The error I get is:

[Wed Jun 25 10:48:01 2003] [error]: error: unexpected end of header

(/usr/share/perl5/RT/Template_Overlay.pm:345)

for every ticket that matches my criteria.

This error seems to be coming from the line:

$self->{'MIMEObj'} = eval { $parser->parse_data($content) };

Am I setting up the template incorrectly or is this a bug of some sort?
I am using rt3.0.3 with MIME-tools 5.411.

Thanks in advance,

Stephen Quinney

Here’s the various modules and the template I’ve written:

The template (id number 13):

Name: notify_me
Description: notify me of resolved tickets
Content: some content could be here

package RT::Condition::ThisWeek;
use strict;
use warnings;

require RT::Condition::Generic;
use vars qw/@ISA/;
@ISA = qw(RT::Condition::Generic);

currently this does not do anything except return true

sub IsApplicable {
return(1);
}

1;

package RT::Search::StatusMatches;
use strict;
use warnings;

use base qw(RT::Search::Generic);

sub Describe {
my $self = shift;
return ($self->loc(“No description for [_1]”, ref $self)); }

sub Prepare {
my $self = shift;

$self->TicketsObj->LimitStatus(VALUE => $self->Argument) if
$self->Argument;

return(1);
}

1;

rt-devel mailing list
rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel

Added two empty lines. Same problem.
Does rt-crontool with e-mail notification work in your RT3?

rt:~# rt-crontool --search RT::Search::ActiveTicketsInQueue --search-arg
Helk --condition RT::Condition::Overdue --action RT::Action::SendEmail
–template-id 13 --verbose

[Thu Sep 11 08:12:11 2003] [error]: error: unexpected end of header

(/usr/share/perl5/RT/Template_Overlay.pm:345)
49: Condition matches…
[Thu Sep 11 08:12:11 2003] [error]: error: unexpected end of header

(/usr/share/perl5/RT/Template_Overlay.pm:345)
51: Condition matches…
[Thu Sep 11 08:12:11 2003] [error]: error: unexpected end of header

(/usr/share/perl5/RT/Template_Overlay.pm:345)
52: Condition matches…
53:
[Thu Sep 11 08:12:11 2003] [error]: error: unexpected end of header

(/usr/share/perl5/RT/Template_Overlay.pm:345)
54: Condition matches…
71:
73:
77:
78:

Thanks

SamuelFrom: Ruslan U. Zakirov [mailto:cubic@acronis.ru]
Sent: Wednesday,10 September,2003 12:53
To: Senoner Samuel

Try to put two empty lines at the top of your template #13.

Senoner Samuel wrote:

Have you found a possibility to use rt-crontool?
I saw that our bug requests haven’t been changed.
Also nobody could explain to me how rt-crontool works with the
TransactionObj variable.

Thanks

Samuel

-----Original Message-----
From: Stephen Quinney
[mailto:stephen.quinney@computing-services.oxford.ac.uk]
Sent: Wednesday,25 June,2003 13:07
To: rt-devel@lists.fsck.com

I’m hoping someone can help me here. I am trying to learn how to use
rt-crontool, I have written my own very basic Search and Condition
modules and tried to use the RT::Action::SendEmail module. I am using
it as follows:

rt-crontool --search RT::Search::StatusMatches --search-arg resolved
–condition RT::Condition::ThisWeek --action RT::Action::SendEmail
–template-id 13 --verbose

The error I get is:

[Wed Jun 25 10:48:01 2003] [error]: error: unexpected end of header

(/usr/share/perl5/RT/Template_Overlay.pm:345)

for every ticket that matches my criteria.

This error seems to be coming from the line:

$self->{‘MIMEObj’} = eval { $parser->parse_data($content) };

Am I setting up the template incorrectly or is this a bug of some sort?
I am using rt3.0.3 with MIME-tools 5.411.

Thanks in advance,

Stephen Quinney

Here’s the various modules and the template I’ve written:

##############

The template (id number 13):

Name: notify_me
Description: notify me of resolved tickets
Content: some content could be here

##############

package RT::Condition::ThisWeek;
use strict;
use warnings;

require RT::Condition::Generic;
use vars qw/@ISA/;
@ISA = qw(RT::Condition::Generic);

currently this does not do anything except return true

sub IsApplicable {
return(1);
}

1;

##############

package RT::Search::StatusMatches;
use strict;
use warnings;

use base qw(RT::Search::Generic);

sub Describe {
my $self = shift;
return ($self->loc(“No description for [_1]”, ref $self)); }

sub Prepare {
my $self = shift;

$self->TicketsObj->LimitStatus(VALUE => $self->Argument) if
$self->Argument;

return(1);
}

1;


rt-devel mailing list
rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel


rt-devel mailing list
rt-devel@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-devel