osticket 1.11
php 7.2
centos 7.x

how to reproduce:
1. create ticket via email, sending from email client Android gmail
2. check in the Admin Panel, Dashboard, System Logs
show 2 entry API Unexpected Data
thread_entry_recipients: Unexpected data received in API request
system_emails: Unexpected data received in API request
checking forum, reported ref: https://forum.osticket.com/d/93197-api-unexpected-data

IP Address show empty, but ticket created without no error

CentOS... are you running SELinux?
How do you have email configured?

  • lewi replied to this.

    ntozier running with audit2allow and checking which one that need to allow

               cat /var/log/audit/audit.log | audit2allow -m vpssselinuxtargeted1 > /root/selinux/vpssselinuxtargeted1.te

    did this one of selinux rule may cause? in the 1.10.4 no error
    also need to mention that mimeDecode.php line 648 changed to, for message show (empty) from
    https://forum.osticket.com/d/92369-message-body-is-empty-for-some-tickets/18
    https://github.com/osTicket/osTicket/issues/3278

               #$input = preg_replace('/=([a-f0-9]{2})/ie', "chr(hexdec('\\1'))", $input);
               $input = preg_replace_callback('/=([a-f0-9]{2})/i', function($m) { return chr(hexdec($m[0])); }, $input);

    also applied class.search.php from
    https://forum.osticket.com/d/93517-ticket-details-display-empty-when-email-coming-from-outlook-in-pipe/4

               if (PHP_SAPI !== 'cli' && function_exists('apcu_store')) {
    • lewi replied to this.

      lewi after revert back

             $input = preg_replace('/=([a-f0-9]{2})/ie', "chr(hexdec('\\1'))", $input);

      system logs also still shown error, just to let you know

      Asking a dev to take a look at this stuff.

      KevinTheJedi Hi KevinTheJedi download zip from github branch 1.11.x and develop-next also the same shown 2 entry in system log

      Server Information
      osTicket Version 1.8-git (?) — 9ae093d is available
      Web Server Software Apache
      MySQL Version 5.5.60
      PHP Version 7.2.17

      maillog:
      Apr 18 22:52:02 server postfix/local[27185]: DAC1380ADE: to=<testing1@supportcompanydomain.com>, relay=local, delay=27, delays=0.77/0.04/0/26, dsn=2.0.0, status=sent (delivered to command: sudo -u vpss -n /var/www/support/api/pipe.php)

      email format:
      MIME-Version: 1.0
      Date: Thu, 18 Apr 2019 21:04:04 +0700
      Message-ID: <CA+K8-P+ej4Og4g9F1uzGF=GjoNhGRHGj2m8En1MQUHny=eYBdw@mail.gmail.com>
      Subject: testing api unexpected 2
      From: "Lewi S. Kristianto" <lewi@personalemail.com>
      To: testing1@supportcompanydomain.com
      Content-Type: multipart/alternative; boundary="000000000000a4a2160586ce79d2"

      --000000000000a4a2160586ce79d2
      Content-Type: text/plain; charset="UTF-8"

      testing 2

      --000000000000a4a2160586ce79d2
      Content-Type: text/html; charset="UTF-8"

      <div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">testing 2</div></div>

      --000000000000a4a2160586ce79d2--

      @lewi

      I just tested this using the latest pull from develop-next with your example email and it works just fine for me. (see images below)

      File "email.txt"

      Pipe Command

      Ticket Created Successfully

      Cheers.

      • lewi replied to this.

        lewi checking with develop-next, and using shell show error, with disabled selinux

        php api/pipe.php < api/emailtest.txt 
        (416) Request failed - retry again!
        8 days later

        I'm observing this ("API Unexpected Data") on v1.12 too.

        The fields being reported are "thread_entry_recipients" and "system_emails".

        On further investigation, these errors are being raised by ApiController::validateRequestStructure because both of those fields are being parsed as arrays, but TicketApiController::getRequestStructure provides no array structure for them.

        Good news: this is just a non-strict validation failure. Everything works regardless (as best I can tell, anyway).

        To fix it, TicketApiController::getRequestStructure will need to be patched with the structures that were adopted in https://github.com/osTicket/osTicket/commit/731c9fe9 and https://github.com/osTicket/osTicket/commit/b7fee361

        I'll add this information to https://github.com/osTicket/osTicket/issues/4852 as well.

        Thanks it doesn't show any error now

        • lewi replied to this.

          lewi checking today, it show another error
          thread_entry_recipients/cc/2: Unexpected data received in API request
          thread_entry_recipients/cc/1: Unexpected data received in API request

          but ticket is created

          a month later

          I confirm same with 1.12.
          Every email pipe generates 2 warnings:

          thread_entry_recipients: Unexpected data received in API request
          and
          system_emails: Unexpected data received in API request

          Write a Reply...