Hi,
I have recently upgrade to SuiteCRM version 8.2.4 installed on Ubuntu (18.04) with MYSQL 5.7 and php 8.0.
I have managed to create case from emails but the email subject line always remains empty , it appears as ‘no subject)’ .
I would really appreciate it if someone can help me understand why this could be happening and a fix for the issue?
afatac
10 September 2025 09:48
2
Hi, do you still remember how you fixed it?
I think this is a bug with the latest version. It just started happening to me as well.
rsp
10 September 2025 15:00
4
Did it happen in v8.8.1? Do you guys did any custom changes in the Cases module?
The issue I don’t think is in the cases module it’s in the inbound email module. There was some work done to purify the html of the subject line and basically if it doesn’t like it, it returns (no subject). I’m troublehsooting it now.
1 Like
In inboundemail.php I can see the subject in many places was changed from:
$email->name = $this->handleMimeHeaderDecode($parsedFullHeader->subject);
TO:
$email->name = purify_html($this->handleMimeHeaderDecode($parsedFullHeader->subject)); $email->name = purify_html($this->handleMimeHeaderDecode($parsedFullHeader->subject));
Still havn’t figure out what specifically is the problem, but reverting the file back to 7.14.5 version of inboundemail.php totally fixes the problem.
rsp
10 September 2025 18:23
7
Is this a workaround for your issue?
The solution modifying line 116 of public/legacy/include/HtmlSanitizer.php removes the error, but affected emails still don’t display their body content.
After investigating one level up in the function call stack, I identified that the issue occurs with multipart/mixed emails containing a text/plain part. While I haven’t fully traced the root cause in the SuiteCRM codebase (my knowledge in PHP and suiteCRM code is limited), I’ve developed a temporary workaround.
Temporary Solution
I implement…
No here is the problem:
opened 06:23PM - 10 Sep 25 UTC
Type: Bug
### Issue
After upgrading from 7.14.5, inbound mail often creates Emails/Cases … with empty subjects (displayed as “(no subject)”). The change that wraps subject assignment with purify_html() and reads from parsedFullHeader->subject can result in an empty string on some IMAP servers/paths. This also breaks case notifications that include the subject.
Environment:
SuiteCRM 7.14.7 (previously 7.14.5 OK)
IMAP server: (centos 7 WHM/Cpanel)
PHP version: (8.1)
### Possible Fix
Root Cause :
rfc822ParseHeaders($fullHeader) returns subject = null in some environments.
purify_html() can also return an empty string for certain header encodings.
Current code overwrites $email->name with that empty string.
Proposed Fix (minimal):
Prefer parsed header subject when present, fallback to IMAP header subject, decode, then purify with a non-empty fallback:
```
$__rawSubject = '';
if (!empty($parsedFullHeader->subject)) {
$__rawSubject = (string)$parsedFullHeader->subject;
} elseif (!empty($header->subject)) {
$__rawSubject = (string)$header->subject;
}
$__decoded = (string)$this->handleMimeHeaderDecode($__rawSubject);
$__purified = purify_html($__decoded);
$email->name = ($__purified !== '') ? $__purified : $__decoded;
```
### Steps to Reproduce the Issue
```bash
1. Configure Inbound Email → Create Case.
2. Receive an email with a normal Subject.
3 Resulting Email/Case shows “(no subject)”; DB emails.name contains "[CASE:####] (no subject)".
```
### Context
Basically, it breaks the whole AOP Cases because client emails are imported without subject, and replies without a subject are not attached as updates.
### Version
7.14.7
### What browser are you currently using?
Chrome
### Browser Version
_No response_
### Environment Information
PHP 8.2
### Operating System and Version
Centos 7, WHM/Cpanel
I just created the bug and the fix.
The fix is tto replace line 5494 in InboundEmail.php:
$email->name = purify_html($this->handleMimeHeaderDecode($parsedFullHeader->subject));
With:
$__rawSubject = '';
if (isset($parsedFullHeader->subject) && (string)$parsedFullHeader->subject !== '') {
$__rawSubject = (string)$parsedFullHeader->subject;
} elseif (isset($header->subject) && (string)$header->subject !== '') {
$__rawSubject = (string)$header->subject;
}
$__decoded = (string) $this->handleMimeHeaderDecode($__rawSubject);
$__purified = purify_html($__decoded);
// If purify_html() strips everything, fall back to the decoded text
$email->name = ($__purified !== '') ? $__purified : $__decoded;
Basically if the purifier returns null, then fall back to the un purified raw subject line. Otherwise, use the purified one.
1 Like
afatac
11 September 2025 00:49
9
@pstevens Thank you!
The fix works for my SuiteCRM 8.8.1 too. The line replaced is at 5498
I notice that there is another similar line at 5727. I assume that we do not need to replace it.
Great, glad it works for you. I haven’t tested changing up the other line thats like this one. Likely it should be changed too, but I haven’t seen any other blank subject issues but if they arise the second occurrence is likely something to consider as well.