php-imap icon indicating copy to clipboard operation
php-imap copied to clipboard

BAD Error in IMAP command MOVE: Unknown command when using move on client

Open mdemori opened this issue 3 years ago • 1 comments

Hi,

i just found a very strange problem, i'm using dovecot as imap server and when i try to move a message, i receive the error in subject. seem that the command format was wrong :(

this is what i did (is not the complete code but only an example)

\Webklex\PHPIMAP\Message $currentMessage;

$this->currentMessage->move('Sent', true);

The code don't return any error or exception, the message remain on INBOX folder

Below the message sent to imap server:

"TAG13 SELECT "INBOX""
"TAG14 MOVE 1 "Sent""
"BAD Error in IMAP command MOVE: Unknown command.\r\n"
"TAG15 LOGOUT"

mdemori avatar Jun 24 '22 08:06 mdemori

Hi @mdemori , it looks like your mail provider doesn't support the Move command (?) This is a new feature for me :)

You can work around this by doing something like this:

$message->copy("INBOX/Sent", false);
$message->delete(true);

Please note that your folder / inbox path probably looks like INBOX/Sent or INBOX.Sent - depending on your config and the server setup.

Best regards & happy coding,

Webklex avatar Aug 08 '22 10:08 Webklex