barbushin / php-imap

Manage mailboxes, filter/get/delete emails in PHP (supports IMAP/POP3/NNTP)
MIT License
1.65k stars 459 forks source link

[BUG] Mark as Seen boolean not working on getMail() #715

Open MincDev opened 9 months ago

MincDev commented 9 months ago

Environment (please complete the following information):

Describe the bug Since PhpImap version 4, the mark as seen boolean on getMail() is no longer working. The mail is not marked as seen even if true is passed in. Versions prior to 4 is working as expected.

To Reproduce Try to get a mail and notice that it is not marked as seen.

The used code:

$mail = $mailbox->getMail($mailsIds[0], true);

Expected behavior I expected the email to be marked as seen.

LucianoVandi commented 3 months ago

I'm using version 5 via https://github.com/secit-pl/imap-bundle, and I've encountered the same issue as well. It happens only with certain specific emails. To give you an idea: in the same mailbox, I have 4 messages, 3 are marked as read, and one is not, even if I read them individually. If after $mailbox->getMail() I call $mailbox->markMailAsRead($emailId), then it works.

I believe it's something strictly related to the message itself, because I tried having it forwarded to me, and then I personally sent the same message to the mailbox I'm monitoring, and in that case, it gets marked as seen.