Webklex / laravel-imap

Laravel IMAP is an easy way to integrate both the native php-imap module and an extended custom imap protocol into your Laravel app.
https://www.php-imap.com
MIT License
641 stars 182 forks source link

v4.0 Still can't read emails after running for a while and Read email content returns null #452

Closed Blear closed 1 year ago

Blear commented 2 years ago

1.Still can't read emails after running for a while

<< * OK Gimap ready for requests from 118.26.*.* ******
>> TAG1 LOGIN "*****@gmail.com" "*******"
<< * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584
<< TAG1 OK ******@gmail.com authenticated (Success)
>> TAG2 CAPABILITY
<< * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 UIDPLUS COMPRESS=DEFLATE ENABLE MOVE CONDSTORE ESEARCH UTF8=ACCEPT LIST-EXTENDED LIST-STATUS LITERAL- SPECIAL-USE APPENDLIMIT=35651584
<< TAG2 OK Success
>> TAG3 SELECT "INBOX"
<< * FLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing)
<< * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotPhishing $Phishing \*)] Flags permitted.
<< * OK [UIDVALIDITY 1] UIDs valid.
<< * 0 EXISTS
<< * 0 RECENT
<< * OK [UIDNEXT 86] Predicted next UID.
<< * OK [HIGHESTMODSEQ 17601]
<< TAG3 OK [READ-WRITE] INBOX selected. (Success)
>> TAG4 IDLE
<< + idling
>> DONE
<< TAG4 OK IDLE terminated (Success)
>> TAG5 IDLE
<< + idling
>> DONE
<< TAG5 OK IDLE terminated (Success)
>> TAG6 IDLE
<< + idling
>> DONE
<< TAG6 OK IDLE terminated (Success)
>> TAG7 IDLE
<< + idling
>> DONE
<< TAG7 OK IDLE terminated (Success)
>> TAG8 IDLE
<< + idling
>> DONE
<< TAG8 OK IDLE terminated (Success)
>> TAG9 IDLE
<< + idling
>> DONE
<< TAG9 OK IDLE terminated (Success)
>> TAG10 IDLE
<< + idling
>> DONE
<< TAG10 OK IDLE terminated (Success)
>> TAG11 IDLE
<< + idling
>> DONE
<< TAG11 OK IDLE terminated (Success)
>> TAG12 IDLE
<< + idling
>> DONE
<< TAG12 OK IDLE terminated (Success)
>> TAG13 IDLE
<< + idling
=======================================
No log output after running here,But the process is running..
[root@10-50-114-48 ~]# netstat -an|grep 993
tcp        0      0 10.50.114.48:64400      173.194.76.109:993      CLOSE_WAIT
[2022-09-28 04:04:11] online.INFO: read line
[2022-09-28 04:09:11] online.INFO: Exception:empty response
[2022-09-28 04:09:11] online.INFO: read line
[2022-09-28 04:14:11] online.INFO: Exception:empty response
[2022-09-28 04:14:12] online.INFO: read line
[2022-09-28 04:19:12] online.INFO: Exception:empty response
[2022-09-28 04:19:12] online.INFO: read line
[2022-09-28 04:24:12] online.INFO: Exception:empty response
[2022-09-28 04:24:12] online.INFO: read line
=======================================
No log output after running here,But the process is running..

It looks like the program keeps getting stuck in the nextLine() function..

2.When there are multiple emails in the inbox, the content of the read email is empty

$messages = $folder->messages()->all()->get();

    /** @var \Webklex\PHPIMAP\Message $message */
    foreach($messages as $message){
        echo $message->getSubject().'<br />'; //Subject acquisition is correct
        echo $message->getHTMLBody();//return empty ,can't get HTML Body
        if($message->move('INBOX.read') == true){
            echo 'Message has ben moved';
        }else{
            echo 'Message could not be moved';
        }
    }
mpryvkin commented 2 years ago

Seems to be related to php-imap issue #275 and php-imap PR #233.