SSIA,
Tomas A. P. Olaj, email: tomas.olaj@usit.uio.no, web: folk.uio.no/tomaso
University of Oslo / USIT (Center for Information Technology Services)
System- and Application Management / Applications Management Group---------- Forwarded message ----------
Date: Wed, 7 Feb 2007 11:38:33 +0100 (CET)
From: Tomas Olaj tomaso@ulrik.uio.no
Reply-To: Tomas Olaj tomas.olaj@usit.uio.no
To: rt-users@lists.bestpractical.com
Subject: mail loop problems: was: Re: [rt-users] RT/Apache suddenly hangs
Hi,
We have checked the problem more closesly, and the reason why our RT/Apache
server stops is due to different variants of mail loops.
We still have problems with other loop variants consuming all resources.
Extended mailgate errors leading to loops, spam going into loop. How can we
make mailgate a bit more smarter?
Does anyone have a mail loop detector in front of their RT installations.
We have a high severity now with our RT in production. The load is increasing
all the time.
Our commonly used cron-script removing some mail loops:
#!/site/perl-5.8.7/bin/perl
Author: Petter Reinholdtsen
Date: 2006-01-13
License: GNU Public License v2 or later
Look at all tickets, and remove all queue addresses from requestor,
cc and admincc. This reduces the amount of bounce emails sent to
the RT admins.
use warnings;
use strict;
use Getopt::Std;
Location of RTâs libs and scripts
Remember to change to correct path on current RT instance
use lib (â/site/rt3/local/libâ, â/site/rt3/libâ);
package RT;
use RT::Interface::CLI qw(CleanEnv);
use RT::Queue;
use RT::Queues;
use RT::Tickets;
my %opts;
Getopt::Std::getopts(âdnâ, %opts);
my $debug = $opts{âdâ} || 0;
my $dryrun = $opts{ânâ} || 0;
$| = 1;
Find all queue addresses of enabled queues
my @queueaddrs =
(
# Aliases for e-mail lists are listed here:
âe-mail-list@domain.comâ,
);
my $ticketcount = 0;
my $starttime = time();
CleanEnv(); # Clean our the environment
RT::LoadConfig(); # Load the RT configuration
RT::Init(); # Initialise RT
my $user = RT::User->new( $RT::SystemUser );
Merge static list with dynamic list
@queueaddrs = (load_queue_addresses(), @queueaddrs);
Loop over all addresses, remove them from the tickets were they are
registered as watchers
for my $address( sort @queueaddrs ) {
print âRemoving address â$addressâ from all tickets\nâ if $debug;
my $tickets = new RT::Tickets($RT::SystemUser);
$tickets->FromSQL( âWatcher.EmailAddress = â$addressââ );
while( my $ticket = $tickets->Next ) {
$ticketcount++;
my $id = $ticket->Id;
if ($dryrun) {
print âWant to remove $address as watcher from ticket #$id\nâ;
} else {
$RT::Logger->info("Removed queue address $address as watcher ".
âfrom ticket #$idâ);
$ticket->DeleteWatcher(Email => $address, Type => $_ )
for( qw(Cc AdminCc Requestor) );
}
}
}
my $duration = time() - $starttime;
$RT::Logger->info(âProcessing of $ticketcount tickets took $duration secondsâ);
sub load_queue_addresses {
my $queues = new RT::Queues($RT::SystemUser);
$queues->LimitToEnabled();
my @queueaddrs;
foreach my $queue (@{$queues->ItemsArrayRef()}) {
for my $address ($queue->CorrespondAddress, $queue->CommentAddress) {
next unless $user->LoadByEmail( $address );
push @queueaddrs, $address;
print âFound queue address â$addressâ\nâ if $debug;
}
}
return @queueaddrs;
}
Tomas A. P. Olaj, email: tomas.olaj@usit.uio.no, web: folk.uio.no/tomaso
University of Oslo / USIT (Center for Information Technology Services)
System- and Application Management / Applications Management Group