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

Can not delete message; get exception also it is deleted from INBOX #512

Open
napengam opened this issue Aug 31, 2024 · 2 comments
Open

Comments

@napengam
Copy link

Deleting one email from gmail INBOX throws exception, but it is actualy deleted from INBOX

´´´
[31-Aug-2024 20:38:39 Europe/Berlin] PHP Fatal error: Uncaught Webklex\PHPIMAP\Exceptions\ResponseException: Command failed to process:
Causes:
- Empty response
Commands send:
TAG11 UID FETCH 842 (FLAGS)\r\n
Responses received:
TAG11 OK Success\r\n
Error occurred in F:\xampp-htdocs\projectCore\vendor\webklex\php-imap\src\Exceptions\ResponseException.php:53
Stack trace:
#0 F:\xampp-htdocs\projectCore\vendor\webklex\php-imap\src\Connection\Protocols\Response.php(318): Webklex\PHPIMAP\Exceptions\ResponseException::make(Object(Webklex\PHPIMAP\Connection\Protocols\Response), true)
#1 F:\xampp-htdocs\projectCore\vendor\webklex\php-imap\src\Connection\Protocols\Response.php(308): Webklex\PHPIMAP\Connection\Protocols\Response->validate()
#2 F:\xampp-htdocs\projectCore\vendor\webklex\php-imap\src\Message.php(585): Webklex\PHPIMAP\Connection\Protocols\Response->validatedData()
#3 F:\xampp-htdocs\projectCore\vendor\webklex\php-imap\src\Message.php(1254): Webklex\PHPIMAP\Message->parseFlags()
#4 F:\xampp-htdocs\projectCore\vendor\webklex\php-imap\src\Message.php(1194): Webklex\PHPIMAP\Message->setFlag('\Deleted')
#5 F:\xampp-htdocs\projectCore\test\klex.php(62): Webklex\PHPIMAP\Message->delete(false)
#6 {main}
thrown in F:\xampp-htdocs\projectCore\vendor\webklex\php-imap\src\Exceptions\ResponseException.php on line 53
´´´

@IulianMoldovanu
Copy link

IulianMoldovanu commented Sep 13, 2024

I encountered the same issue and resolved it by using $message->move('[Gmail]/Trash') instead of $message->delete().
and delete() method will apply only for trash folder
if ($folder->path === '[Gmail]/Trash') { return $message->delete(); }

@napengam
Copy link
Author

napengam commented Sep 13, 2024 via email

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