--- /home/stewart/rt-mailgate	Thu Mar 13 12:02:16 2003
+++ rt-mailgate	Thu Mar 13 12:03:42 2003
@@ -106,6 +106,27 @@
 #Get us a current user object.
 my $CurrentUser = GetCurrentUser($head, $entity, $ErrorsTo);
 
+#SJ HACK To put a bounce into the nounce queue 
+#SJ HACK Sucky bit would be that this reall has no loop detection
+#SJ HACK So a stuffed address that gets comments might cause a good size loop
+#SJ HACK Bounce messages to be in the form of bounce+ticket-#@domain.com
+#SJ HACK For future perhaps adding an extra field in the user databse
+#SJ HACK send one email per recipient and setting envelope to
+#SJ HACK bounce+#-user=domain.com@localhost and extending RT to update a
+#SJ HACK bounce field in the user database the simple if x bounces do not
+#SJ HACK send to that user until admin clears or legit message comes through
+#SJ HACK Also need to HACK Action/Sendmail.pm and Interface/Email.pm
+my $QueueObj = RT::Queue->new($CurrentUser);
+my @BounceTo = ParseCcAddressesFromHead(Head => $head, 
+					CurrentUser => $CurrentUser,
+					QueueObj => $QueueObj );
+if ($BounceTo[0] =~/bounce\+/) {
+	$TicketId = $BounceTo[0];
+	$TicketId =~ s/bounce\+ticket-(\d+)@.*/$1/ ;
+	print "JJJ";
+	}
+
+
 # We've already performed a warning and sent the mail off to somewhere safe ($RTOwner).
 #  this is _exceedingly_ unlikely but we don't want to keep going if we don't have a current user
 
