--- /home/stewart/rt3/rt-3-0-0rc3/lib/RT/Interface/Email.pm	2003-03-19 17:01:32.000000000 +1100
+++ Interface/Email.pm	2003-03-20 13:41:31.000000000 +1100
@@ -424,6 +424,17 @@
     my $SystemQueueObj = RT::Queue->new($RT::SystemUser);
     $SystemQueueObj->Load( $args{'queue'} );
 
+#SJ HACK ON BOUNCING
+    my $IsABounce;
+    my @BounceTo = ParseCcAddressesFromHead(Head => $head,
+                                               CurrentUser => $RT::SystemUser,
+                                               QueueObj =>$SystemQueueObj );
+if ($BounceTo[0] =~/bounce\+/) {
+     my  $SJTicketId = $BounceTo[0];
+       $SJTicketId =~ s/bounce\+ticket-(\d+)@.*/$1/ ;
+       $args{'ticket'} = $SJTicketId;
+       $IsABounce = 1;
+       }
 
     # We can safely have no queue of we have a known-good ticket
     unless ( $args{'ticket'} || $SystemQueueObj->id ) {
@@ -441,6 +452,15 @@
     # 1 - Normal user
     # 2 - User is allowed to specify status updates etc. a la enhanced-mailgate
 
+#SJ HACK
+ if ($IsABounce) {
+     $RT::Logger->crit("LOADING BOUNCE USER");
+       $CurrentUser = RT::CurrentUser->new();
+     $CurrentUser->LoadByName('bounce');
+       $AuthStat=1;
+} else {
+
+
     push @RT::MailPlugins, "Auth::MailFrom"   unless @RT::MailPlugins;
     # Since this needs loading, no matter what
 
@@ -475,7 +495,7 @@
         last if $AuthStat == -1;
         $AuthStat = $NewAuthStat if $NewAuthStat > $AuthStat;
     }
-
+}
     # {{{ If authentication fails and no new user was created, get out.
     if ( !$CurrentUser or !$CurrentUser->Id or $AuthStat == -1 ) {
 
