Custom scrip to parse new emails and reject them

Hi, I’m sorry if this is noobish, but I’m having trouble figuring out how to
do it
We use a service called phonetag to take voicemails and transcribe them
(with attached .wav files) to emails that reach our helpdesk. The problem is
about 75% of them are blank, because the caller did not leave a message.

When that happens the email comes in saying “We’re sorry, the caller hung up
before leaving a message”. I’d like to look for “the caller hung up” and
have RT reject any tickets from emails containing that.

I tried writing my own conditions based on some samples I found online but I
can’t quite get it working, can anyone recommend some documentation that
would get me on the right track, or any other kind of help?

-Steve

Hi, I’m sorry if this is noobish, but I’m having trouble figuring out how to
do it
We use a service called phonetag to take voicemails and transcribe them
(with attached .wav files) to emails that reach our helpdesk. The problem is
about 75% of them are blank, because the caller did not leave a message.
When that happens the email comes in saying “We’re sorry, the caller hung up
before leaving a message”. I’d like to look for “the caller hung up” and
have RT reject any tickets from emails containing that.
I tried writing my own conditions based on some samples I found online but I
can’t quite get it working, can anyone recommend some documentation that
would get me on the right track, or any other kind of help?

You could look at RT::Interface::email::Filter::SpamAssassin as a
starting point;
just be sure to have Auth::MailFrom as a higher precedent in your MailPlugins.
This would allow you to access the message for parsing, and punt it as desired.

Cambridge Energy Alliance: Save money. Save the planet.

Clean up this:
http://wiki.bestpractical.com/view/ReplyBasedUponContent
Apply this action with obviouse changes:
http://wiki.bestpractical.com/view/ResolveTicketOn Mon, Nov 10, 2008 at 9:04 PM, Steve Hopps steve.hopps@gmail.com wrote:

Hi, I’m sorry if this is noobish, but I’m having trouble figuring out how to
do it
We use a service called phonetag to take voicemails and transcribe them
(with attached .wav files) to emails that reach our helpdesk. The problem is
about 75% of them are blank, because the caller did not leave a message.
When that happens the email comes in saying “We’re sorry, the caller hung up
before leaving a message”. I’d like to look for “the caller hung up” and
have RT reject any tickets from emails containing that.
I tried writing my own conditions based on some samples I found online but I
can’t quite get it working, can anyone recommend some documentation that
would get me on the right track, or any other kind of help?
-Steve


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Best regards, Ruslan.

Hrm, that’s what I’ve been trying, here’s what I’ve got so far:condition:
user defined
action: user defined
template: blank
stage: TransactionCreate

Custom Condition:
my $Ticket = $self->TicketObj; my $Transaction = $self->TransactionObj; my
$Attachment = $Transaction->Attachments; my $AttFirst = $Attachment->First;
my $Content = $AttFirst->Content; my $test = 0; $test = 1 if (lc($Content)
=~ m/caller hung up/); if($test == 1) {$Ticket->SetStatus( Status => ‘open’
, Force => 1,); return 1; }return;

custom action preparation:
return 1;

custom action cleanup:
$self->TicketObj->SetStatus( “rejected” ); return 1;

I must be doing something wrong tho, it’s not working still? I really
appreciate all your help, thanks!!

P.S. Sorry for sending this to you directly Ruslan, my mistake!

-SteveOn Mon, Nov 10, 2008 at 12:21 PM, Ruslan Zakirov ruz@bestpractical.comwrote:

Clean up this:
ReplyBasedUponContent - Request Tracker Wiki
Apply this action with obviouse changes:
ResolveTicket - Request Tracker Wiki

On Mon, Nov 10, 2008 at 9:04 PM, Steve Hopps steve.hopps@gmail.com wrote:

Hi, I’m sorry if this is noobish, but I’m having trouble figuring out how
to
do it
We use a service called phonetag to take voicemails and transcribe them
(with attached .wav files) to emails that reach our helpdesk. The problem
is
about 75% of them are blank, because the caller did not leave a message.
When that happens the email comes in saying “We’re sorry, the caller hung
up
before leaving a message”. I’d like to look for “the caller hung up” and
have RT reject any tickets from emails containing that.
I tried writing my own conditions based on some samples I found online
but I
can’t quite get it working, can anyone recommend some documentation that
would get me on the right track, or any other kind of help?
-Steve


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Best regards, Ruslan.

Okay, I’ve managed to get this to capture new tickets created via the
helpdesk, but it’s still not grabbing tickets created via e-mail. Here’s
what I have so far:
Condition: User Defined
Action: User Defined
Template: Global template: Blank
Stage: TransactionCreate

Custom Condition:
my $Ticket = $self->TicketObj; my $Transaction = $self->TransactionObj; my
$Attachment = $Transaction->Attachments; my $AttFirst = $Attachment->First;
my $Content = $AttFirst->Content; my $test = 0; $test = 1 if (lc($Content)
=~ m/the caller hung up before leaving a message/i); if($test == 1) { return
1; } return;

Custom Action Prep:
$self->TicketObj->SetStatus( “rejected” ); return 1;

Custom Action Cleanup:
return 1;

So if I create a new ticket using the new ticket function of the helpdesk,
and paste in the line I want to match, the ticket is rejected immediately
upon creation.

However, emails that come from our voicemail system still become tickets
with a status of ‘new’

Any suggestions? I appreciate any help, right now we spend way too much time
just clearing out these empty tickets :frowning:

-SteveOn Mon, Nov 10, 2008 at 12:21 PM, Ruslan Zakirov ruz@bestpractical.comwrote:

Clean up this:
ReplyBasedUponContent - Request Tracker Wiki
Apply this action with obviouse changes:
ResolveTicket - Request Tracker Wiki

On Mon, Nov 10, 2008 at 9:04 PM, Steve Hopps steve.hopps@gmail.com wrote:

Hi, I’m sorry if this is noobish, but I’m having trouble figuring out how
to
do it
We use a service called phonetag to take voicemails and transcribe them
(with attached .wav files) to emails that reach our helpdesk. The problem
is
about 75% of them are blank, because the caller did not leave a message.
When that happens the email comes in saying “We’re sorry, the caller hung
up
before leaving a message”. I’d like to look for “the caller hung up” and
have RT reject any tickets from emails containing that.
I tried writing my own conditions based on some samples I found online
but I
can’t quite get it working, can anyone recommend some documentation that
would get me on the right track, or any other kind of help?
-Steve


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Best regards, Ruslan.