[rt-users] Custom Scrip

Joseph Spenner joseph85750 at yahoo.com
Mon Sep 8 16:17:08 EDT 2003


It wouldn't be that tough with a simple (quite simple)
perl script.  I did something similar as a spam
filter.  My configuration goes something like this:
1) in /etc/aliases, I do not have the normal entry:

general: "|/opt/rt2/bin/rt-mailgate --queue general
--action correspond"

Instead, I have:

general: "|/home/gman/scripts/filter.pl"

The 'filter.pl' reads the body of the email into an
array.  If the body contains certain spam text, the
script exits (therefore, nothing goes into RT); if the
body contains no spam keywords, I do this:

open (PIPE, "|/opt/rt2/bin/rt-mailgate --queue general
--action correspond"
);
print PIPE @message;
close PIPE;

So, for your case, you could do something similar. 
But instead of dropping the message if there is spam,
you check the body for:
[your.domain.here #  (something that shows up in the
title after RT already saw it, since you only are
interested in new tickets).
If the body contains the above, you simply pass it
along to RT with the PIPE; if the body doesn't contain
the above, you generate an email to the address
interested in new messages, as well as pass it to RT
via the PIPE.

If you want examples of my perl code, I can provide.


--- "Daryl G. Jurbala" <daryl at introspect.net> wrote:
> > -----Original Message-----
> > From: Gary Rule [mailto:grule at bbn.com] 
> > Sent: Monday, September 08, 2003 2:03 PM
> > To: rt-users at lists.fsck.com
> > Subject: [rt-users] Custom Scrip
> > 
> > 
> > Hello,
> >      I'm looking for either a scrip to notify a
> particular 
> > email address when a new ticket his the queue or a
> good place 
> > with documentation on how to write custom scrips. 
> > 
> > 
> > Basically I want an email to go to our department
> email list 
> > when a new ticket is generated. I'm assuming to
> write this 
> > myself I will need to whip up some perl but I'm
> not sure how 
> > involved it will be. Are there any resources out
> there for 
> > beginning scrip writers?
> [...]
> 
> I recently asked a similar question (except I want
> to send a stipped
> down template to a pager's email address) and it was
> suggested that I
> use AdminCC.  For me, that won't work, as I'm using
> both CC's and
> AdminCC's for other purposes.
> 
> Hopefully someone can answer this question....I'm
> sure more than just
> the two of us could use this information.
> 
> Daryl
> _______________________________________________
> rt-users mailing list
> rt-users at lists.fsck.com
> http://lists.fsck.com/mailman/listinfo/rt-users
> 
> Have you read the FAQ? The RT FAQ Manager lives at
http://fsck.com/rtfm


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com



More information about the rt-users mailing list