EmailUnsubscribe: Invalid header value detected

Nirjonadda

Well-Known Member
May 8, 2013
724
27
78
cPanel Access Level
Root Administrator
Please can you let me know that how can fixing this Server error log?

Code:
Zend\Mail\Header\Exception\InvalidArgumentException: Job XF:EmailUnsubscribe: Invalid header value detected src/vendor/zendframework/zend-mail/src/Header/GenericHeader.php:63

Generated by: Unknown account Mar 10, 2020 at 10:13 PM

Stack trace

#0 src/vendor-patch/Zend/Mail/Headers.php(481): Zend\Mail\Header\GenericHeader::splitHeaderLine('X-Ham-Report: S...')
#1 src/vendor-patch/Zend/Mail/Headers.php(232): Zend\Mail\Headers->loadHeader('X-Ham-Report: S...')
#2 src/vendor-patch/Zend/Mail/Headers.php(96): Zend\Mail\Headers->addHeaderLine('X-Ham-Report: S...')
#3 src/vendor/zendframework/zend-mime/src/Decode.php(149): Zend\Mail\Headers::fromString('Return-Path: <t...', '
')
#4 src/vendor/zendframework/zend-mail/src/Storage/Part.php(110): Zend\Mime\Decode::splitMessage('Return-Path: <t...', 'Return-Path: <t...', '')
#5 src/vendor/zendframework/zend-mail/src/Storage/Message.php(52): Zend\Mail\Storage\Part->__construct(Array)
#6 src/vendor/zendframework/zend-mail/src/Storage/Imap.php(126): Zend\Mail\Storage\Message->__construct(Array)
#7 src/XF/EmailUnsubscribe/Processor.php(38): Zend\Mail\Storage\Imap->getMessage(1)
#8 src/XF/Job/EmailUnsubscribe.php(27): XF\EmailUnsubscribe\Processor->processFromStorage(Object(Zend\Mail\Storage\Imap), G)
#9 src/XF/Job/Manager.php(253): XF\Job\EmailUnsubscribe->run(G)
#10 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#11 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#12 job.php(42): XF\Job\Manager->runQueue(false, 8)
#13 {main}

Request state

array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(45) "/threads/68839/page-860"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
I thought that looked familiar. The forums here use the same platform (xenforo2). Really I wouldn't disable the X-Ham-Report which is used by SpamAssassin but identify the invalid character. The header is being added by the server though, when the message is scanned through SpamAssassin.
 

Nirjonadda

Well-Known Member
May 8, 2013
724
27
78
cPanel Access Level
Root Administrator
I thought that looked familiar. The forums here use the same platform (xenforo2). Really I wouldn't disable the X-Ham-Report which is used by SpamAssassin but identify the invalid character. The header is being added by the server though, when the message is scanned through SpamAssassin.
Do you enabled Automated unsubscribe email handler in Xenforo Admin CP?
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
No, this is not enabled. But The information on this would be useful I think:

This option will read and remove emails from the specified account when processing. It MUST be directed to an account whose sole purpose is collecting unsubscribe request emails from this XenForo installation. A value must be entered for the "Unsubscribe email address" option.
This might be something best suited for the xenforo forums here: Welcome to XenForo 2 (if you're running XenForo2

I see some threads on the issue (including yours it looks like) but there is an older one her:


Seems to potentially be an issue with zend mail working with SpamAssassin. I absolutely wouldn't remove SpamAssassin the thread notes that they're aware it's a bug.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
So, like I said previously this is a bug in xenforo with Zend and it really makes no sense to disable spam scanning to prevent the error.

But, If you're not running SpamAssassin you shouldn't be getting that flag added, it could be also added by the user if their using outbound SpamAssassin scanning. the X-HAM and X-SPAM headers are added by SpamAssassin specifically. What's noted in the exim transaction for the email you're seeing get the error in XenForo?