osTicket Transport error

I was getting an error in osTicket when using the osTicket transport. The error was:
“API Error (400) Unable to create new ticket: validation errors: user: Incomplete client information”

So I started looking into /opt/librenms/includes/alerts/transport.osticket.php
I added the following lines to see what the variable values were:

/added in the email parsing foreach statement/
file_put_contents(’/tmp/email’, $email);
file_put_contents(’/tmp/fromname’, $from_name);
file_put_contents(’/tmp/from’, $from);

/added after the $protocol variable array creation/
file_put_contents(’/tmp/array’, print_r($protocol,true));

It returned the following values
$from_name was blank
$from = [email protected]
$email = < [email protected] > /NOTE: I had to add spaces to make the <> show up on the forums/

and the array contained this (edited to remove IP and domain for posting):
Array
(
[name] => LibreNMS
[email] => < [email protected] >
[subject] => Test-Rule on localhost
[message] => This is a test alert
[ip] => x.x.x.x
[attachments] => Array
(
)

)

After playing around with the variables for a while, I discovered that if I remove the <> from
the email address, then it would create the ticket properly. I’m not sure if it is a bug or if I
am missing a field in LibreNMS for the $from_name variable. The code looks like it is supposed to
create the $email variable as follows:

[email protected]< [email protected] >

but instead only has:
< [email protected] >

To fix it I commented out the following:
/*$email = $from_name . ‘<’ . $from . ‘>’; */
and replaced with:
$email = $from;

Then the email to osTicket started to work properly.

/****** validate.php output ******/

Component Version
LibreNMS f5931535b4bda751fbd0cfd584b2e98e14d4bc32
DB Schema 195
PHP 7.0.18-0ubuntu0.16.04.1
MySQL 10.0.29-MariaDB-0ubuntu0.16.04.1
RRDTool 1.5.5
SNMP NET-SNMP 5.7.3

==========================================================

[WARN] Your install is out of date, last update: Thu, 15 Jun 2017 07:11:10 +0000
[OK] Database connection successful
[OK] Database schema correct
[FAIL] You have a different system timezone (BST) specified to the php configured timezone (UTC), please correct this.
[WARN] Your local git contains modified files, this could prevent automatic updates.
Modified files:
includes/alerts/transport.osticket.php