-
-
Notifications
You must be signed in to change notification settings - Fork 252
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
Fails to load Message Headers #358
Comments
Looks like the call to imap_headerinfo fails because it was trying to fetch the header-info's for a "message" that was not really a message, but a contact in a public folder. I had set my program to just iterate over all "mailboxes" to collect all mail's. The first "mailbox" it encountered was a public folder full of contacts. When i just download the messages from the INBOX folder, everything works as expected. Maybe there should be some better error-handling for this case. Is there a way to check beforehand if a message is actually a contact and not a message? Or if a folder does not contain messages but contacts? |
Hi, thank you for this report.
For sure there should be, we just didn't even imaged this case
No, as we didn't know there could be contacts retrieved as messages. We need some details to reproduce the issue and (we hope to) create a test on our Dovecot test suite, can you give us:
|
We host our e-mails on our own kopano instance.
Also there was an base64-attachment which i did not decode because i don't have the time at the moment. |
Hi, I wasn't able to reproduce the bug because Dovecot returns all the headers you mention, even when the "email" is completely empty. May you checkout my branch https://github.com/Slamdunk/imap/tree/false_imap_headerinfo and test that the error is now manageable? |
This works for me. Now that an appropriate exception is thrown for this case, i can catch it, ignore that "message" with it's invalid headers and carry on. Thanks! |
Fix released in 1.5.2 |
When I try to download E-Mail's from an IMAP account, i get the following error message:
Type error: Argument 1 passed to Ddeboer\Imap\Message\Headers::__construct() must be an instance of stdClass, boolean given
This error happens on the first message it tries to download, which hints to it being a systematic issue rather then a broken message.
After a bit of debugging i found out that the issue is that "imap_headerinfo" returns false in Message.php at line 154.
I do not know yet why this call to imap_headerinfo fails, but at least a bit of error-handling should be added at this point to catch this error and display a nicer message.
Maybe i will write a PR for this, but first i will try to figure out why this call fails.
The text was updated successfully, but these errors were encountered: