Closed Bug 1923747 Opened 1 year ago Closed 1 year ago

IMAP folders accept messages piped over from IMAP protocol, even if folder is locked.

Categories

(Thunderbird :: General, defect)

defect

Tracking

(thunderbird_esr128 fixed, thunderbird132 fixed)

RESOLVED FIXED
133 Branch
Tracking Status
thunderbird_esr128 --- fixed
thunderbird132 --- fixed

People

(Reporter: benc, Assigned: benc)

References

Details

Attachments

(1 file)

Quick background:

When nsImapProtocol downloads messages, it pipes them over to the folder via nsImapMailFolder::ParseAdoptedMsgLine() (which is an nsIImapMessageSink method).

There are a couple of problems here that need fixing:

  1. nsImapMailFolder::ParseAdoptedMsgLine() happily accepts incoming messages from the protocol code, even if the folder is locked (eg during a folder compaction). It should check for this, and fail if the folder is locked.
  2. nsImapProtocol calls ParseAdoptedMsgLine(), but never checks to see if it succeeded or not.
Summary: IMAP folders accept messages piped over from IMAP protocol, even if folder is locked. → IMAP folders accepts messages piped over from IMAP protocol, even if folder is locked.
Summary: IMAP folders accepts messages piped over from IMAP protocol, even if folder is locked. → IMAP folders accept messages piped over from IMAP protocol, even if folder is locked.

This changes nsImapMailFolder::ParseAdoptedMsgLine() to fail when trying to
start a new message when the folder is locked (eg due to folder compaction).
It also changes nsImapProtocol to check the return code from
ParseAdoptedMsgLine() and to abort the whole operation if a failure is
returned.

See Also: → 1923765

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/840378229bd1
Reject message transfer from nsImapProtocol to locked folders. r=darktrojan

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch

Comment on attachment 9430026 [details]
Bug 1923747 - Reject message transfer from nsImapProtocol to locked folders. r=#thunderbird-reviewers

Patch 4 of a pile of 6 for the corrupted message issue.

[Approval Request Comment]
Regression caused by (bug #): probably always happened, seems to be more obvious after the compact folders rewrite
User impact if declined: can lead to messages appearing corrupt
Testing completed (on c-c, etc.): 4 days on central
Risk to taking this patch (and alternatives if risky): low

Attachment #9430026 - Flags: approval-comm-beta?

Comment on attachment 9430026 [details]
Bug 1923747 - Reject message transfer from nsImapProtocol to locked folders. r=#thunderbird-reviewers

[Triage Comment]
Approved for beta

Attachment #9430026 - Flags: approval-comm-beta? → approval-comm-beta+

Comment on attachment 9430026 [details]
Bug 1923747 - Reject message transfer from nsImapProtocol to locked folders. r=#thunderbird-reviewers

[Approval Request Comment]
See comment 3.

Attachment #9430026 - Flags: approval-comm-esr128?

Comment on attachment 9430026 [details]
Bug 1923747 - Reject message transfer from nsImapProtocol to locked folders. r=#thunderbird-reviewers

[Triage Comment]
Approved for esr128

Attachment #9430026 - Flags: approval-comm-esr128? → approval-comm-esr128+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: