Details
Description
I'm using 2.1.4, however, with the CiviMailProcessor code... When running the script to process emails via the CiviCRM Mail Processor some emails fail with a fatal error and prevent the script from completing:
Fatal error: Uncaught exception 'ezcBasePropertyNotFoundException' with message 'No such property name 'subType'.' in /var/www/x.org/sites/all/modules/civicrm/packages/ezc/Mail/src/interfaces/part.php:118 Stack trace: #0 /var/www/x.org/sites/all/modules/civicrm/packages/ezc/Mail/src/parts/delivery_status.php(101): ezcMailPart->_get('subType') #1 /var/www/x.org/sites/all/modules/civicrm/bin/CiviMailProcessor.php(77): ezcMailDeliveryStatus->_get('subType') #2 /var/www/x.org/sites/all/modules/civicrm/bin/CiviMailProcessor.php(141): CiviMailProcessor->process() #3
{main}thrown in /var/www/x.org/sites/all/modules/civicrm/packages/ezc/Mail/src/interfaces/part.php on line 118
I contacted ez Components and they said that only the ezcMailText property has SubParts. Thus, inserting the check: if ( $part instanceof ezcMailText ) {... fixes this issue as far as I am concerned. Here is the chunk of code below from CiviMailProcessor.php (sorry, I don't have a good patch utility on this machine):
// for bounces and replies get the plaintext and HTML parts of the message
// FIXME: this assumes only one plain and one html part per message (and discards the rest)
if (in_array($action, array('b', 'bounce', 'r', 'reply'))) {
$text = $html = null;
if ($mail->body instanceof ezcMailText)
elseif ($mail->body instanceof ezcMailMultipart) {
foreach ($mail->body->getParts() as $part) {
if ( $part instanceof ezcMailText ) {
switch ($part->subType)
}
}
}
}