Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid argument supplied for foreach() in Parameters.php line 52 #317

Closed
JosefRypacek opened this issue Mar 13, 2018 · 5 comments
Closed
Labels

Comments

@JosefRypacek
Copy link

JosefRypacek commented Mar 13, 2018

Hi, I have another error - warning. Background is similar like in #310.

Function imap_mime_header_decode returns for one of my messages FALSE, so foreach will fail.

I've temporarily fixed this by modifiing MessageIterator.php

try {
set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) {
		if (0 === error_reporting()) {
			return false;
		}
		throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
	});
	$ret = new Message($this->resource, $current);
	restore_error_handler();
} catch (\Exception $e) {
	dump($e);
	\Tracy\Debugger::log($e->getMessage(), \Tracy\Debugger::ERROR);
	parent::next();
	return $this->current();
}
return $ret;
@Slamdunk
Copy link
Collaborator

Rather than you solution, we need your problem: can you post the original raw email that raised your error please?

@JosefRypacek
Copy link
Author

JosefRypacek commented Mar 14, 2018

I've modifed PII, removed 2 PDF attachments and replaced one included image. Hope it's ok.

@Slamdunk
Copy link
Collaborator

Hi, I can't reproduce the error: may you post the full error message including the stack trace?

@JosefRypacek
Copy link
Author

JosefRypacek commented Mar 17, 2018

Hi,
yes, you are right. Problem seems to be in attachment. I have been able to run the test and try it.
Please see updated raw message.

msg_fail.txt

@Slamdunk
Copy link
Collaborator

Slamdunk commented Mar 19, 2018

Released in 1.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants