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

$imap->getMessages() failing with no error #237

Open
cbielich opened this issue Mar 7, 2019 · 2 comments
Open

$imap->getMessages() failing with no error #237

cbielich opened this issue Mar 7, 2019 · 2 comments

Comments

@cbielich
Copy link
Contributor

cbielich commented Mar 7, 2019

I was having issue primarily with Outlook emails where for some reason a random email would get stuck and my script would just die. No errors at all. Just when it tried to access that message with $imap->getMessages() it just died so I went through some digging and "think" I fixed my issue because it worked and the email was being brought in, but I have truly no idea why it worked but let me explain what I did and maybe you can figure it out.

In 'IncomingMessage.php' in line 370 you have

        if (!isset($objNew->$subtype)) {	
            $objNew->$subtype = $obj;
        } else {
            $subtype = $subtype.'_'.$i;
            $objNew->$subtype = $obj;
            $i++;
        }

What was happening is there were 3 $objNew->$subtype that it was trying to loop through, but on the third time it would die. So I changed it to this

        if (!isset($objNew->$subtype)) {	
	if (trim($obj) == '') {
	    $subtype = $subtype.'_'.$i;
	    $i++;
	}
            $objNew->$subtype = $obj;
        } else {
            $subtype = $subtype.'_'.$i;
            $objNew->$subtype = $obj;
            $i++;
        }

The reason I came up with this was that even though the third time if (!isset($objNew->$subtype)) { would trigger as true the object coming in was blank. So I thought adding the $subtype = $subtype.'_'.$i; and $i++; since it seemed to be a false positive.

Again I have no idea how this worked, it just did. Hoping someone can take a look and see something I am not.

@redanefzi
Copy link

i have the same problem using
$imap->getMessages();
Error:
mb_convert_encoding(): Illegal character encoding specified

@mcki0127
Copy link

Same here. Line 400 of IncomingMessage.php is failing:

$objNew->text = quoted_printable_decode(mb_convert_encoding( $objNew->plain, "utf-8", $objNew->plain->charset ));

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

No branches or pull requests

3 participants