lib/ImapHelper.php
private function getPlainTextOfPart(Part $part)
    {
        try {
            if ($part->getHeaderField('Content-Disposition') == 'attachment') {
                return null;
            }
        } catch (\Exception $e) {
            // Zend throws an Exception, if headerField does not exist
        }

        try {
            // If content-type is text/plain, return its content
            if ($part->getHeaderField('Content-Type') == 'text/plain') {
                return $this->getStringFromPart($part);
            }
        } catch (\Exception $e) {
            // If content-type is not available (exception thrown), return its content
            return $this->getStringFromPart($part);
        }

        return null;
    }
private function getPlainTextOfPart(Part $part)
    {
        try {
            if ($part->getHeaderField('Content-Disposition') == 'attachment') {
                return null;
            }
        } catch (\Exception $e) {
            // Zend throws an Exception, if headerField does not exist
        }

        try {
            // If content-type is text/plain, return its content
            if ($part->getHeaderField('Content-Type') == 'text/plain') {
                return $this->getStringFromPart($part);
            }
        } catch (\Exception $e) {
            // If content-type is not available (exception thrown), return its content
            return $this->getStringFromPart($part);
        }

        return null;
    }
@param Part $part

@return null|string