[rt-users] Recognize tickets created via email or via web

Christian Loos cloos at netcologne.de
Fri Mar 22 10:15:42 EDT 2013

Am 21.03.2013 12:38, schrieb Michele Bergonzoni:
> I have a custom scrip where I want to distinguish whether the ticket was
> created via email or via web.
> Now I am looking at ther "Received:" header of the first attachment of
> the first transaction of the ticket:
>  my $web;
>  my $transactions=$self->TicketObj->Transactions;
>  my $tr = $transactions->Next;
>  my $attachments = $tr->Attachments;
>  my $a = $attachments->Next;
>  if ($a->GetHeader("Received")){
>    $web=0;
>  } else {
>    $web=1;
>  }
> This apparently works and has insofar not misclassified, but seems quite
> ugly to me. For example, future versions of RT could add a "Received:"
> with the IP address where the web connection came from (many webmails do
> that). I didn't even try with a ticket created via CLI.
> Can anyone suggest a better and future-proof approach?
> Regards,
>                 Bergonz

You have to look for the X-RT-Interface header (REST, API, Email, Web)
which was introduced with RT 4.0.9

More information about the rt-users mailing list