Move e-mail automaticly to queue?

Hi list,

A question, I would like people to be able to send e-mail to one address and
have RT automaticly move it to a queue based on a predefined subject.

As I understand it either all queues would have their own e-mail address or
you would filter incoming e-mail manually. Would anyone know a way to get RT
to move the email to a queue automaticly?

Many thanks in advance for any help on this.

Best regards,

Machiel van Veen

Hi,

Don’t try to use RT to put the email into the queues. Use your mail
filtering to run different commands with rt-mailgate.

Set up I have running here has an Exim filter sitting in the RT users
directory, and that feeds mail where it should go, and discards ones
which match particular criteria, like really big ones, for example.

Procmail would also allow you to do that kind of filtering.

Steve Anderson.-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Machiel
van Veen
Sent: 17 July 2007 16:11
To: rt-users@lists.bestpractical.com
Subject: [rt-users] Move e-mail automaticly to queue?

Hi list,

A question, I would like people to be able to send e-mail to one address
and
have RT automaticly move it to a queue based on a predefined subject.

As I understand it either all queues would have their own e-mail address
or
you would filter incoming e-mail manually. Would anyone know a way to
get RT
to move the email to a queue automaticly?

Many thanks in advance for any help on this.

Best regards,

Machiel van Veen
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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

This email has been scanned by Netintelligence

My suggestion would be to handle this within procmail or someplace
similar. If the subject line rule matched, it would run the handler
application with the proper arguments to route it into the correct
queue.
-Matt

But if you want to do from RT you can easily by creating a queue->scrip
in the queue receiving the email;
Condition:On Create
Action:user defined
Template : Blank

Custom action prep code: return 1;
Custom action cleanup code: if ($self->TicketObj->Subject( ) =~ /YOUR
SUBJECT YOU WANT TO MATCH/i ) {

self->TicketObj->SetQueue(‘Your distenation q name or id’);
return 1;
}
return undef;

Regards;
Roy

Steve Anderson wrote:

Hello,

Many thanks for all the tips, plenty of options for me to get it going.

Thanks again and best regards,

Machiel van Veen

Hi Roy, one question:
I create a special scrip for the “General” queue (Config -> Queues -> General -> Scrips -> New scrip) as you suggested
Then I get it under “Current Scrips” of the queue.
The scrip is for condition “On Create"
By default for all queues there is “Scrip #3” for condition “On Create” (Autoreply To Requestors with template”)
Do I have to delete the global scrip for this queue or not? How in case
How are they parsed if there are global and per-queue scrips?

It seems that in my case I continue to get the global scrip action…
Version is 3.6.5
Thanks,
Gianluca

I forgot to send the log presented in /var/log/messages:

Oct 22 17:57:18 rt RT: rt-3.6.5-19605-1193068638-116.75-3-0@Peviani #75/857 - Scrip 3 (/usr/lib/perl5/vendor_
perl/5.8.8/RT/Action/SendEmail.pm:252)
Oct 22 17:57:18 rt RT: rt-3.6.5-19605-1193068638-116.75-3-0@Peviani sent To: my mail address (/usr/lib/per
l5/vendor_perl/5.8.8/RT/Action/SendEmail.pm:283)
Oct 22 17:57:18 rt RT: rt-3.6.5-19605-1193068638-1358.75-4-0@Peviani #75/857 - Scrip 4 (/usr/lib/perl5/vendor
_perl/5.8.8/RT/Action/SendEmail.pm:252)
Oct 22 17:57:18 rt RT: rt-3.6.5-19605-1193068638-1358.75-4-0@Peviani sent Bcc: another admin cc address (/usr/lib
/perl5/vendor_perl/5.8.8/RT/Action/SendEmail.pm:283)
Oct 22 17:57:18 rt RT: Scrip 16 Commit failed: Can’t locate object method “TicketObj” via package “self” (perhap
s you forgot to load “self”?) at (eval 548) line 2. Stack: [(eval 548):2] [/usr/lib/perl5/vendor_perl/5.8.8
/RT/ScripAction_Overlay.pm:242] [/usr/lib/perl5/vendor_perl/5.8.8/RT/Scrip_Overlay.pm:507] [/usr/lib/perl5/v
endor_perl/5.8.8/RT/Scrips_Overlay.pm:195] [/usr/lib/perl5/vendor_perl/5.8.8/RT/Transaction_Overlay.pm:181]
[/usr/lib/perl5/vendor_perl/5.8.8/RT/Record.pm:1461] [/usr/lib/perl5/vendor_perl/5.8.8/RT/Ticket_Overlay.pm:74
6] [/usr/lib/perl5/vendor_perl/5.8.8/RT/Interface/Email.pm:730] [/usr/share/rt3/html/REST/1.0/NoAuth/mail-ga
teway:61] (/usr/lib/perl5/vendor_perl/5.8.8/RT/Action/UserDefined.pm:83)
Oct 22 17:57:18 rt RT: Ticket 75 created in queue ‘General’ by gcecchi (/usr/lib/perl5/vendor_perl/5.8.8/RT/Tick
et_Overlay.pm:756)

Stupid me!!!

In
Custom action cleanup code I set as probably originally miswritten
self->TicketObj->SetQueue(‘Hardware’);

While the correct statement was

$self->TicketObj->SetQueue(‘Hardware’);

Sorry to the list …