[rt-users] Bounce Handler

Teo de Hesselle teo.dehesselle at uts.edu.au
Wed Nov 14 18:27:51 EST 2001


Any of you with queues that service the general public will probably have
experienced mail bouncing from your RT system, probably back to the httpd
user. This wastes your staff's valuable time as they have carefully
crafted a response which was doomed to bounce.

My solution is a bounce handler (below), which is called from your aliases
file. Effectively, any bounce messages that come back from RT will be
attached as a comment to the ticket they came from.

Let's say we have a queue with: 

OnCreate AutoreplyToRequestors with template Autoreply 

This means you will be aware of any users/clients/people with broken email
accounts, and you will be able to make a decision as to whether to
'Resolve' the ticket immediately or whether you want to send them email,
contact them another way, etc etc. Even if you don't have an
autoresponder, at least you'll be aware of any bounces.

We are finding this helpful - you might as well.

(And Yes, I do a lot of non-RT RT hacks. I'm working on an independent
user management interface at the moment).


RT ACLS:

user 'nobody' must have permissions to comment on the tickets involved. My
'nobody' user has waay too many permissions - someone else should probably
outline the required permissions.

ALIASES FILE:

nobody:         "|/export/home/me/bin/bounceproc.pl"

PERL SCRIPT: (replace BLAHBLAH and paths as appropriate)

#!/usr/local/bin/perl

use strict;

my $ticket = 0;
$ENV{'EDITOR'} = "echo";
chdir("/tmp");

open (BOUNCEMSG, ">/tmp/bounceproc$$.msg");

while (<STDIN>)
{
        my $input = $_;

        if ($input =~ /^RT-Ticket:\ BLAHBLAH\ \#(\d+)/ )
        {
                $ticket = $1;
        }

        print BOUNCEMSG $input;

}
close BOUNCEMSG;
if ($ticket)
{
        system("/usr/local/rt2/bin/rt --id $ticket --comment --no-edit
--source /tmp/bounceproc$$.msg");
}

unlink("/tmp/bounceproc$$.msg");

-- 
Téo de Hesselle,               \  One possible reason that things
Unix Systems Administrator      \  aren't going according to plan
                                 \  is that there never was a plan
University of Technology, Sydney  \  in the first place.




More information about the rt-users mailing list