[rt-users] How to RT-admins handle mail loops (bounces)?

2007-02-07 Thread Tomas Olaj


SSIA, ;)

--

Tomas A. P. Olaj, email: [EMAIL PROTECTED], 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 [EMAIL PROTECTED]
Reply-To: Tomas Olaj [EMAIL PROTECTED]
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:
 '[EMAIL PROTECTED]',
 );

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: [EMAIL PROTECTED], web: folk.uio.no/tomaso
 University of Oslo / USIT (Center for Information Technology Services)
   System- and Application Management / Applications Management Group
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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


Re: [rt-users] How to RT-admins handle mail loops (bounces)?

2007-02-07 Thread Mathew
Procmail rules.

Mathew

Tomas Olaj wrote:
 
 SSIA, ;)
 

___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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


Re: [rt-users] How to RT-admins handle mail loops (bounces)?

2007-02-07 Thread Vivek Khera


On Feb 7, 2007, at 8:02 AM, Tomas Olaj wrote:



SSIA, ;)



mail loops or bounces? these are two different things.

mail loops should be handled by RT.  I tried to fake it by making a  
custom scrip condition to throttle replies to the same address over a  
period of time, but there is no place to stash a last sent time and  
number of messages sent in a user record that i could find.  we've  
had our share of autoresponder wars and have to manually intervene by  
disabling the on create scrip.


as for bounces, I posted on the wiki in the contrib section details  
of how I link them back to the originating ticket so you know when a  
customer response failed.




smime.p7s
Description: S/MIME cryptographic signature
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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