Closed Bug 1896171 Opened 5 months ago Closed 3 months ago

Implement an outgoing EWS server

Categories

(Thunderbird :: General, task)

Tracking

(Not tracked)

RESOLVED FIXED
130 Branch

People

(Reporter: babolivier, Assigned: babolivier)

References

(Blocks 1 open bug)

Details

Attachments

(9 files, 2 obsolete files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

Implement the outgoing server interface from bug 1882574, to send messages from EWS.

Note: eventually we probably won't want to have as much separation between the various EWS interface implementations, but this is something we can fix past MVP.

Keywords: leave-open

Implement a dummy EWS sending server that prints the MIME content of the email
to stdout.

Note that sending via the composer will show an error because copying the sent
message to the dedicated folder will fail, which is expected since we don't have
full storage of message contents yet.

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

Pushed by daniel@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/d36e626003f3
Part 1: Implement a dummy EWS sending server. r=leftmostcat

Attachment #9402962 - Attachment description: Bug 1896171 - Part 3: Support cancelling ongoing requests or timers. r=leftmostcat,ikey → Bug 1896171 - Part 3: Introduce a stub nsIRequest to handle cancellation. r=leftmostcat,ikey
Attachment #9403312 - Attachment description: Bug 1896171 - Part 4: Support ews-rs's Message::item_id being an Option. r=leftmostcat,ikey → Bug 1896171 - Part 3: Support ews-rs's Message::item_id being an Option. r=leftmostcat,ikey
Attachment #9403313 - Attachment description: Bug 1896171 - Part 5: Remove constraint on the server URI being an implementor of nsIMsgMailNewsUrl. r=leftmostcat,ikey → Bug 1896171 - Part 4: Remove constraint on the server URI being an implementor of nsIMsgMailNewsUrl. r=leftmostcat,ikey
Attachment #9403814 - Attachment description: WIP: Bug 1896171 - Part 6: Send messages via EWS. r=leftmostcat,ikey → WIP: Bug 1896171 - Part 5: Send messages via EWS. r=leftmostcat,ikey
Attachment #9402962 - Attachment is obsolete: true
Attachment #9403814 - Attachment description: WIP: Bug 1896171 - Part 5: Send messages via EWS. r=leftmostcat,ikey → Bug 1896171 - Part 5: Send messages via EWS. r=leftmostcat,ikey

On top of removing the burden on server implementations for ensuring the
Message-ID exists, this change also fixes a potential issue with sending MDN
replies with a Message-ID that differs from the one in the reply's header.

EWS requires Bcc recipients to be passed separately from the others. This is
because non-Bcc recipients are included in the MIME content, and therefore don't
need to be included separately in the request. But for compliance and privacy,
we don't include Bcc recipients in the MIME content.

I've also used this opportunity to make the type of the recipients a bit more
structured, which isn't a huge flow change since we would end up doing the same
parsing on the SMTP server side. So this is a small change that ends up saving a
bit of complexity on the server implementation's side.

Attachment #9403312 - Attachment is obsolete: true
Attachment #9403313 - Attachment description: Bug 1896171 - Part 4: Remove constraint on the server URI being an implementor of nsIMsgMailNewsUrl. r=leftmostcat,ikey → Bug 1896171 - Part 3: Remove constraint on the server URI being an implementor of nsIMsgMailNewsUrl. r=mkmelin
Attachment #9403814 - Attachment description: Bug 1896171 - Part 5: Send messages via EWS. r=leftmostcat,ikey → Bug 1896171 - Part 4: Send messages via EWS. r=leftmostcat,ikey
Attachment #9405706 - Attachment description: Bug 1896171 - Part 6: Ensure the Message-ID is correctly passed to nsIMsgOutgoingServer::sendMailMessage. r=#thunderbird-reviewers → Bug 1896171 - Part 5: Ensure the Message-ID is correctly passed to nsIMsgOutgoingServer::sendMailMessage. r=mkmelin
Attachment #9405945 - Attachment description: Bug 1896171 - Part 7: Send outgoing message to Bcc recipients when using EWS. r=leftmostcat,ikey → Bug 1896171 - Part 6: Send outgoing message to Bcc recipients when using EWS. r=leftmostcat,ikey

The exception is passwords, which need to be stored in a different place (the
logins manager), and aren't needed right now (Basic auth is actively discouraged
for EWS, when it's not disabled entirely, and we don't support NTLM yet).

Attachment #9407635 - Attachment description: WIP: Bug 1896171 - Part 8: Persist most attributes for the EWS outgoing server in prefs. → WIP: Bug 1896171 - Part 7: Persist most attributes for the EWS outgoing server in prefs.
Attachment #9407635 - Attachment description: WIP: Bug 1896171 - Part 7: Persist most attributes for the EWS outgoing server in prefs. → Bug 1896171 - Part 7: Persist most attributes for the EWS outgoing server in prefs. r=leftmostcat,ikey

Flagging for landing for parts 2 and 3 only, as part 4 hasn't been reviewed yet.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/3c42d8a0f879
Part 2: Factor authentication outside of IEwsIncomingServer. r=leftmostcat
https://hg.mozilla.org/comm-central/rev/e3a7db7d8951
Part 3: Remove constraint on the server URI being an implementor of nsIMsgMailNewsUrl. r=leftmostcat,mkmelin

Target Milestone: --- → 129 Branch
Pushed by brendan@thunderbird.net: https://hg.mozilla.org/comm-central/rev/0a48fe813a59 Part 2 follow-up: avoid using C-string literals until our MSRV allows it. rs=me
Attachment #9405706 - Attachment description: Bug 1896171 - Part 5: Ensure the Message-ID is correctly passed to nsIMsgOutgoingServer::sendMailMessage. r=mkmelin → Bug 1896171 - Part 5: Ensure the Message-ID is correctly passed to nsIMsgOutgoingServer::sendMailMessage. r=mkmelin,leftmostcat
Attachment #9408622 - Attachment description: Bug 1896171 - Part 8: Update the vendored ews-rs. r=leftmostcat,ikey → Bug 1896171 - Part 8: Update the vendored ews-rs. r=aleca
Attachment #9407635 - Attachment description: Bug 1896171 - Part 7: Persist most attributes for the EWS outgoing server in prefs. r=leftmostcat,ikey → Bug 1896171 - Part 7: Persist most attributes for the EWS outgoing server in prefs. r=ikey

Marking the rest of the stack up for landing. Try run for the outstanding patches: https://treeherder.mozilla.org/jobs?repo=try-comm-central&revision=c72469267e5473cbff1cb99b9c1219cfd19763c9

Target Milestone: 129 Branch → 130 Branch

Pushed by alessandro@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/2e4a17dc941a
Part 4: Send messages via EWS. r=leftmostcat
https://hg.mozilla.org/comm-central/rev/c973e9e0fd14
Part 5: Ensure the Message-ID is correctly passed to nsIMsgOutgoingServer::sendMailMessage. r=mkmelin,leftmostcat
https://hg.mozilla.org/comm-central/rev/481a29285725
Part 6: Send outgoing message to Bcc recipients when using EWS. r=leftmostcat
https://hg.mozilla.org/comm-central/rev/6101bbda0b58
Part 7: Persist most attributes for the EWS outgoing server in prefs. r=ikey
https://hg.mozilla.org/comm-central/rev/96f0147e0e6c
Part 8: Update the vendored ews-rs. r=aleca

Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED

Backed out the latest push for causing bustage build: https://treeherder.mozilla.org/jobs?repo=comm-central&revision=952277c41584f8621398bc8624d6ec08897d4472

The bustage is here: https://treeherder.mozilla.org/logviewer?job_id=465532660&repo=comm-central&lineNumber=77535-77543

But also we have another leftover c string here:

error[E0658]: `c".."` literals are experimental
 0:31.92    --> ews_xpcom\src\outgoing.rs:678:49
 0:31.92     |
 0:31.92 678 |             create_instance::<msgIOAuth2Module>(c"@mozilla.org/mail/oauth2-module;1").ok_or(
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Backout by alessandro@thunderbird.net: https://hg.mozilla.org/comm-central/rev/c3fea7760b0c Backed out changeset 96f0147e0e6c for causing build bustage. rs=backout https://hg.mozilla.org/comm-central/rev/d03d9b8c8271 Backed out changeset 6101bbda0b58 for causing build bustage. rs=backout https://hg.mozilla.org/comm-central/rev/289878d6eaed Backed out changeset 481a29285725 for causing build bustage. rs=backout https://hg.mozilla.org/comm-central/rev/ff1cce00e381 Backed out changeset c973e9e0fd14 for causing build bustage. rs=backout

Pushed by brendan@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/6c5edd10a2e0
Part 4: Send messages via EWS. r=leftmostcat
https://hg.mozilla.org/comm-central/rev/b6e2a625812b
Part 5: Ensure the Message-ID is correctly passed to nsIMsgOutgoingServer::sendMailMessage. r=mkmelin,leftmostcat
https://hg.mozilla.org/comm-central/rev/49bc680d4c7a
Part 6: Send outgoing message to Bcc recipients when using EWS. r=leftmostcat
https://hg.mozilla.org/comm-central/rev/369f77ae349a
Part 7: Persist most attributes for the EWS outgoing server in prefs. r=ikey
https://hg.mozilla.org/comm-central/rev/6e9480247e74
Part 8: Update the vendored ews-rs. r=aleca
https://hg.mozilla.org/comm-central/rev/5fe1cda9a9ae
Follow-up: Fix use of C-strings in Rust. r=ikey DONTBUILD

Status: REOPENED → RESOLVED
Closed: 3 months ago3 months ago
Resolution: --- → FIXED
Regressions: 1914662
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: