# MASON COMPILER ID: 2097!28163
package HTML::Mason::Commands;
use strict;
use vars qw($m $r %session);
HTML::Mason::Component::FileBased->new(
'code' => sub {
HTML::Mason::Exception::Params->throw
    ( error =>
      "Odd number of parameters passed to component expecting name/value pairs"
    ) if @_ % 2;
my %ARGS = @_;
my ( $message, $queue, $action, $ticket );
{
    my %pos;
    for ( my $x = 0; $x < @_; $x += 2 )
    {
        $pos{ $_[$x] } = $x + 1;
    }

    foreach my $arg ( qw( message ) )
    {
        HTML::Mason::Exception::Params->throw
            ( error => "no value sent for required parameter '$arg'" )
                unless exists $pos{$arg};
    }
#line 25 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
    $message = $_[ $pos{'message'} ];
#line 26 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
     $queue = exists $pos{'queue'} ? $_[ $pos{'queue'} ] :  1;
#line 27 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
     $action = exists $pos{'action'} ? $_[ $pos{'action'} ] :  "correspond";
#line 28 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
     $ticket = exists $pos{'ticket'} ? $_[ $pos{'ticket'} ] :  undef;
}
$m->debug_hook( $m->current_comp->path ) if ( %DB:: );

#line 29 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway

use RT::Interface::Email; 
my ( $status, $error, $Ticket ) = RT::Interface::Email::Gateway(\%ARGS);
#line 1 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
# BEGIN LICENSE BLOCK
# 
# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
# 
# (Except where explictly superceded by other copyright notices)
# 
# This work is made available to you under the terms of Version 2 of
# the GNU General Public License. A copy of that license should have
# been provided with this software, but in any event can be snarfed
# from www.gnu.org.
# 
# This work is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
# 
# Unless otherwise specified, all modifications, corrections or
# extensions to this work which alter its source code become the
# property of Best Practical Solutions, LLC when submitted for
# inclusion in the work.
# 
# 
# END LICENSE BLOCK
 if ($status == -75 ) {
$m->print( 'temporary failure
' );
#line 37 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
 }
    elsif ($status == 1) {
$m->print( 'ok
' );
#line 40 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
        if ( $Ticket->Id ) {
$m->print( 'Ticket: ' );
#line 41 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( $m->interp->apply_escapes( (join '', ( $Ticket->Id )), 'h' ) );
#line 41 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( '
Queue: ' );
#line 42 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( $m->interp->apply_escapes( (join '', ( $Ticket->QueueObj->Name )), 'h' ) );
#line 42 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( '
Owner: ' );
#line 43 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( $m->interp->apply_escapes( (join '', ( $Ticket->OwnerObj->Name )), 'h' ) );
#line 43 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( '
Status: ' );
#line 44 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( $m->interp->apply_escapes( (join '', ( $Ticket->Status )), 'h' ) );
#line 44 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( '
Subject: ' );
#line 45 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( $m->interp->apply_escapes( (join '', ( $Ticket->Subject )), 'h' ) );
#line 45 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( '
Requestor: ' );
#line 46 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( $m->interp->apply_escapes( (join '', ( $Ticket->Requestors->MemberEmailAddressesAsString )), 'h' ) );
#line 46 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( '
' );
#line 47 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
        }
 }   else { 
$m->print( 'not ok - ' );
#line 49 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( $m->interp->apply_escapes( (join '', ($error)), 'h' ) );
#line 49 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
$m->print( ' 
' );
#line 50 /opt/rt3/share/html/REST/1.0/NoAuth/mail-gateway
 }
return undef;
},
'compiler_id' => '2097!28163',
'declared_args' => {
  '$action' => { default => ' "correspond"' },
  '$message' => { default => undef },
  '$queue' => { default => ' 1' },
  '$ticket' => { default => ' undef' }
},
'flags' => {
inherit => undef # inhibit UTF8 conversion done in /autohandler
},
'load_time' => 1093015834,
'object_size' => 4565,

)
;
