Menu

#29 mailsync -D corrupts IMAP folders that contain only subfolders (no messages)

open
nobody
None
5
2024-02-29
2024-02-29
No

mailsync -D works as expected on folders that contain no subfolders. However, if folder 'foo' contains subfolders but no messages on stores A and B and if A is an IMAP store, then mailsync -D will attempt at deleting 'foo' on A resulting in a corrupted mailbox. For example, if the state of the stores is

A B

  • foo + foo
    • f1 + f1
    • f2 + f2
      • m1 - m1

calling mailsync -D will result in

A B

  • foo + foo
    • f2 + f2
      • m1 - m1

as one would expect and in a corrupted 'foo' on A if A is an IMAP store. The fact that 'foo' is corrupted is indicated differently in different mail clients. In Apple's Mail under iOS, the name of the folder gets grayed out. In Thunderbird the corrupted folder is shown in italics. In both cases it is still possible to open 'foo' and add messages to its subfolder. But it is no longer possible to add messages to 'foo' itself (on A if A is an IMAP store). Depending on the mail client, removing 'foo' (on A if A is an IMAP folder) yields an error.

The solution should be to distinguish between "empty" folders that contain subfolders and empty folders that do not contain subfolders and avoid attempting at deleting "empty" folders that contain subfolders.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB