[rt-users] RT sending mail to itself?

Phil Homewood pdh at moreton.com.au
Thu Sep 20 07:19:08 EDT 2001


Martin Schapendonk wrote:
> Then I tried to find in which cases RT adds such a header, but I
> couldn't find it:
> 
> root at kubstu:/opt/rt2# grep X-RT-Loop-Prevention `find . -type f`
> ./lib/RT/Interface/Email.pm:    my $RTLoop = $head->get("X-RT-Loop-Prevention") || "";
> root at kubstu:/opt/rt2#
> 
> Only the check in Email.pm is found, but nowhere does RT add that
> header. I think this is a serious bug.

Try the attached (unofficial, barely-tested) patch.

An alternate patch would be to look for the RT-Ticket header, but
that's not set on errors.

-------------- next part --------------
--- lib/RT/Action/SendEmail.pm-	Mon Jul 30 17:48:04 2001
+++ lib/RT/Action/SendEmail.pm	Thu Sep 20 20:54:31 2001
@@ -190,6 +190,7 @@
       ('Managed-by',"Request Tracker $RT::VERSION (http://www.fsck.com/projects/rt/)");
     
     $self->SetHeader('RT-Originator', $self->TransactionObj->CreatorObj->EmailAddress);
+    $self->SetHeader('X-RT-Loop-Prevention', $RT::rtname);
     return();
     
 }
--- lib/RT/Interface/Email.pm-	Fri Aug 24 14:08:30 2001
+++ lib/RT/Interface/Email.pm	Thu Sep 20 21:08:30 2001
@@ -289,6 +289,7 @@
 				      To => $args{'To'},
 				      Subject => $args{'Subject'},
 				    );
+    $entity->SetHeader('X-RT-Loop-Prevention', $RT::rtname);
     $entity->attach(  Data => $args{'Explanation'}."\n");
     
     my $mimeobj = $args{'MIMEObj'};


More information about the rt-users mailing list