calling "getMessageTextWithUid" at InboundEmail.php with null identifier gor $structure => fatal runtime error at IMAP E-Mail Import #5244

Open
opened 2026-02-20 16:31:54 -05:00 by deekerman · 0 comments
Owner

Originally created by @rsteinig on GitHub (Aug 26, 2024).

Issue InboundEmail.php

if (!empty($contentType) && strtolower($contentType) === 'text/plain') {
                $email->description = $this->getMessageTextWithUid(
                    $uid,
                    $contentType,
                    $structure = null,
                    $fullHeader = null,
                    true
                );
            }

            $email->description_html = $this->getMessageTextWithUid(
                $uid,
                $structure->subtype,
                $structure,
                $fullHeader,
                $clean_email
            );

Possible Fix

if (!empty($contentType) && strtolower($contentType) === 'text/plain') {
                $email->description = $this->getMessageTextWithUid(
                    $uid,
                    $contentType,
                    $structure = null,
                    $fullHeader = null,
                    true
                );
            }

            $email->description_html = $this->getMessageTextWithUid(
                $uid,
                $contentType,
                $structure,
                $fullHeader,
                $clean_email
            );

Steps to Reproduce the Issue

Go to Inbound E-Mails and import to any related record. This will lead into a runtime error, because the given content is null. I used IMAP import and OFFICE365

Context

No response

Version

7.14.5

What browser are you currently using?

Chrome

Browser Version

No response

Environment Information

PHP 7.4

Operating System and Version

Ubuntu 22.04

Originally created by @rsteinig on GitHub (Aug 26, 2024). ### Issue InboundEmail.php ``` if (!empty($contentType) && strtolower($contentType) === 'text/plain') { $email->description = $this->getMessageTextWithUid( $uid, $contentType, $structure = null, $fullHeader = null, true ); } $email->description_html = $this->getMessageTextWithUid( $uid, $structure->subtype, $structure, $fullHeader, $clean_email ); ``` ### Possible Fix ``` if (!empty($contentType) && strtolower($contentType) === 'text/plain') { $email->description = $this->getMessageTextWithUid( $uid, $contentType, $structure = null, $fullHeader = null, true ); } $email->description_html = $this->getMessageTextWithUid( $uid, $contentType, $structure, $fullHeader, $clean_email ); ``` ### Steps to Reproduce the Issue ```bash Go to Inbound E-Mails and import to any related record. This will lead into a runtime error, because the given content is null. I used IMAP import and OFFICE365 ``` ### Context _No response_ ### Version 7.14.5 ### What browser are you currently using? Chrome ### Browser Version _No response_ ### Environment Information PHP 7.4 ### Operating System and Version Ubuntu 22.04
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/SuiteCRM-SuiteCRM#5244
No description provided.