Additional Findings After Further Investigation
After additional troubleshooting, I gathered the following information:
1. Email Body Is Not Being Stored in Database
The ticket is created successfully, however the thread body is completely empty:
SELECT *
FROM ost_thread_entry
ORDER BY id DESC
LIMIT 1\G
Result:
source: Email
title: Gmail Test
body:
format: html
The body field is empty.
2. Email Metadata Is Stored Successfully
Records are created in ost_thread_entry_email.
SELECT id,
thread_entry_id,
LENGTH(headers) AS header_size
FROM ost_thread_entry_email
ORDER BY id DESC
LIMIT 5;
Example:
24205 | 35355 | 13179
24204 | 35354 | 14330
24203 | 35353 | 513
24202 | 35352 | 13836
24201 | 35351 | 13833
3. Stored Data Appears To Contain Headers Only
Example query:
SELECT id,
thread_entry_id,
LEFT(headers,1000)
FROM ost_thread_entry_email
WHERE thread_entry_id=35355\G
Output begins with:
MIME-Version: 1.0
Received: ...
ARC-Seal: ...
ARC-Message-Signature: ...
I do not see any visible MIME body section (text/plain or text/html) in the stored data.
This makes me wonder whether only headers are being retrieved or stored.
4. Gmail Test Also Fails
I tested with:
- Microsoft 365 mailbox
- Gmail mailbox
In both cases:
- Ticket created successfully
- Subject populated
- Sender populated
- Body empty
Therefore this does not appear to be related to Outlook Rich Text / winmail.dat.
5. mailparse Extension Is Installed
php8.4 --ri mailparse
Output:
mailparse support => enabled
Extension Version => 3.1.8
6. No Email Parsing Errors In Apache Logs
The Apache logs contain only unrelated LDAP plugin errors.
No errors related to:
- OAuth2
- IMAP
- mailparse
- MIME parsing
- Email fetching
7. OAuth2 Plugin
Using the official osTicket OAuth2 plugin downloaded from osTicket.
Plugin file:
include/plugins/auth-oauth2.phar
OAuth Provider:
Microsoft Graph
Authorization is successful and mailbox access works correctly.
8. Source Code Investigation
I searched the mail fetch implementation and found:
grep -R "new Mail_Parse" include -n
Results:
include/class.mailparse.php:763
include/class.mailparse.php:795
The parser appears to be instantiated as:
$parser = new Mail_Parse($rawemail);
$parser = new Mail_Parse($contents);
I also noticed that:
grep -n "Mail_Parse" include/class.mailfetch.php
returns no results.
This suggests email parsing may be occurring outside the mail fetch class.
9. Additional Ticket Behavior
Tickets created via email are missing a Help Topic and show:
This ticket is missing a Help Topic and cannot be closed
I believe this is likely a separate issue, but mentioning it in case it is relevant.
Has anyone seen this behavior where:
- Email fetching succeeds
- Subject extraction succeeds
- Ticket creation succeeds
- Email body is completely empty
on:
- osTicket v1.17.7
- PHP 8.4.x
- OAuth2 Client Plugin v0.6
- Microsoft Graph OAuth2
===============
One more thing I'd ask on the forum:
Is there any known issue with osTicket 1.17.7 and PHP 8.4 where ost_thread_entry_email is populated but ost_thread_entry.body remains empty when using the official OAuth2 plugin?
Any guidance would be greatly appreciated.