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

V5.5 Empty response error on delete function. #540

Open
sertancayci-jf opened this issue Jan 2, 2025 · 1 comment
Open

V5.5 Empty response error on delete function. #540

sertancayci-jf opened this issue Jan 2, 2025 · 1 comment

Comments

@sertancayci-jf
Copy link

sertancayci-jf commented Jan 2, 2025

I will take inbox and message but when i tried delete or setFlag i take Empty response error message. i tried try catch but still take belowed error. Also i tried $message->delete(); , $message->delete(true) or $message->delete($expunge = true) . I always take same error Any help?

php: 8.3
php-imap: 5.5.0

Command failed to process:
Causes:
Empty response

`

$foundedMessage = null;
foreach($messages as $message){
echo "Message: " . PHP_EOL;
echo "Subject: " . $message->getSubject() . PHP_EOL;
echo "UID: " . $message->getUid() . PHP_EOL;
echo "Timestamp: " . $message->getDate() . PHP_EOL;
   if (trim($message->getSubject()) === trim($subject)) {
          $foundedMessage = $message;
          echo "Email found." . PHP_EOL;
          try {
              $message->setFlag("Deleted");
              echo "Email marked as deleted." . PHP_EOL;
          } catch (\Exception $e) {
              // Log the error or handle it appropriately
              echo "Failed to delete message: " . $e->getMessage();
          }
          break;
      }

}

`
Basic response:
Message:
Subject: subject
UID: 12345
Timestamp: 2025-01-02 09:33:10
Email found.
Failed to delete message: Command failed to process:
Causes:
- Empty response
Error occurred

Debug true response:
<< TAG1 OK [email protected] authenticated (Success)

TAG2 LIST "" "*"

<< * LIST (\HasNoChildren) "/" "INBOX"
<< * LIST (\HasChildren \Noselect) "/" "[Gmail]"
<< * LIST (\All \HasNoChildren) "/" "[Gmail]/All Mail"
<< * LIST (\Drafts \HasNoChildren) "/" "[Gmail]/Drafts"
<< * LIST (\HasNoChildren \Important) "/" "[Gmail]/Important"
<< * LIST (\HasNoChildren \Sent) "/" "[Gmail]/Sent Mail"
<< * LIST (\HasNoChildren \Junk) "/" "[Gmail]/Spam"
<< * LIST (\Flagged \HasNoChildren) "/" "[Gmail]/Starred"
<< * LIST (\HasNoChildren \Trash) "/" "[Gmail]/Trash"
<< 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.
<< * 1 EXISTS
<< * 0 RECENT
<< * OK [UIDNEXT 12345] Predicted next UID.
<< * OK [HIGHESTMODSEQ 52847825]
<< TAG3 OK [READ-WRITE] INBOX selected. (Success)

TAG4 UID SEARCH ALL

<< * SEARCH 12345
<< TAG4 OK SEARCH completed (Success)

TAG5 UID FETCH 12345 (FLAGS)

<< * 1 FETCH (UID 12345 FLAGS ())
<< TAG5 OK Success

TAG6 UID FETCH 12345 (RFC822.HEADER)
<< FLAGS (\Seen))
<< * 1 FETCH (UID 12345 FLAGS (\Seen))
<< TAG7 OK Success

TAG8 UID STORE 12345:12345 -FLAGS.SILENT (\Seen)

<< * 1 FETCH (UID 12345 FLAGS ())
<< TAG8 OK Success

TAG9 UID FETCH 12345 (FLAGS)

<< * 1 FETCH (UID 12345 FLAGS ())
<< TAG9 OK Success
Message:
Subject: "subject"
UID: 12345
Timestamp: 2025-01-02 09:36:23
Email found.

TAG10 UID STORE 12345:12345 +FLAGS.SILENT (\Deleted)

<< * 1 EXPUNGE
<< * 0 EXISTS
<< TAG10 OK Success

TAG11 UID FETCH 12345 (FLAGS)

<< TAG11 OK Success
Failed to delete message: Command failed to process:
Causes:

  • Empty response
    Commands send:
    TAG11 UID FETCH 12345 (FLAGS)\r\n
    Responses received:
    TAG11 OK Success\r\n
    Error occurred>> TAG12 EXPUNGE

<< TAG12 OK Success

TAG13 LOGOUT

<< * BYE LOGOUT Requested
<< TAG13 OK 73 good day (Success)

@Webklex
Copy link
Owner

Webklex commented Feb 24, 2025

Hi @sertancayci-jf ,
are you able to reproduce the issue with the latest release as well?

Best regards & happy coding,

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

2 participants