Skip to content

#775 part 8: an account's row says whether it has rules, signatures and settings of its own (new code only) - #2287

Draft
kartas39 wants to merge 78 commits into
UCSLabs:mainfrom
kartas39:775-rules-signatures-checks
Draft

kartas39 wants to merge 78 commits into
UCSLabs:mainfrom
kartas39:775-rules-signatures-checks

Conversation

@kartas39

@kartas39 kartas39 commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Builds on #2286 (which builds on #2188, #2187, #2183, #2162 and #2124). Part 8 of #775: three more checks, for the call sites that today read AccountKind::Unknown themselves, and for the Accounts page (#798). Only the last commit is this part's own. #775 stays open.

What changes for the person using MailCraft

Nothing yet. Three new checks on AccountRow in crates/model/src/accounts.rs, called by nothing yet:

  • can_have_rules: not a shared mailbox, nor an account a newer MailCraft added. The Rules dialog's has_rules says the same today.
  • can_have_signatures: not an account a newer MailCraft added. The signature commands and the Signatures page say the same today.
  • can_change_settings: not an account a newer MailCraft added. account.edit says the same today.

How it was checked

crates/model/src/accounts_tests.rs: every kind this version knows has all three, a shared mailbox has signatures and settings but no rules, and an account a newer MailCraft added has none.

  • cargo xtask ci passes (one test fails only on this computer, opening_kind_tests::the_known_types_cover_what_this_desktop_says, from its desktop's file types; cargo deny warns of yanked async-executor and clipboard-win, as on main)
  • A crash or data-loss fix has its regression test (none here)
  • "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

Not changed

  • The places that read AccountKind::Unknown for rules, signatures and settings move to these checks in their own parts, one file each.

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

…r each thing

Thirteen can_… checks on AccountRow, each answered from two facts worked out once: whether the
account signs in with Microsoft, and whether its mail goes through Microsoft Graph. And
Mailbox::suitable_account() for the account to use when none is named. New code only: nothing
calls it yet, and main's own functions are as they were.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
…ts that go together

On AccountRow: has_server, can_send_mail, can_limit_offline_mail, name_or_address,
address_or_name, has_main_address, sign_in_account and junk_owner. On Mailbox: is_my_address,
my_addresses, shared_mailbox_rows, account_and_shared_mailbox_rows and
account_row_with_main_address. New code only: nothing calls it yet.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
The accounts with contacts and the Exchange address lists come down the folder pane
(Mailbox::account_rows), in the window, on the phone and through commands; they kept the order
the accounts were added in.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
The accounts with a list of their own come down the folder pane (Mailbox::account_rows); they
kept the order the accounts were added in.

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

Its Account list comes down the folder pane (Mailbox::account_rows), each list called by
AccountRow::address_or_name; it kept the order the accounts were added in.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
…hich has a row of its own

From benandez's review of UCSLabs#1836: account_rows follows accounts_in_order, which leaves out online
archives, while account_row gives a row for one. Both docs say so, and so does suitable_account,
which gives an archive only as the preferred account. A test pins it.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
…from its server

AccountRow::can_fetch_contacts also says yes of a JMAP account whose server has listed an
address book, as People did by hand; People now asks it and no longer reads the account's kind.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
…nd settings of its own

AccountRow::can_have_rules: not a shared mailbox, nor an account a newer MailCraft added.
AccountRow::can_have_signatures and can_change_settings: not an account a newer MailCraft
added. New code only.

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

coderabbitai Bot commented Dec 2, 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

Human-reviewed, AI-assisted, nobody's mailbox harmed.
…ver server keeps them

From benandez's review of UCSLabs#2124. can_sync_calendar also says yes of an Exchange server
account (EWS, UCSLabs#962) and of an account with a calendar server set (CalDAV, UCSLabs#209);
can_fetch_contacts of a JMAP account once its server lists an address book. An account
GNOME Online Accounts signs in for doesn't sign in with Microsoft here, as main's rules,
shared mailboxes and Graph runs already say. The docs say what the caller still checks
(the sign-in's permission, the categories read so far), and the tests cover every kind,
Zimbra too.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
Main's tr.po missed two strings and one place of another after UCSLabs#2210 and the start-view
change met; `cargo xtask i18n` writes it as main's code has it now.

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

# Conflicts:
#	crates/model/src/accounts.rs
Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.

# Conflicts:
#	crates/model/src/accounts.rs
#	crates/model/src/accounts_tests.rs
Human-reviewed, AI-assisted, nobody's mailbox harmed.
… a server that can be used

Main reads the calendar only through server settings with no problem (ews_directory's
ews_account); can_sync_calendar now asks the same, and the test has a real address and one
that can't be used.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
Human-reviewed, AI-assisted, nobody's mailbox harmed.
…osoft sign-in signs in, as on main

The account page makes one when both servers of an IMAP account that
signs in with Microsoft are cleared; main keeps its calendar, to-dos
and contacts through Microsoft still.

Human-reviewed, AI-assisted, nobody's mailbox harmed.
…Microsoft sign-in

Human-reviewed, AI-assisted, nobody's mailbox harmed.
…, after its account

Human-reviewed, AI-assisted, nobody's mailbox harmed.
…atever sign-in it has

Human-reviewed, AI-assisted, nobody's mailbox harmed.
… account; the log row names pane_order

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

sonarqubecloud Bot commented Dec 4, 2026

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