Duplicate Bounce message processing failed: Malformed header detected

Affected version


Active member
I've been getting quite a few of these lately from various email providers, the one thing they have in common is that they are all automated replies. They are not bounces but are handled by the automated bounce handler as being auto replies they end up in the bounce mailbox.

I'm not sure whether this qualifies as an actual bug but I can supply the email headers if this is something you want to look into further, when examining the bounce log the recipient is blank and the type is unknown.

The error:

Zend\Mail\Exception\RuntimeException: Bounce message processing failed: Malformed header detected src/vendor/zendframework/zend-mail/src/Headers.php:88
Generated by: Unknown account Mar 5, 2018 at 4:20 AM

Stack trace
#0 src/vendor/zendframework/zend-mime/src/Decode.php(141): Zend\Mail\Headers::fromString('Return-Path: <>...', '\n')
#1 src/vendor/zendframework/zend-mail/src/Storage/Part.php(99): Zend\Mime\Decode::splitMessage('Return-Path: <>...', 'Return-Path: <>...', 'I am not curren...', '\n', false)
#2 src/vendor/zendframework/zend-mail/src/Storage/Message.php(54): Zend\Mail\Storage\Part->__construct(Array)
#3 src/XF/EmailBounce/Parser.php(169): Zend\Mail\Storage\Message->__construct(Array)
#4 src/XF/EmailBounce/Processor.php(69): XF\EmailBounce\Parser->parseMessage('Return-Path: <>...')
#5 src/XF/EmailBounce/Processor.php(53): XF\EmailBounce\Processor->processMessage('Return-Path: <>...')
#6 src/XF/Job/EmailBounce.php(27): XF\EmailBounce\Processor->processFromStorage(Object(Zend\Mail\Storage\Imap), 7.9999990463257)
#7 src/XF/Job/Manager.php(241): XF\Job\EmailBounce->run(7.9999990463257)
#8 src/XF/Job/Manager.php(187): XF\Job\Manager->runJobInternal(Array, 7.9999990463257)
#9 src/XF/Job/Manager.php(76): XF\Job\Manager->runJobEntry(Array, 7.9999990463257)
#10 job.php(15): XF\Job\Manager->runQueue(false, 8)
#11 {main}

Request state
array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(57) "https://www.***.com/admin.php?cron/emailBounce/run"
  ["_GET"] => array(0) {
  ["_POST"] => array(0) {