read_when_deleted not behaving correctly (randonly marking messages)
|Reported by:||arekm||Owned by:|
Roundcube should mark "deleted" messages as "read" (if I correctly understood how read_when_deleted is supposed to work).
The code responsible for this is in program/steps/mail/move_del.inc (part of code that handles "moveto" action):
So checking read_when_deleted is the only condition. This causes that when moving any message from one to another the message is marked as "read" while it should be marked only when moving to .Trash (deleting).
There are more problems with this:
1) $IMAP->set_flag($uids, 'SEEN') is called AFTER message is moved to another folder. This means that roundcube should set this flag for message in new folder while currently it looks for the message in old folder (where obviously it cannot be found since the message was already moved to new folder).
2) After moving message uid_id_map[$from_mbox] in rcube_imap class is not cleared. This causes that roundcube marks random message in source folder as "read" (uid_id_map table after move should be invalidated since the contents are "old" and don't reflect new state).