Skip to content

#209 D7: File › Info › Calendars and Contacts, with Find - #1971

Draft
LembkeM wants to merge 10 commits into
UCSLabs:mainfrom
LembkeM:209-dav-window
Draft

LembkeM wants to merge 10 commits into
UCSLabs:mainfrom
LembkeM:209-dav-window

Conversation

@LembkeM

@LembkeM LembkeM commented Nov 26, 2026 •

Copy link
Copy Markdown

Part of #209 (D7, the window). Builds on #1953: the first four commits are that PR's, and this one is rebased once it is in. A draft until then.

What changes for the person using MailCraft

Only behind MAILCRAFT_DAV=1, as the rest of DAV.

File › Info has a line under each account that may have calendar servers (account.davSet's own rule): "Calendars and contacts: not set up" with Set Up…, or the server with Change…, and a status line from the last read. The window, Calendars and Contacts:

  • Typed settings. The calendars' and contacts' addresses, the user name, and whether the servers have a password of their own, kept through account.davSet. Saving sends nothing: the job reads at its next run.
  • One password field, shown when the box is ticked. It is held for the origin it names and no other. Calendars and contacts on one server (Infomaniak) share it. Contacts on another server ask for their own in File › Info, through #209 D7: a calendar server's own password, asked for, remembered and read back #1953's prompt. It is remembered only as #209 D7: a calendar server's own password, asked for, remembered and read back #1953 says: once the server took it, and only while sign-ins are remembered.
  • Find. The only thing in the window that sends. It searches from the typed addresses, or else from the account's domain (SRV and TXT over DNS-over-HTTPS, the well-known addresses, the mail server), through mailcraft_dav::discovery, which decides where the password may go. It signs in with the typed password when the box is ticked, else with the mail password. With the box ticked and nothing typed, nothing is searched. A host that isn't the owner's is asked about first, naming it whole ("Send It There" / "Don't Send"); a no sends it nothing. What was found fills the addresses, with the counts and what isn't read (task lists, plain files); Save keeps them. A failure is said in the window's own words, never a server's.
  • Stop using these servers runs account.davOff.

Not in this PR: the discovery rule for preset hosts asked about on #1887 (until then, Infomaniak's server is to be typed), and several servers per account. An untouched address field keeps every home it stands for, so an account with several keeps them on Save.

Where it is

  • crates/model/src/dav_find.rs: what a search found, or why not (DavFound, DavFindFailure, DavFindQuestion), as provider::Discovered is for mail.
  • crates/net/src/dav_find.rs: the host's driver of the discovery machine (requests, the look-up, the question). apps/mailcraft/src/dav_find.rs: the thread, the question to the window and back, a closed window stops it.
  • crates/ui-egui/src/dav_settings.rs, dav_find.rs: the window and the job's shapes (Services::dav_find).
  • crates/engine/src/cmd/dav_account.rs: may_have is now pub, so the window asks the command's rule.
  • crates/ui-egui/examples/ui_shot.rs: {"host": {"davFind": true}}, a stand-in search for the screenshots, and {"click": …} / {"typePassword": …}.

PRIVACY.md. Find sends the account's domain to public name servers and asks the usual places for it. If you want that row worded, a suggestion: "Find in File › Info › Calendars and Contacts sends your address's domain to public name servers and asks the servers it names, only when you press it; your password goes only to a server of yours that asks for it, or one you agree to."

Screenshots (light and dark): File › Info before, the question, what was found, File › Info after Save.

Light Dark
1-info-before-light 1-info-before-dark
2-question-light 2-question-dark
3-found-light 3-found-dark
4-info-after-light 4-info-after-dark

How it was checked

  • crates/net/src/dav_find_tests.rs, against mailcraft-dav's stand-in, example.org only: a typed address is the only place asked; the host the domain sends the search to is asked about, and a no sends it nothing; giving up ends it; a refused password ends it at once; Microsoft and Google send nothing; a plain http address is refused before anything is sent; the look-up is by the fixed service and the domain only.

  • crates/net/src/dav_find_tests.rs also: a search that was stopped sends nothing more.

  • apps/mailcraft/src/dav_find_flow.rs: the question goes to the window and the answer comes back; a closed window ends it quietly; an end is told once.

  • crates/ui-egui/src/dav_settings_tests.rs: the window's rules; saving keeps what was typed and sends nothing; a refused address keeps nothing; the password is held for its own origin only; one server takes one password; a password typed while the box is off is not held; Stop using; the status; Find signs in with the typed password only with the box ticked, never the mail password then; nothing is searched without a password or a host that can; one answer for one question; what was found fills the addresses and Save holds the password there; a failure keeps what was typed; a closed dialog stops its search; an untouched field keeps every home; every home Find found is kept; a missing password is asked for once, not twice.

  • cargo xtask ci passes

  • A crash or data-loss fix has its regression test (none in this change)

  • "Allow edits by maintainers" is ticked (the box beside Create pull request)

  • I have signed the CLA, or will by commenting on this pull request

Human-reviewed, AI-assisted, nobody's mailbox harmed.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
…e taken, read it back

Human-reviewed, AI-assisted, nobody's mailbox harmed.
…enshots

Human-reviewed, AI-assisted, nobody's mailbox harmed.
…iews

From the review of this pull request:

- A remembered password the server refused is no longer offered for the
  rest of the session, so File › Info asks for another. The store keeps
  it until a new one is taken in its place.
- A password that waits for the old one under its name to be removed
  keeps what was typed, and the dialog stays open and says so.
- A read of the store under way when a name is forgotten brings nothing
  back for that name.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A server's refusal no longer takes the password of a server that took
its own in the same job, nor one the owner gave while the job was out.
The password dialog closes when another mailbox takes the place of
this one. The test of a read under way during a forget waits for the
forget, so it no longer depends on which thread runs first.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
… status and Stop using

The window keeps what `account.davSet` takes: the calendar and contacts
addresses, the user name and whether the servers have a password of their
own. Which accounts may have them is the command's own rule. One password
field, held for the origin it names and no other; contacts on another
server ask for their own in File › Info. A status line says how the last
read went. Stop using these servers runs `account.davOff`. Saving sends
nothing. Behind MAILCRAFT_DAV=1.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
`mailcraft_net::dav_find` drives `mailcraft_dav::discovery`: the requests
it makes, the SRV and TXT look-up of the domain, and the question for the
owner, which waits for the window. A typed address is the only place asked
for its kind. It hands back homes and counts, or a kind of failure
(`mailcraft_model::DavFindFailure`), never a server's words. Tests run
against the stand-in: a typed address, a host the domain sends the search
to (asked first; a no sends it nothing), giving up, a refused password,
Microsoft and Google, a plain http address and the look-up.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
Find starts the host's search (`Services::dav_find`) from the typed
addresses, or from the account's domain. It signs in with the typed
password when the servers have their own, else with the mail password;
with the box ticked and nothing typed, nothing is searched. The host's
question about a host that isn't the owner's is put to the owner in the
window, naming it whole, and one answer goes back. What was found fills
the addresses, and Save keeps them; a failure is said in the window's own
words. A dialog that goes away stops its search.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
…n screenshots

The password field shows as soon as the box is ticked, so Find can search
from the domain with the servers' own password. ui_shot gets a stand-in
search (`{"host": {"davFind": true}}`), `{"click": label}` and
`{"typePassword": text}`, for the light and dark screenshots.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
…usted certificate

An untouched address field stands for its whole list of homes, kept or
found, so an unchanged Save keeps them all and the server stays the
same. The search asks before every round whether the owner gave up, so
a closed dialog sends nothing more. Find trusts the certificate the
owner trusts for these servers. The status line leaves a missing
password to File › Info's own line.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant