Closed Bug 1914442 Opened 2 years ago Closed 1 year ago

Support copying message from file for EWS

Categories

(Thunderbird :: Account Manager, task)

task

Tracking

(Not tracked)

RESOLVED FIXED
133 Branch

People

(Reporter: babolivier, Assigned: babolivier)

References

Details

Attachments

(3 files, 1 obsolete file)

No description provided.
Summary: Support copyime message from file for EWS → Support copying message from file for EWS
Assignee: nobody → brendan
Attachment #9420390 - Attachment description: WIP: Bug 1914442 - Support copying messages from file for EWS. → Bug 1914442 - Support copying messages from file for EWS. r=leftmostcat
Status: NEW → ASSIGNED

This experiment follows a few conversations we've had about moving
generic code outside of protocol-specific structures. It uses a
subset of copying from file on EWS as an example, as a feature that is
fairly straightforward and self-contained.

This patch introduces middle-man functions, that sit between services
and protocol-specific folder implementations. They are meant as central
call points that handle the generic parts of operations performed
on/with folders, and calls to the specific folder only to perform the
protocol-specific part of the operation (in this case, creating the
message onto the server).

In this example, the copy service calls onto NS_CopyMessageFile to
perform a copy from file into a specific folder. This functiontakes care
of preparing entries for the new message in the folder's message store
and database, through a Rust function exposed via FFI to parse the
message headers via the mail-parser crate, and populate the
nsIMsgDBHdr instance it's been given. It then passes the stream onto
the protocol-specific folder, which creates the message on the server
before handing back control to generic code (in the form of
CopyEndListener), which then commits the database and message store
entries.

In the future we might look into moving committing the new message
earlier, and marking it as pending until the server-side operation
succeeds (or rolling it back if it doesn't).

No longer blocks: tb-ms-exchange
Blocks: 1924853

Pushed by toby@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/2c5f6444d5b1
Vendor in latest changes from ews-rs. r=tobyp

Target Milestone: --- → 133 Branch

Pushed by toby@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/85b5d9bdab1f
Vendor in mail_parser. r=leftmostcat
https://hg.mozilla.org/comm-central/rev/67002292d228
Support copying messages from file for EWS. r=leftmostcat

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Regressions: 1927016
See Also: → 1930206
Regressions: 1931599
Regressions: 1934979
Attachment #9425277 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: