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

Michele Bergonzoni bergonz at labs.it
Thu Mar 21 07:38:24 EDT 2013


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

-- 
Ing. Michele Bergonzoni - Laboratori Guglielmo Marconi S.p.a.
Phone:+39-051-6781926 e-mail: bergonz at labs.it
alt.advanced.networks.design.configure.operate



More information about the rt-users mailing list