From 16c3f9a436e26b793421b2b67fd1fd202d5ef47e Mon Sep 17 00:00:00 2001 From: leemour Date: Tue, 24 Nov 2026 23:43:55 +0100 Subject: [PATCH 01/16] docs(people): plan contact kinds as sender, reach and tie One kind per person answers three questions at once: who sent it, how it reached the owner and whether the owner knows them. Service mail lands in Strangers and newsletters in merge review because one answer has to win. The plan splits the kind into sender (human, bot, organization), reach (direct, group, broadcast) and tie, lists the local signals that decide each one with their sources, groups bots under organizations by registrable domain, names the domain lists that can be shipped and matched locally, and keeps AI classification for its own plan. The four bugs behind the RFC are #3319-#3322. Refs #3314 Co-Authored-By: Claude Opus 5.5 --- docs/dev/BACKLOG.md | 3 + docs/dev/plans/2026-11-24-contact-kinds.md | 176 +++++++++++++++++++++ 2 files changed, 179 insertions(+) create mode 100644 docs/dev/plans/2026-11-24-contact-kinds.md diff --git a/docs/dev/BACKLOG.md b/docs/dev/BACKLOG.md index 9ab03e2a2..4bb140ee2 100644 --- a/docs/dev/BACKLOG.md +++ b/docs/dev/BACKLOG.md @@ -82,6 +82,9 @@ None open. beta) that every CLI and Desktop read, and that can replace the agent where a model can do the job. `models ai` and image reading are built; the `ai-model` reader, enrichment and tg/max are open: [plans/2026-11-09-ai-model-setting.md](plans/2026-11-09-ai-model-setting.md). +- **CORE-71** · P2 · 🚩 Contact kinds as three answers (who sent it, how it reached the owner, whether the owner + knows them) instead of one kind, so service mail and newsletters leave Strangers and merge review (#3314). Draft plan + waits for review: [plans/2026-11-24-contact-kinds.md](plans/2026-11-24-contact-kinds.md). - **CORE-3** · P2 · 🚩 A smaller install: a fresh `npm i @wirecat/cli-core` is 238 MB. Draft plan waits for the owner: [plans/2026-10-18-install-size.md](plans/2026-10-18-install-size.md). - **CORE-4** · P2 · 🟡 🚧 `fix/standards-vocabulary-paths` The audited personal-account result entities, diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md new file mode 100644 index 000000000..97d9fdeb9 --- /dev/null +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -0,0 +1,176 @@ +# Plan: who sent it and how it reached you + +Status: draft for review. Nothing here is built. It answers the RFC in +[#3314](https://github.com/WireCatLabs/cli-core/issues/3314) and replaces its proposal. + +## The problem + +Every person in the store gets one kind: `person`, `organization`, `automated`, `stranger`, `unsorted` (and `test`) +([`domain/person-kinds.ts`](../../../src/domain/person-kinds.ts), rules in `kindOf` in +[`store/sqlite/people-list.ts`](../../../src/store/sqlite/people-list.ts)). WireCat Desktop shows one tab per kind. + +One kind answers three different questions at once: + +1. **Who sent it?** A person, a program, or a company's shared mailbox. +2. **How did it reach you?** Written to you, written in a group you are in, or sent to a list of subscribers. +3. **Do you know them?** You wrote to them, met them, keep them in your phone book. + +Because one answer has to win, the wrong one often does. What users see: + +- **Service mail under Strangers.** A bank's statements or a service's alerts from an address like + `noreply-12345@bank.example` or `alerts@service.example`. The no-reply check needs the whole local part to be a + no-reply word, so these pass as people with no tie. +- **The owner and close contacts under Strangers.** The owner's second address is not known as the owner. Mail sent + from an alias, and all mail of an IMAP account, is not seen as sent by the owner, so the people the owner writes to + get no tie. +- **Newsletters in merge review.** A newsletter that sends from `author+topic1@newsletter.example`, + `author+topic2@…` becomes one person per address. They share a name and a domain, so the name-match scan proposes + every pair as "may be the same person". +- **A tab of dead rows.** Unsorted holds deleted accounts and rows with no name, which the owner can do nothing with. + +The four bugs have their own issues and are fixed before this plan: +[#3319](https://github.com/WireCatLabs/cli-core/issues/3319) (no-reply by any part of the address), +[#3320](https://github.com/WireCatLabs/cli-core/issues/3320) (no bots or automated senders in name matches), +[#3321](https://github.com/WireCatLabs/cli-core/issues/3321) (the owner's aliases), +[#3322](https://github.com/WireCatLabs/cli-core/issues/3322) (IMAP Sent folder). + +## The model: three answers instead of one kind + +Each sender (a person in the store) gets three answers, each from its own signals. + +| Field | Values | Meaning | +|---|---|---| +| `sender` | `human` · `bot` · `organization` | Who writes. `bot`: a program writes (no-reply, alerts, 2FA codes, a messenger bot). `organization`: a shared mailbox people answer (`info@`, `support@`). | +| `reach` | `direct` · `group` · `broadcast` | How their messages reached the owner, the widest the owner gets most. `direct`: to the owner, or a small group. `group`: a large chat or a discussion list where everyone can write. `broadcast`: one sender to many readers who cannot answer in place: a newsletter, a channel, marketing mail. | +| `tie` | yes · no | The owner knows them: the ties `person-ties.ts` already works out. | + +Data quality is not a kind. These become marks on the row: `owner`, `incomplete` (no name, or a deleted account), +`test`. + +Why `bot` and not `automated`: a bot is a program. A newsletter author is usually a human who writes to many people. +So "newsletter" is a `reach`, not a `sender`. Both cases now have a place: a 2FA code is `bot` + `direct`, a +newsletter is `human` (or `bot`) + `broadcast`. + +### What the screen shows + +| Tab | Who | Filters inside | +|---|---|---| +| **People** | `human`, reach `direct` or `group` | Known (tie) · Not known (no tie, today's Strangers) | +| **Subscriptions** | reach `broadcast`, any sender | Newsletters · Channels · Marketing | +| **Bots** | `bot`, reach `direct` | Alerts and codes · Receipts · Messenger bots | +| **Organizations** | the `organizations` table | Its people, shared mailboxes and bots, grouped under it | + +`incomplete` rows are a filter on every tab ("Show incomplete"), off by default. Today's `kind` stays as a value +worked out from the three fields, so memo and Desktop keep working until they move. + +## How a sender is sorted + +Only local, deterministic rules. The owner's choice always wins and applies to the sender's whole history, past +and future, the way a mail client's "always put this sender in…" does. + +Signals, strongest first: + +1. **The owner chose.** A kind the owner set by hand. +2. **The platform says so.** Telegram `user.bot`, `user.support`, `user.deleted` + ([constructor/user](https://core.telegram.org/constructor/user)); Slack `is_bot`, `profile.bot_id` + ([user object](https://docs.slack.dev/reference/objects/user-object)); Discord `bot`, `system` + ([user](https://docs.discord.com/developers/resources/user)). Stored today as `identities.bot`. +3. **The owner wrote to them.** Mail from any of the owner's addresses + ([#3321](https://github.com/WireCatLabs/cli-core/issues/3321)), a one-to-one chat the owner wrote in. This makes + a `tie` and `direct` reach, and stops `bot` from header guesses (not from the platform flag). +4. **Mail headers that mark a program.** `Auto-Submitted` other than `no` + ([RFC 3834](https://www.rfc-editor.org/rfc/rfc3834)), an empty return path, `MAILER-DAEMON` → `bot`. +5. **Mail headers that mark a list.** `List-Unsubscribe-Post: List-Unsubscribe=One-Click` + ([RFC 8058](https://www.rfc-editor.org/rfc/rfc8058); Gmail requires it from senders of more than 5,000 mails a + day, [Google](https://support.google.com/a/answer/81126)), `List-Unsubscribe` + ([RFC 2369](https://www.rfc-editor.org/rfc/rfc2369)), `Feedback-ID` + ([Google](https://support.google.com/mail/answer/6254652)) → `broadcast`. `List-Id` + ([RFC 2919](https://www.rfc-editor.org/rfc/rfc2919)) with replies from many senders → `group`, with one sender → + `broadcast`. +6. **Where the owner is on the message.** The owner's address in no `To` or `Cc` (Bcc, undisclosed recipients, a + list) → not `direct`. In `To` with few others → `direct`. +7. **The chat type.** A Telegram channel (`broadcast` flag, + [constructor/channel](https://core.telegram.org/constructor/channel)) → `broadcast`. A group of more than + `SMALL_GROUP_MEMBERS` → `group`. +8. **The address.** No-reply words in any part of the local part + ([#3319](https://github.com/WireCatLabs/cli-core/issues/3319)) → `bot`. Role words (`info`, `support`, `billing`) + → `organization`. +9. **The name.** Legal forms and company words (today's `isCompanyName`) → `organization`. Notification words + (today's `isAutomatedName`) → `bot`. +10. **The domain.** See the next section. + +**Header trust.** The sender sets every header. A header counts only when the receiving server's +`Authentication-Results` shows a DKIM signature that passed and covers it. A missing header proves nothing. + +### Grouping under an organization + +A `bot` or `organization` sender joins the organization of its registrable domain, worked out with the +[Public Suffix List](https://publicsuffix.org/list/) (`mail.bank.example` and `bank.example` are one domain). This +is automatic and never goes to merge review. Three exceptions: + +- **Free mail** (`gmail.com`, `outlook.com`; today's `FREE_MAIL`): never an organization. +- **Sending platforms** (newsletter hosts and mail services that send for many customers): group by `List-Id`, or by + display name within the platform, never by the platform's domain. Otherwise every newsletter on one host becomes + one sender. +- **`human` senders** at a company domain are linked to the organization as members (`member-of`), not merged. + +### Domain lists + +A domain list can also give an organization its purpose: bank, shop, airline, news, government. This becomes a +`category` on the organization, and a filter on the Bots and Organizations tabs. + +Only lists downloaded whole and matched on the owner's computer qualify. A lookup per sender (a DNS blocklist, a +category API) tells a third party who writes to the owner. Checked on 2026-11-24: + +| Source | Gives | Licence | Use | +|---|---|---|---| +| [Wikidata](https://www.wikidata.org/wiki/Wikidata:Database_download) | Banks, airlines, companies, media, government with their official website ([P856](https://www.wikidata.org/wiki/Property:P856)): about 4,000 banks and 2,800 airlines with a website | CC0 | Extract `domain → category` from the dump at release; only the preferred website with no end date | +| [UT1 lists](https://github.com/olbat/ut1-blacklists) | `bank`, `financial`, `shopping`, `press`, `social_networks`, `webmail` domain lists | CC BY-SA 4.0 | Ship as a separate file with credit, never merged into our data, so share-alike stays on that file | +| [disposable-email-domains](https://github.com/disposable-email-domains/disposable-email-domains) | Throwaway mail domains | CC0 | With `FREE_MAIL`: never an organization | +| [Public Suffix List](https://publicsuffix.org/list/) | Registrable domains | MPL 2.0 | Grouping under an organization | +| Our own table | Sending platforms and newsletter hosts | ours | Checked against each vendor's docs; no curated list exists | + +Not used: + +- **Cloudflare domain categories, Cisco Umbrella, Klazify:** lookups per domain, and Cloudflare Radar data is + non-commercial ([CC BY-NC](https://developers.cloudflare.com/radar/)). +- **Spamhaus, SURBL, URIBL:** they mark spam, not banks or shops, and their free use excludes commercial products + ([Spamhaus terms](https://www.spamhaus.org/organization/dnsblusage/), [SURBL policy](https://www.surbl.org/usage-policy)). +- **Tranco and other top-site lists:** popularity, not purpose. + +A domain names the organization, not the sender. A person at `bank.example` is a `human` member of the bank, not a +bot. Mail sent through a sending platform never takes the platform's category. So the domain is the last signal, +after the headers and the address, and it is matched on both the `From` domain and the DKIM signing domain. + +## Out of scope + +- **AI classification.** Sorting by a model is planned as a separate command with its own plan. This plan keeps the + rules local and deterministic, so they work without a model and give the AI command a clean start. +- **Usage data.** No telemetry, by decision. + +## Order of work + +1. The four bugs: #3319, #3320, #3321, #3322. +2. Store: `sender`, `reach` and the marks on `persons`, worked out like `kind` today (lazily, cleared by triggers). + `kind` stays, worked out from them. A migration number from [COORDINATION.md](../COORDINATION.md). +3. Mail sync reads `Auto-Submitted`, `List-Unsubscribe-Post` and `Feedback-ID` (today + [`mail/headers.ts`](../../../src/mail/headers.ts) reads `LIST-ID`, `LIST-UNSUBSCRIBE`, `PRECEDENCE`) and records + where the owner was on each message. +4. Organizations from domains, with the three exceptions above, then their `category` from the domain lists. +5. The owner's choice: a command that sets a sender's kind for its whole history. +6. memo: `people list` filters `sender:`, `reach:`, `tie:`. +7. Desktop: four tabs and their filters; this closes + [desktop#319](https://github.com/WireCatLabs/wirecat-desktop/issues/319) (bot filter) and touches + [desktop#320](https://github.com/WireCatLabs/wirecat-desktop/issues/320) (filters). The public page + `content/docs/desktop/contacts.mdx` in cli-docs and its RU and ES copies change with it. + +## Open questions + +1. **Tab names.** People / Subscriptions / Bots / Organizations (RU: Люди / Подписки / Боты / Организации). Are four + tabs right, or should Bots sit inside Organizations? +2. **Reach of a mixed sender.** Someone who writes to the owner directly and also sends a newsletter: one sender with + reach `direct`, or two senders split by address? +3. **Discussion lists.** A mailing list where people answer each other: are its members People (reach `group`) or + one Subscription? +4. **Where the domain lists live.** Built into the package at release (no network at run time), or downloaded once by + a `models`-style command the owner runs? From c3203283401623051af7320046d29ffceed2454b Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 02:15:26 +0100 Subject: [PATCH 02/16] docs(people): bots become their own entity in the contact kinds plan The owner chose to keep bots apart from people: a bot in its own table cannot be proposed as the same person, assigned a task or counted as known, so no list has to remember to skip it. The sender field goes; reach and tie stay on persons and bots. Identities move between a person and a bot, logged, with the owner's choice winning. The order of work now starts with signals that need no store change, and the bots migration waits for the 1.0 store version 73 (#3288). Refs #3314 Co-Authored-By: Claude Opus 5.5 --- docs/dev/BACKLOG.md | 5 +- docs/dev/plans/2026-11-24-contact-kinds.md | 88 ++++++++++++++-------- 2 files changed, 59 insertions(+), 34 deletions(-) diff --git a/docs/dev/BACKLOG.md b/docs/dev/BACKLOG.md index 4bb140ee2..b1f5fc435 100644 --- a/docs/dev/BACKLOG.md +++ b/docs/dev/BACKLOG.md @@ -82,8 +82,9 @@ None open. beta) that every CLI and Desktop read, and that can replace the agent where a model can do the job. `models ai` and image reading are built; the `ai-model` reader, enrichment and tg/max are open: [plans/2026-11-09-ai-model-setting.md](plans/2026-11-09-ai-model-setting.md). -- **CORE-71** · P2 · 🚩 Contact kinds as three answers (who sent it, how it reached the owner, whether the owner - knows them) instead of one kind, so service mail and newsletters leave Strangers and merge review (#3314). Draft plan +- **CORE-71** · P2 · 🚩 Bots as their own entity beside people and organizations, and two answers on each (how it + reached the owner, whether the owner knows them) instead of one kind, so service mail and newsletters leave + Strangers and merge review (#3314). Draft plan waits for review: [plans/2026-11-24-contact-kinds.md](plans/2026-11-24-contact-kinds.md). - **CORE-3** · P2 · 🚩 A smaller install: a fresh `npm i @wirecat/cli-core` is 238 MB. Draft plan waits for the owner: [plans/2026-10-18-install-size.md](plans/2026-10-18-install-size.md). diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index 97d9fdeb9..3361a4916 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -1,6 +1,6 @@ # Plan: who sent it and how it reached you -Status: draft for review. Nothing here is built. It answers the RFC in +Status: draft for review. The bug fixes (step 1) are built; the rest is not. It answers the RFC in [#3314](https://github.com/WireCatLabs/cli-core/issues/3314) and replaces its proposal. ## The problem @@ -34,34 +34,52 @@ The four bugs have their own issues and are fixed before this plan: [#3321](https://github.com/WireCatLabs/cli-core/issues/3321) (the owner's aliases), [#3322](https://github.com/WireCatLabs/cli-core/issues/3322) (IMAP Sent folder). -## The model: three answers instead of one kind +## The model: bots apart from people, then two answers -Each sender (a person in the store) gets three answers, each from its own signals. +**Who writes is an entity, not a field.** An identity (an address, a messenger account) belongs to one of three: + +| Entity | Table | What it is | +|---|---|---| +| Person | `persons` (as today) | A human. | +| Bot | `bots` (new) | A program: no-reply and alert addresses, 2FA codes, receipts, a messenger bot, a company's marketing mail. | +| Organization | `organizations` (as today) | A company. Its shared mailboxes (`info@`, `support@`) and its bots belong to it. | + +Why a separate entity: as long as a bot is a person with a mark, every list, every merge scan and every tie check +has to remember to skip it, and each one that forgets is a bug (#3320 was one). A bot in its own table cannot be +proposed as "the same person", cannot be a task's assignee and never counts as someone the owner knows. + +A bot has a name, its identities and an optional organization. It has no ties, no tasks and no merge review: two +bots of one organization are grouped under it, not merged. + +**Moving between entities.** A rule can be wrong, so an identity can move from a person to a bot and back. Its +messages stay where they are (they point at the identity), the move is logged, and the owner's choice always wins +over the rules. + +**Two answers on every person and bot:** | Field | Values | Meaning | |---|---|---| -| `sender` | `human` · `bot` · `organization` | Who writes. `bot`: a program writes (no-reply, alerts, 2FA codes, a messenger bot). `organization`: a shared mailbox people answer (`info@`, `support@`). | | `reach` | `direct` · `group` · `broadcast` | How their messages reached the owner, the widest the owner gets most. `direct`: to the owner, or a small group. `group`: a large chat or a discussion list where everyone can write. `broadcast`: one sender to many readers who cannot answer in place: a newsletter, a channel, marketing mail. | -| `tie` | yes · no | The owner knows them: the ties `person-ties.ts` already works out. | +| `tie` | yes · no | The owner knows them: the ties `person-ties.ts` already works out. Always no for a bot. | Data quality is not a kind. These become marks on the row: `owner`, `incomplete` (no name, or a deleted account), `test`. -Why `bot` and not `automated`: a bot is a program. A newsletter author is usually a human who writes to many people. -So "newsletter" is a `reach`, not a `sender`. Both cases now have a place: a 2FA code is `bot` + `direct`, a -newsletter is `human` (or `bot`) + `broadcast`. +**A newsletter a human writes stays a person** with reach `broadcast` (open question 1). The owner can answer +the author, and the author may be someone the owner also writes to directly. A company's newsletter sent through a +mailing service is a bot. ### What the screen shows | Tab | Who | Filters inside | |---|---|---| -| **People** | `human`, reach `direct` or `group` | Known (tie) · Not known (no tie, today's Strangers) | -| **Subscriptions** | reach `broadcast`, any sender | Newsletters · Channels · Marketing | -| **Bots** | `bot`, reach `direct` | Alerts and codes · Receipts · Messenger bots | +| **People** | persons, reach `direct` or `group` | Known (tie) · Not known (no tie, today's Strangers) | +| **Subscriptions** | persons and bots with reach `broadcast` | Newsletters · Channels · Marketing | +| **Bots** | bots, reach `direct` | Alerts and codes · Receipts · Messenger bots | | **Organizations** | the `organizations` table | Its people, shared mailboxes and bots, grouped under it | -`incomplete` rows are a filter on every tab ("Show incomplete"), off by default. Today's `kind` stays as a value -worked out from the three fields, so memo and Desktop keep working until they move. +`incomplete` rows are a filter on every tab ("Show incomplete"), off by default. Today's `kind` stays on +`people.list` while memo and Desktop move: a bot is listed as `automated`, worked out from the new tables. ## How a sender is sorted @@ -70,14 +88,17 @@ and future, the way a mail client's "always put this sender in…" does. Signals, strongest first: -1. **The owner chose.** A kind the owner set by hand. +The signals decide the entity (person, bot or an organization's shared mailbox) and the reach. + +1. **The owner chose.** "This is a person" or "this is a bot", set by hand. 2. **The platform says so.** Telegram `user.bot`, `user.support`, `user.deleted` ([constructor/user](https://core.telegram.org/constructor/user)); Slack `is_bot`, `profile.bot_id` ([user object](https://docs.slack.dev/reference/objects/user-object)); Discord `bot`, `system` ([user](https://docs.discord.com/developers/resources/user)). Stored today as `identities.bot`. 3. **The owner wrote to them.** Mail from any of the owner's addresses ([#3321](https://github.com/WireCatLabs/cli-core/issues/3321)), a one-to-one chat the owner wrote in. This makes - a `tie` and `direct` reach, and stops `bot` from header guesses (not from the platform flag). + a `tie` and `direct` reach, and keeps the identity a person against header guesses (not against the platform + flag). 4. **Mail headers that mark a program.** `Auto-Submitted` other than `no` ([RFC 3834](https://www.rfc-editor.org/rfc/rfc3834)), an empty return path, `MAILER-DAEMON` → `bot`. 5. **Mail headers that mark a list.** `List-Unsubscribe-Post: List-Unsubscribe=One-Click` @@ -104,7 +125,7 @@ Signals, strongest first: ### Grouping under an organization -A `bot` or `organization` sender joins the organization of its registrable domain, worked out with the +A bot or a shared mailbox joins the organization of its registrable domain, worked out with the [Public Suffix List](https://publicsuffix.org/list/) (`mail.bank.example` and `bank.example` are one domain). This is automatic and never goes to merge review. Three exceptions: @@ -112,7 +133,7 @@ is automatic and never goes to merge review. Three exceptions: - **Sending platforms** (newsletter hosts and mail services that send for many customers): group by `List-Id`, or by display name within the platform, never by the platform's domain. Otherwise every newsletter on one host becomes one sender. -- **`human` senders** at a company domain are linked to the organization as members (`member-of`), not merged. +- **People** at a company domain are linked to the organization as members (`member-of`), not merged. ### Domain lists @@ -138,7 +159,7 @@ Not used: ([Spamhaus terms](https://www.spamhaus.org/organization/dnsblusage/), [SURBL policy](https://www.surbl.org/usage-policy)). - **Tranco and other top-site lists:** popularity, not purpose. -A domain names the organization, not the sender. A person at `bank.example` is a `human` member of the bank, not a +A domain names the organization, not the sender. A person at `bank.example` is a member of the bank, not a bot. Mail sent through a sending platform never takes the platform's category. So the domain is the last signal, after the headers and the address, and it is matched on both the `From` domain and the DKIM signing domain. @@ -150,15 +171,17 @@ after the headers and the address, and it is matched on both the `From` domain a ## Order of work -1. The four bugs: #3319, #3320, #3321, #3322. -2. Store: `sender`, `reach` and the marks on `persons`, worked out like `kind` today (lazily, cleared by triggers). - `kind` stays, worked out from them. A migration number from [COORDINATION.md](../COORDINATION.md). -3. Mail sync reads `Auto-Submitted`, `List-Unsubscribe-Post` and `Feedback-ID` (today - [`mail/headers.ts`](../../../src/mail/headers.ts) reads `LIST-ID`, `LIST-UNSUBSCRIBE`, `PRECEDENCE`) and records - where the owner was on each message. -4. Organizations from domains, with the three exceptions above, then their `category` from the domain lists. -5. The owner's choice: a command that sets a sender's kind for its whole history. -6. memo: `people list` filters `sender:`, `reach:`, `tie:`. +1. The four bugs: #3319, #3320, #3321, #3322 (#3319, #3320, #3322 merged; #3321 waits on mail-cli). +2. Signals with no store change: mail sync reads `Auto-Submitted`, `List-Unsubscribe-Post` and `Feedback-ID` into the + stored headers (today [`mail/headers.ts`](../../../src/mail/headers.ts) reads `LIST-ID`, `LIST-UNSUBSCRIBE`, + `PRECEDENCE`), trusted only under a passed DKIM signature of the `From` domain; `reach` is worked out from + `email_recipients` for the page a list returns. Strong program signals already feed today's `automated`. +3. Store: the `bots` table, `identities` pointing at a person or a bot, the move log, and `reach` and the marks kept + like `kind` today (lazily, cleared by triggers). Identities that today make a person `automated` move to bots. + The migration takes the next free number after the 1.0 store (73, cli-core#3288). +4. The owner's choice: move an identity to a person or a bot, for its whole history. +5. Organizations from domains, with the three exceptions above, then their `category` from the domain lists. +6. memo: `bots list`, and `people list` filters `reach:`, `tie:`. 7. Desktop: four tabs and their filters; this closes [desktop#319](https://github.com/WireCatLabs/wirecat-desktop/issues/319) (bot filter) and touches [desktop#320](https://github.com/WireCatLabs/wirecat-desktop/issues/320) (filters). The public page @@ -166,11 +189,12 @@ after the headers and the address, and it is matched on both the `From` domain a ## Open questions -1. **Tab names.** People / Subscriptions / Bots / Organizations (RU: Люди / Подписки / Боты / Организации). Are four +1. **A newsletter a human writes.** A person with reach `broadcast` (this plan), or a bot like a company's newsletter? +2. **Tab names.** People / Subscriptions / Bots / Organizations (RU: Люди / Подписки / Боты / Организации). Are four tabs right, or should Bots sit inside Organizations? -2. **Reach of a mixed sender.** Someone who writes to the owner directly and also sends a newsletter: one sender with +3. **Reach of a mixed sender.** Someone who writes to the owner directly and also sends a newsletter: one sender with reach `direct`, or two senders split by address? -3. **Discussion lists.** A mailing list where people answer each other: are its members People (reach `group`) or - one Subscription? -4. **Where the domain lists live.** Built into the package at release (no network at run time), or downloaded once by +4. **Discussion lists.** A mailing list where people answer each other: are its members People (reach `group`) or + one Subscription? Until answered: a `List-Id` with three or more distinct senders is `group`. +5. **Where the domain lists live.** Built into the package at release (no network at run time), or downloaded once by a `models`-style command the owner runs? From d31f59085f97df0158636dae76b605e73f8e5acf Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 02:19:04 +0100 Subject: [PATCH 03/16] docs(people): a newsletter a human writes stays a person Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index 3361a4916..c5b8e355e 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -65,7 +65,7 @@ over the rules. Data quality is not a kind. These become marks on the row: `owner`, `incomplete` (no name, or a deleted account), `test`. -**A newsletter a human writes stays a person** with reach `broadcast` (open question 1). The owner can answer +**A newsletter a human writes stays a person** with reach `broadcast` (owner, 2026-11-25). The owner can answer the author, and the author may be someone the owner also writes to directly. A company's newsletter sent through a mailing service is a bot. @@ -189,12 +189,11 @@ after the headers and the address, and it is matched on both the `From` domain a ## Open questions -1. **A newsletter a human writes.** A person with reach `broadcast` (this plan), or a bot like a company's newsletter? -2. **Tab names.** People / Subscriptions / Bots / Organizations (RU: Люди / Подписки / Боты / Организации). Are four +1. **Tab names.** People / Subscriptions / Bots / Organizations (RU: Люди / Подписки / Боты / Организации). Are four tabs right, or should Bots sit inside Organizations? -3. **Reach of a mixed sender.** Someone who writes to the owner directly and also sends a newsletter: one sender with +2. **Reach of a mixed sender.** Someone who writes to the owner directly and also sends a newsletter: one sender with reach `direct`, or two senders split by address? -4. **Discussion lists.** A mailing list where people answer each other: are its members People (reach `group`) or +3. **Discussion lists.** A mailing list where people answer each other: are its members People (reach `group`) or one Subscription? Until answered: a `List-Id` with three or more distinct senders is `group`. -5. **Where the domain lists live.** Built into the package at release (no network at run time), or downloaded once by +4. **Where the domain lists live.** Built into the package at release (no network at run time), or downloaded once by a `models`-style command the owner runs? From 3b869bb34fe79e4cf228684bf86a38ae99e9bd4b Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 02:41:53 +0100 Subject: [PATCH 04/16] docs(people): mark the signals step built in #3334 Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index c5b8e355e..a7949f870 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -1,6 +1,6 @@ # Plan: who sent it and how it reached you -Status: draft for review. The bug fixes (step 1) are built; the rest is not. It answers the RFC in +Status: draft for review. Steps 1 and 2 are built; the rest is not. It answers the RFC in [#3314](https://github.com/WireCatLabs/cli-core/issues/3314) and replaces its proposal. ## The problem @@ -175,10 +175,12 @@ after the headers and the address, and it is matched on both the `From` domain a 2. Signals with no store change: mail sync reads `Auto-Submitted`, `List-Unsubscribe-Post` and `Feedback-ID` into the stored headers (today [`mail/headers.ts`](../../../src/mail/headers.ts) reads `LIST-ID`, `LIST-UNSUBSCRIBE`, `PRECEDENCE`), trusted only under a passed DKIM signature of the `From` domain; `reach` is worked out from - `email_recipients` for the page a list returns. Strong program signals already feed today's `automated`. + `email_recipients` for the page a list returns. Strong program signals already feed today's `automated`. Built + in #3334. 3. Store: the `bots` table, `identities` pointing at a person or a bot, the move log, and `reach` and the marks kept like `kind` today (lazily, cleared by triggers). Identities that today make a person `automated` move to bots. - The migration takes the next free number after the 1.0 store (73, cli-core#3288). + The migration takes the next free number after the 1.0 store (73, cli-core#3288), and also indexes the + List-Id that #3334 reads for every page. 4. The owner's choice: move an identity to a person or a bot, for its whole history. 5. Organizations from domains, with the three exceptions above, then their `category` from the domain lists. 6. memo: `bots list`, and `people list` filters `reach:`, `tie:`. From 2fda82993385dc448f45f35eec7930c87172ad9e Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 04:33:04 +0100 Subject: [PATCH 05/16] docs(people): record the first form of sender bots built in #3339 Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index a7949f870..2fb0c77fe 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -1,6 +1,6 @@ # Plan: who sent it and how it reached you -Status: draft for review. Steps 1 and 2 are built; the rest is not. It answers the RFC in +Status: draft for review. Steps 1 to 4 are built, step 3 in a first form (below); the rest is not. It answers the RFC in [#3314](https://github.com/WireCatLabs/cli-core/issues/3314) and replaces its proposal. ## The problem @@ -51,6 +51,11 @@ proposed as "the same person", cannot be a task's assignee and never counts as s A bot has a name, its identities and an optional organization. It has no ties, no tasks and no merge review: two bots of one organization are grouped under it, not merged. +**Built so far (#3339, store version 74).** A bot is a `sender_bots` row anchored on one person, and its identities +stay on that person, so ingest, merges and `person:` references keep working. A bot is always listed as +`automated`. This is the plan's separation in a first form: lists still tell bots apart by kind. The full form gives +a bot its own reference (`bot:`) and moves its identities off the person; memo and Desktop change with it. + **Moving between entities.** A rule can be wrong, so an identity can move from a person to a bot and back. Its messages stay where they are (they point at the identity), the move is logged, and the owner's choice always wins over the rules. @@ -179,9 +184,10 @@ after the headers and the address, and it is matched on both the `From` domain a in #3334. 3. Store: the `bots` table, `identities` pointing at a person or a bot, the move log, and `reach` and the marks kept like `kind` today (lazily, cleared by triggers). Identities that today make a person `automated` move to bots. - The migration takes the next free number after the 1.0 store (73, cli-core#3288), and also indexes the - List-Id that #3334 reads for every page. -4. The owner's choice: move an identity to a person or a bot, for its whole history. + Built in #3339 as `sender_bots` anchored on a person (store version 74), with the move log and the List-Id + index; the full split is open (question 5). +4. The owner's choice: move an identity to a person or a bot, for its whole history. Built in #3339 as + `PeopleStore.moveToBot` and `moveToPerson`; memo has no command for it yet. 5. Organizations from domains, with the three exceptions above, then their `category` from the domain lists. 6. memo: `bots list`, and `people list` filters `reach:`, `tie:`. 7. Desktop: four tabs and their filters; this closes @@ -199,3 +205,5 @@ after the headers and the address, and it is matched on both the `From` domain a one Subscription? Until answered: a `List-Id` with three or more distinct senders is `group`. 4. **Where the domain lists live.** Built into the package at release (no network at run time), or downloaded once by a `models`-style command the owner runs? +5. **The full split of bots.** Give a bot its own `bot:` reference and move its identities off the person (memo and + Desktop change), or keep the person-anchored form of #3339? From 0829632bb0e45e691cf555cda362e70a41d8ba4d Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 05:21:10 +0100 Subject: [PATCH 06/16] docs(people): organizations from domains built in #3347 Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index 2fb0c77fe..bf51ea07d 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -1,6 +1,6 @@ # Plan: who sent it and how it reached you -Status: draft for review. Steps 1 to 4 are built, step 3 in a first form (below); the rest is not. It answers the RFC in +Status: draft for review. Steps 1 to 5 are built, step 3 in a first form (below); the rest is not. It answers the RFC in [#3314](https://github.com/WireCatLabs/cli-core/issues/3314) and replaces its proposal. ## The problem @@ -188,7 +188,8 @@ after the headers and the address, and it is matched on both the `From` domain a index; the full split is open (question 5). 4. The owner's choice: move an identity to a person or a bot, for its whole history. Built in #3339 as `PeopleStore.moveToBot` and `moveToPerson`; memo has no command for it yet. -5. Organizations from domains, with the three exceptions above, then their `category` from the domain lists. +5. Organizations from domains, with the three exceptions above (built in #3347: `From` domain only, no `List-Id` + grouping yet), then their `category` from the domain lists. 6. memo: `bots list`, and `people list` filters `reach:`, `tie:`. 7. Desktop: four tabs and their filters; this closes [desktop#319](https://github.com/WireCatLabs/wirecat-desktop/issues/319) (bot filter) and touches From 4a57c9e7ab7859ca87660eeb5790b4c325ee6752 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 06:25:39 +0100 Subject: [PATCH 07/16] docs(people): organization sectors from Wikidata built in #3350 #3350 stores the sector in organization metadata as `sector`, since `category` already means client, supplier or partner. #3349 made the throwaway-domain check one prebuilt set. Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index bf51ea07d..ec492f7b7 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -143,14 +143,15 @@ is automatic and never goes to merge review. Three exceptions: ### Domain lists A domain list can also give an organization its purpose: bank, shop, airline, news, government. This becomes a -`category` on the organization, and a filter on the Bots and Organizations tabs. +`sector` on the organization (`category` already means client, supplier or partner), and a filter on the Bots and +Organizations tabs. Only lists downloaded whole and matched on the owner's computer qualify. A lookup per sender (a DNS blocklist, a category API) tells a third party who writes to the owner. Checked on 2026-11-24: | Source | Gives | Licence | Use | |---|---|---|---| -| [Wikidata](https://www.wikidata.org/wiki/Wikidata:Database_download) | Banks, airlines, companies, media, government with their official website ([P856](https://www.wikidata.org/wiki/Property:P856)): about 4,000 banks and 2,800 airlines with a website | CC0 | Extract `domain → category` from the dump at release; only the preferred website with no end date | +| [Wikidata](https://www.wikidata.org/wiki/Wikidata:Database_download) | Banks, airlines, companies, media, government with their official website ([P856](https://www.wikidata.org/wiki/Property:P856)): about 4,000 banks and 2,800 airlines with a website | CC0 | Extract `domain → category` from the dump at release; the best-ranked home page (bare domain or `www`) with no end date | | [UT1 lists](https://github.com/olbat/ut1-blacklists) | `bank`, `financial`, `shopping`, `press`, `social_networks`, `webmail` domain lists | CC BY-SA 4.0 | Ship as a separate file with credit, never merged into our data, so share-alike stays on that file | | [disposable-email-domains](https://github.com/disposable-email-domains/disposable-email-domains) | Throwaway mail domains | CC0 | With `FREE_MAIL`: never an organization | | [Public Suffix List](https://publicsuffix.org/list/) | Registrable domains | MPL 2.0 | Grouping under an organization | @@ -189,7 +190,9 @@ after the headers and the address, and it is matched on both the `From` domain a 4. The owner's choice: move an identity to a person or a bot, for its whole history. Built in #3339 as `PeopleStore.moveToBot` and `moveToPerson`; memo has no command for it yet. 5. Organizations from domains, with the three exceptions above (built in #3347: `From` domain only, no `List-Id` - grouping yet), then their `category` from the domain lists. + grouping yet), then their sector from the domain lists (built in #3350 from Wikidata only, as `sector` in the + organization's metadata: `category` already means client, supplier or partner; UT1 not shipped; DKIM signing + domain not matched yet; a sector is never cleared). #3349 made the throwaway-domain check one prebuilt set. 6. memo: `bots list`, and `people list` filters `reach:`, `tie:`. 7. Desktop: four tabs and their filters; this closes [desktop#319](https://github.com/WireCatLabs/wirecat-desktop/issues/319) (bot filter) and touches From 4dd3a902020481866f3c92f09e18a49f1a2a9d0a Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 10:20:39 +0100 Subject: [PATCH 08/16] docs(people): review on #3323, reach in ranking and the three-tab option Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index ec492f7b7..216d137fc 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -67,6 +67,9 @@ over the rules. | `reach` | `direct` · `group` · `broadcast` | How their messages reached the owner, the widest the owner gets most. `direct`: to the owner, or a small group. `group`: a large chat or a discussion list where everyone can write. `broadcast`: one sender to many readers who cannot answer in place: a newsletter, a channel, marketing mail. | | `tie` | yes · no | The owner knows them: the ties `person-ties.ts` already works out. Always no for a bot. | +`reach` also weighs search: a `direct` hit ranks above a `broadcast` one in `search all`, and `broadcast` mail never +feeds `tie`. For that it is worked out per message, not only per sender (review on #3323). + Data quality is not a kind. These become marks on the row: `owner`, `incomplete` (no name, or a deleted account), `test`. @@ -202,7 +205,10 @@ after the headers and the address, and it is matched on both the `From` domain a ## Open questions 1. **Tab names.** People / Subscriptions / Bots / Organizations (RU: Люди / Подписки / Боты / Организации). Are four - tabs right, or should Bots sit inside Organizations? + tabs right, or should Bots sit inside Organizations? Proposed in review: three tabs (People, Bots, Organizations), + with Subscriptions a filter, since a subscription is a way of delivery, not a sender, and one bot (a shop) sends + both receipts and promotions, so a tab per sender splits its mail badly. People then needs the same filter, or + newsletter authors fill it again. 2. **Reach of a mixed sender.** Someone who writes to the owner directly and also sends a newsletter: one sender with reach `direct`, or two senders split by address? 3. **Discussion lists.** A mailing list where people answer each other: are its members People (reach `group`) or From 6a516cbd91dd3c42b9dee1d59f3c94b1b9e6fc3a Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 12:00:08 +0100 Subject: [PATCH 09/16] docs(people): tabs are views over per-mail categories, full bot split decided Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index 216d137fc..55d0520c1 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -79,6 +79,11 @@ mailing service is a bot. ### What the screen shows +A tab is a filtered view, not a table (owner, 2026-11-25). How rows are stored never decides what a tab may show: +Subscriptions can list any mail under any filter. A mail gets its own category, apart from its sender, so one shop's +receipts and promotions land in different places. Rules and the owner's corrections work on two levels, the address +and the domain: a person rarely writes from a newsletter address, but may write from the same domain. + | Tab | Who | Filters inside | |---|---|---| | **People** | persons, reach `direct` or `group` | Known (tie) · Not known (no tie, today's Strangers) | @@ -208,12 +213,13 @@ after the headers and the address, and it is matched on both the `From` domain a tabs right, or should Bots sit inside Organizations? Proposed in review: three tabs (People, Bots, Organizations), with Subscriptions a filter, since a subscription is a way of delivery, not a sender, and one bot (a shop) sends both receipts and promotions, so a tab per sender splits its mail badly. People then needs the same filter, or - newsletter authors fill it again. + newsletter authors fill it again. Answer (owner, 2026-11-25): tabs are views over per-mail categories, so four + tabs stay and a shop's mail splits by category, not by sender. 2. **Reach of a mixed sender.** Someone who writes to the owner directly and also sends a newsletter: one sender with reach `direct`, or two senders split by address? 3. **Discussion lists.** A mailing list where people answer each other: are its members People (reach `group`) or one Subscription? Until answered: a `List-Id` with three or more distinct senders is `group`. 4. **Where the domain lists live.** Built into the package at release (no network at run time), or downloaded once by a `models`-style command the owner runs? -5. **The full split of bots.** Give a bot its own `bot:` reference and move its identities off the person (memo and - Desktop change), or keep the person-anchored form of #3339? +5. ~~The full split of bots.~~ Decided (owner, 2026-11-25): a bot is its own entity with its own table and `bot:` + reference; the person-anchored form of #3339 is replaced. From 490bc17d1311ba0aaf62a32fd458d74683a41ab6 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 12:13:03 +0100 Subject: [PATCH 10/16] docs(people): mail categories per mail, research on mail products and domain sources Adds two research notes beside the plan (how mail products sort mail; a catalogue of domain sources with licences) and a Mail categories section: a type per mail, a sector per sender, rules by mail, list, address and domain, scoped corrections. Records the owner's answers on tabs and on mixed senders, and adds the paid-product question. Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 31 +- ...2026-11-25-contact-kinds-domain-sources.md | 253 +++++++++ .../2026-11-25-contact-kinds-mail-products.md | 495 ++++++++++++++++++ 3 files changed, 778 insertions(+), 1 deletion(-) create mode 100644 docs/dev/plans/2026-11-25-contact-kinds-domain-sources.md create mode 100644 docs/dev/plans/2026-11-25-contact-kinds-mail-products.md diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index 55d0520c1..baf947955 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -177,6 +177,32 @@ A domain names the organization, not the sender. A person at `bank.example` is a bot. Mail sent through a sending platform never takes the platform's category. So the domain is the last signal, after the headers and the address, and it is matched on both the `From` domain and the DKIM signing domain. +### Mail categories + +Every mail gets a type of its own; the sender gets a sector. A card payment works the same way: the shop's merchant +code says what the shop is, the bank's category says what the payment was. Research: +[mail products](2026-11-25-contact-kinds-mail-products.md), [domain sources](2026-11-25-contact-kinds-domain-sources.md). + +- **Type, per mail**, first match wins: bounce or auto-reply, security (codes, sign-in alerts), calendar, travel, + ticket, order, shipping, bill, account notice, social notification, discussion list, newsletter, promotion, system + alert, personal, other. Signals are already in the mail: `Auto-Submitted`, `List-Id`, `List-Unsubscribe-Post`, + `Feedback-ID`, schema.org markup (Order, ParcelDelivery, FlightReservation, Invoice), a calendar or report part, + and whether the owner wrote to the sender. Zero's header classifier (MIT, 82 lines) is the model to port. +- **The sender's view is a summary of its mails.** A shop that sends receipts and promotions appears under Bots and + under Subscriptions; `reach` is worked out per mail too. +- **Rules in a fixed order:** one mail, then a list or a subject pattern, then the address, then the domain, then the + header classifier. The owner's rule beats a rule's guess; within a level the newest wins. A domain rule is refused + for a free-mail domain and the address is offered instead, as HEY does. +- **A correction asks its scope:** this mail, this address, this domain or this list, and whether to apply it to past + mail (Outlook's "Move" and "Always move"). +- **Screening first-time senders**, as HEY does, only for people the owner has never written to. Later step. + +The domain lists above grow from the catalogue: UT1 (about 100 categories), the OpenStreetMap brand index, FDIC +banks, the GLEIF bank codes joined to Wikidata, a free-mail list. Spam lists say "bad", never a sector, and many are +non-commercial or work only as a lookup per sender, which this plan rules out. Distribution: a small core in the +package, a versioned data pack from a WireCat release fetched by a command for larger and share-alike lists, so data +updates without a package release. Both wait on the owner (open questions 4 and 6). + ## Out of scope - **AI classification.** Sorting by a model is planned as a separate command with its own plan. This plan keeps the @@ -216,10 +242,13 @@ after the headers and the address, and it is matched on both the `From` domain a newsletter authors fill it again. Answer (owner, 2026-11-25): tabs are views over per-mail categories, so four tabs stay and a shop's mail splits by category, not by sender. 2. **Reach of a mixed sender.** Someone who writes to the owner directly and also sends a newsletter: one sender with - reach `direct`, or two senders split by address? + reach `direct`, or two senders split by address? Answer (owner, 2026-11-25): one person, `reach` per mail. A person + rarely writes from a newsletter address, so rules work by address first and by domain second. 3. **Discussion lists.** A mailing list where people answer each other: are its members People (reach `group`) or one Subscription? Until answered: a `List-Id` with three or more distinct senders is `group`. 4. **Where the domain lists live.** Built into the package at release (no network at run time), or downloaded once by a `models`-style command the owner runs? 5. ~~The full split of bots.~~ Decided (owner, 2026-11-25): a bot is its own entity with its own table and `bot:` reference; the person-anchored form of #3339 is replaced. +6. **Paid product.** Will WireCat ever be sold? If so, non-commercial lists (Stop Forum Spam, DuckDuckGo Tracker + Radar, abuse.ch for commercial use) are out now. diff --git a/docs/dev/plans/2026-11-25-contact-kinds-domain-sources.md b/docs/dev/plans/2026-11-25-contact-kinds-domain-sources.md new file mode 100644 index 000000000..cfe6c8bba --- /dev/null +++ b/docs/dev/plans/2026-11-25-contact-kinds-domain-sources.md @@ -0,0 +1,253 @@ +# Domain and mail-category sources for WireCat + +Checked 2026-11-25. Labels follow the product rules: + +- **observed**: read on the official page or in real output on that date; +- **interpretation**: our reading of what it means for WireCat; +- **hypothesis**: from memory or a blog, not checked. + +"Not checked" means the official page failed or gave no answer. + +## Short answers + +- **Q1 (FIND-1).** Only a few downloadable sources say *what kind* of organization a domain is: + - Wikidata (CC0); + - UT1 (CC BY-SA, about 100 categories, including `bank`, `shopping`, `press`, `webmail`, `social_networks`); + - NSI (brand to Wikidata); + - GLEIF BIC→LEI (banks); + - FDIC (US banks); + - Hagezi and StevenBlack (social, gambling only); + - free-mail lists. + + Spam and abuse lists only add a "risky" flag. The best of them either forbid commercial use (Stop Forum Spam) or need a per-user key (abuse.ch, Spamhaus files). No public list exists for Gmail or Yahoo bulk senders, ESP sending domains or BIMI domains. We would have to build those ourselves at build time. +- **Q2 (FIND-2).** Card networks classify the *merchant* (MCC). Aggregators classify each *transaction* (Plaid: 16 primary / 104 detailed categories). The same split fits mail: + - **sector** per sender, from the lists above; + - **message type** per message, from headers and markup that are already in the message. Examples: `Auto-Submitted`, `List-Id`, `List-Unsubscribe-Post`, `Feedback-ID`, schema.org JSON-LD, `text/calendar`, `multipart/report`. + + The proposed taxonomy is in [Q2](#q2-card-payments-and-mail-categories). +- **Q3 (FIND-3).** Use a hybrid: + - bundle a small permissive core: Wikidata, PSL, free-mail; + - ship a versioned **data pack** for share-alike and large sets, downloaded by a command, with a checksum and per-source licences; + - lists that forbid redistribution are fetched by the user's own command straight from upstream. + +## Q1. Catalogue of domain sources + +### Rule that decides most rows: build-time vs. runtime (FIND-4) + +- **Runtime, on the owner's machine:** + - whole-file downloads only; + - **never** a per-sender query (DNSBL, enrichment API, Safe Browsing `hashes.search`), because even a hash prefix tells the provider who writes to the owner. +- **Build time, in WireCat's own pipeline (interpretation):** an API call about a *fixed public domain set* leaks nothing about the owner. Examples are the Tranco top 1M, every Wikidata org, and every BIMI record in the top 1M. This is how we fill the gaps where no public list exists (ESP, BIMI, bulk senders), as long as the source's terms allow the use. + +### Column legend + +- **Whole?** The source can be downloaded whole, so it is privacy-OK at runtime. +- **Comm.** Commercial use: yes / no / unclear. +- **SA** Share-alike or copyleft. A bundle that merges this data inherits the obligation. +- **Redist.** We may ship the data inside our package or pack. + +### A. Company and organization registries (sector signal) + +| Source | Gives | Size | Licence | Comm. | SA | Redist. | Updates | Whole? | Category granularity | Link | +|---|---|---|---|---|---|---|---|---|---|---| +| **Wikidata** (P856 website, P452 industry, P31 instance of, P1278 LEI, P2627 BIC) | org → website, industry, type, LEI/BIC | our extract 25,639 domains; full dump is tens of GB (hypothesis) | CC0 (observed) | yes | no | yes | continuous; weekly dumps | yes (dumps, SPARQL at build time) | free-form classes; needs our own mapping to sectors | [licensing](https://www.wikidata.org/wiki/Wikidata:Licensing) | +| **GLEIF LEI** (Level 1/2) | legal entities, legal form, address | about 2.5M+ LEIs (hypothesis) | CC0 for Access Service data (observed) | not stated on page; CC0 implies yes | no | yes | daily (hypothesis) | yes (golden copy) | none; **no website field** (observed: mapping page lists no domain mapping) | [terms](https://www.gleif.org/en/meta/lei-data-terms-of-use) | +| **GLEIF BIC→LEI mapping** | which LEIs are banks / financial institutions (they hold a SWIFT BIC) | not checked | free of charge, licence not named on page (observed) | unclear | no | unclear | monthly (hypothesis) | yes | "has a BIC" = financial | [mappings](https://www.gleif.org/en/lei-data/lei-mapping) | +| **OpenCorporates** | ~200M companies from registries (hypothesis) | — | ODbL; attribution link required; non-share-alike licence is paid (observed) | only paid, or free for "Permitted Users" (journalists, NGOs, academics) | **yes** | only under ODbL | quarterly/monthly bulk (search summary, not checked) | bulk only by contract; scraping forbidden (observed) | industry codes from some registries; websites rarely present (hypothesis) | [terms](https://opencorporates.com/terms-of-use-2/) | +| **Crunchbase Open Data Map** | company → homepage, category | — | — | — | — | — | — | **not checked**: the ODM docs page returns 404; hypothesis: discontinued | — | [old URL, 404](https://data.crunchbase.com/docs/open-data-map) | +| **name-suggestion-index (NSI)** | brands, operators, transit, flags for OSM, each with `brand:wikidata` and an OSM tag (e.g. `amenity=bank`, `shop=*`) | not stated | BSD-3 repo licence (observed) | yes | no | yes | frequent releases (hypothesis) | yes (git) | OSM tags: bank, fuel, fast food, supermarket… Join to Wikidata P856 for the domain | [repo](https://github.com/osmlab/name-suggestion-index) | +| **FDIC BankFind** | all US FDIC-insured banks with `WEBADDR` | 4,204 active institutions (observed: API `totals.count`, index built 2026-11-24) | US government data; no licence on page (hypothesis: public domain) | likely yes | no | likely yes | index rebuilt daily (observed timestamp) | yes (API pages; no key needed) | bank | [API docs](https://api.fdic.gov/banks/docs) | +| **SWIFT BIC directory (SWIFTRef)** | all BICs, some with addresses | — | paid subscription (hypothesis) | paid | — | no | monthly (hypothesis) | paid only | bank | not checked | +| **Central-bank / EBA / ECB registers** | licensed credit institutions per country | — | varies | varies | — | varies | — | mostly yes (CSV) | bank, payment, e-money institution | not checked. Hypothesis: few carry websites, so the join goes via name→Wikidata | +| **DMOZ / Curlie** | human directory: site → category tree | DMOZ last dump 2017; content.rdf ~1.2 GB (forum, opinion) | DMOZ: CC BY 3.0 per the Internet Archive label; **conflicting claims** (hypothesis) | unclear | no | unclear | frozen (DMOZ); Curlie gives no dump (not checked) | archive copy only | deep topic tree, but stale since 2017 | [archive copy](https://archive.org/details/dmoz-rdf-20150327) | +| **Common Crawl web graph** | host- and domain-level graphs and ranks | not on page; stats on [graph stats](https://commoncrawl.github.io/cc-webgraph-statistics/) | Common Crawl ToU (not checked) | likely yes (hypothesis) | no | — | rolling 3-month releases, newest cc-main-2026-aug-sep-oct (observed) | yes | **none**: popularity only | [web graphs](https://commoncrawl.org/web-graphs) | +| **Tranco** | top 1M registrable domains | 1M | no own licence; inputs include Cloudflare Radar **CC BY-NC 4.0** and CrUX CC BY-SA (observed) | unclear (NC input) | partly | unclear | daily (observed) | yes (`/top-1m.csv.zip`) | none: popularity only. Use it as the build-time domain set and as a "big site" prior | [site](https://tranco-list.eu/) | +| **DuckDuckGo Tracker Radar** | third-party domain → owner entity, categories | not stated | **CC BY-NC-SA 4.0** (observed) | **no** (contact DDG) | yes | no | not stated | yes | entity (owner company) + tracker categories | [repo](https://github.com/duckduckgo/tracker-radar) | +| **Disconnect tracking lists** | services.json (category → company → domains), entities.json | not stated | **CC BY-NC-SA 4.0** (observed) | **no** (licence by email) | yes | no | not stated | yes | Advertising, Analytics, Social, Content… An "Email" category exists (hypothesis: ESP tracking domains) | [repo](https://github.com/disconnectme/disconnect-tracking-protection) | + +### B. Category blocklists (some carry sector) + +**Subdomain trap (RISK-1).** Ad and tracker lists name hostnames, such as `click.mail.brand.com`. If we cut these down to the registrable domain with the PSL, a real brand gets tagged "ads". So: + +- match exact hostnames only; +- collapse to the domain only for lists that are domain-wide by design (UT1 `bank`, NSI); +- use tracker and ad lists on **links and pixels in the body**, as a marketing signal, not on the sender. + +| Source | Gives | Size | Licence | Comm. | SA | Redist. | Updates | Whole? | Granularity | Link | +|---|---|---|---|---|---|---|---|---|---|---| +| **UT1 (Univ. Toulouse Capitole)** | ~100 categories of domains/URLs | e.g. bank 6,646 · shopping 36,971 · press 4,645 · financial 473 · social_networks 716 · webmail 413. All categories sum to about 5.8M (observed on the GitHub mirror; the official site returned HTTP 503, so the counts may mix domains and URLs) | **CC BY-SA 4.0** (observed, mirror) | yes | **yes** | yes, under BY-SA | daily (mirror syncs daily) | yes (tar.gz, rsync, git mirror) | **best sector granularity among free lists** | [official](https://dsi.ut-capitole.fr/blacklists/index_en.php) (503 on 2026-11-25) · [mirror](https://github.com/olbat/ut1-blacklists) | +| **Shallalist** | — | — | — | — | — | — | dead | — | — | forum posts only (opinion): users point to UT1 as the replacement. [Netgate forum](https://forum.netgate.com/post/1039094) | +| **Hagezi** | ads/trackers (Light…Ultimate), TIF threat feed, categories | Ultimate 289,080 · TIF 968,880 · Social 8,336 · Gambling 697,917 · NSFW 81,400 · Fake 10,331 · URL shortener 9,580 · Dynamic DNS 1,496 · NRD 2.4–3.0M per 7-day band (observed) | **GPL-3.0** (observed) | yes | **yes** (licence must travel with it) | yes, with licence | daily 11:00 UTC; mirror every 4–8 h (observed) | yes | social, gambling, NSFW, fake, shortener, DDNS, newly registered | [repo](https://github.com/hagezi/dns-blocklists) | +| **StevenBlack hosts** | adware+malware base; extensions | base 81,676 · social 3,808 · gambling 6,744 · porn 76,811 · fakenews 2,187 (observed) | MIT repo, but **upstreams include CC BY-NC-SA and "non-commercial with attribution"** (observed) | **unclear** for the merged files | partly | risky | no fixed schedule (observed) | yes | social, gambling, porn, fakenews | [repo](https://github.com/StevenBlack/hosts) | +| **OISD** | big (ads, phishing, malware, tracking), nsfw | not on page | **no licence stated** (observed): treat as all rights reserved | unclear | — | **no** | hourly-ish (observed "updated N min ago") | yes | ads/malware vs. NSFW | [site](https://oisd.nl/) | +| **The Blocklist Project** | 18 lists: abuse, ads, crypto, drugs, facebook, fraud, gambling, malware, phishing, piracy, porn, ransomware, redirect, scam, tiktok, torrent, tracking, twitter | not on page | Unlicense (observed) | yes | no | yes | **archived 2026-10-27, read-only** (observed) | yes | coarse vice / threat categories | [repo](https://github.com/blocklistproject/Lists) | +| **1Hosts** | Lite / Xtra ad and tracker lists | not on page | MPL-2.0 (observed) | yes | file-level | yes | frequent (observed for DNS resellers) | yes | none (ads/trackers) | [repo](https://github.com/badmojr/1Hosts) | +| **Firebog** | curated index of other lists (suspicious, advertising, tracking, malicious, other) | — | none stated; each list has its own terms (observed) | per list | per list | per list | — | yes | index only | [site](https://firebog.net/) | + +### C. Spam and abuse lists: these say "bad", not "what kind" + +They add a risk flag only and never set a sector. When they conflict with section A or B, sector comes from A/B and risk comes from C. A bank domain on a phishing list most likely means a look-alike host; check the exact hostname first. + +| Source | Gives | Size | Licence / terms | Comm. | Whole download? | Updates | Privacy-OK at runtime | Link | +|---|---|---|---|---|---|---|---|---| +| **Spamhaus DROP / ASN-DROP** | hijacked IP ranges and ASNs (**IPs, not domains**) | not checked | free "regardless of size or business type"; credit Spamhaus and keep the © text (observed) | yes | yes (JSON) | re-evaluated daily; fetch at most hourly (observed) | yes | [DROP](https://www.spamhaus.org/blocklists/do-not-route-or-peer/) | +| **Spamhaus DBL** (domains) | spam/phish/malware domains | — | free DNS queries only for "low-volume, non-commercial"; commercial = annual subscription (observed) | paid | DNS query only for free use; rsync files are a paid product (observed: no free tier for rsync) | real-time | **no** for the DNS query; yes only via paid rsync | [DBL](https://www.spamhaus.org/blocklists/domain-blocklist/) · [data access](https://www.spamhaus.com/data-access/) | +| **abuse.ch URLhaus / ThreatFox** | malware URLs; hostfile of domains (Tranco top 1M excluded) | not checked | auth key per user; free for not-for-profit; commercial "may require a paid subscription" via Spamhaus (observed) | paid | yes, with key | CSV every 5 min (observed) | yes, but each user needs their own key | [terms](https://abuse.ch/terms-of-use/) · [API](https://urlhaus.abuse.ch/api/) | +| **abuse.ch Feodo Tracker, SSL Blacklist** | botnet C2 IPs, bad TLS certificates | — | **CC0** (observed) | yes | yes | frequent | yes | [terms](https://abuse.ch/terms-of-use/) | +| **PhishTank (Cisco)** | verified phishing URLs | not checked | Cisco EULA, not summarised on page (observed) | unclear | yes (JSON/CSV/XML, gz) | hourly (observed) | yes | [developer info](https://phishtank.org/developer_info.php) | +| **OpenPhish Community** | phishing URLs ("limited") | not stated | ToU acceptance required; commercial use not stated (observed) | unclear | yes (text) | every 12 h (observed) | yes | [feeds](https://openphish.com/phishing_feeds.html) | +| **Stop Forum Spam** | toxic domains (exact and partial), spammer domains CSV, IPs | not checked | "Your use of this data and supporting software is **non-commercial**" (observed, legal page) | **no** | yes; 2–3 downloads per IP per day (observed) | daily (observed) | yes | [downloads](https://www.stopforumspam.com/downloads) | +| **Hagezi TIF** | threat-intel domains | 968,880 (observed) | GPL-3.0 | yes | yes | daily | yes | see section B | +| **Google Safe Browsing v5** | malware/phishing hash lists, "Global Cache" of likely-safe sites | — | **non-commercial only**; Web Risk API for commercial use (observed) | no | hash lists yes; `hashes.search` sends a 4-byte prefix (observed) | — | local list mode only | [reference](https://developers.google.com/safe-browsing/reference) | + +### D. Mail-specific lists + +| Need | Public list? | What exists | Our option | +|---|---|---|---| +| ESP / sending-platform domains and IPs | **No official list found** (gap) | ESPs publish their own SPF includes and DKIM domains (hypothesis) | A hand-made table of about 50 ESPs (SendGrid, Mailchimp/Mandrill, SES, Postmark, Mailgun, Braze, Iterable, Klaviyo…), matched on the DKIM `d=`, the Return-Path domain or the `Received` host **of the message itself**, so no lookup is needed. Their presence = "sent by a platform", and a hint toward bulk. | +| Gmail / Yahoo bulk senders | **No**: neither page has or references a list (observed) | rules only: ≥5,000/day to Gmail, SPF+DKIM+DMARC, one-click unsubscribe, spam rate <0.3% ([Gmail](https://support.google.com/a/answer/81126), [Yahoo](https://senders.yahooinc.com/best-practices/)) | Detect *compliance* in the message: `List-Unsubscribe-Post: List-Unsubscribe=One-Click` means a marketing/subscribed stream (observed requirement). | +| BIMI domains | **No public list** (the BIMI Group page names none; observed) | BIMI is a DNS TXT record at `default._bimi.`; VMC/CMC certificates go to CT logs (hypothesis) | Build time: query BIMI for the Tranco top 1M (public set, no owner data) → "verified brand with logo". Runtime: read the `BIMI-Location` / `BIMI-Indicator` header if the receiving server added it. | +| Free-mail providers | yes | **Kikobeats/free-email-domains**: 30,000+ free and disposable domains, MIT, rebuilt daily, includes the HubSpot list (observed). **UT1 `webmail`** 413. Thunderbird ISPDB: provider configs for big ISPs (licence not stated, observed) | Bundle Kikobeats (MIT). It already overlaps with disposable-email-domains. | +| Disposable | yes (already used) | disposable-email-domains | keep | + +### E. Bank-specific recipe (IDEA-1) + +1. **US:** FDIC `WEBADDR` (4,204 active banks, observed) → registrable domain via PSL. +2. **World:** + - take the GLEIF BIC→LEI mapping (free); + - join to Wikidata on P1278 (LEI) or P2627 (BIC); + - read P856 (website). + + Every LEI with a BIC is a financial institution. Wikidata supplies the domain where it has one. +3. **Gap fill:** UT1 `bank` (6,646, BY-SA). It goes in the data pack because of share-alike. +4. **SWIFT's own directory** is paid (hypothesis, not checked), so skip it. + +### Which sources to take (interpretation) + +| Priority | Source | Why | Where | +|---|---|---|---| +| 1 | Wikidata (extend: P452 industry, P31 type, LEI/BIC joins) | CC0, already in use | bundle | +| 1 | Kikobeats free-email-domains | MIT, fills "person on free-mail vs. org" | bundle | +| 1 | NSI → Wikidata join | BSD, adds OSM sector tags to brands | bundle | +| 1 | FDIC + GLEIF BIC→LEI | banks, free | bundle (small) | +| 2 | UT1 (bank, shopping, press, webmail, social_networks, financial + others) | best free sector lists | data pack (BY-SA) | +| 2 | Hagezi social / gambling / NSFW / TIF | daily, GPL | data pack (GPL text included) | +| 2 | Spamhaus DROP, abuse.ch Feodo/SSLBL | free, whole files | data pack | +| 3 | abuse.ch URLhaus/ThreatFox, PhishTank, OpenPhish | need key / unclear terms | user command fetches upstream directly | +| ✗ | Stop Forum Spam, DDG Tracker Radar, Disconnect, Safe Browsing, Cloudflare Radar | non-commercial | skip unless WireCat stays non-commercial | +| ✗ | Spamhaus DBL, any DNSBL, enrichment APIs | per-sender lookup | never at runtime | +| ✗ | OISD | no licence | skip | +| ✗ | Blocklist Project | archived 2026-10-27 | skip, or freeze a copy (Unlicense) | +| ✗ | OpenCorporates | ODbL plus paid bulk, few websites | skip | + +## Q2. Card payments and mail categories + +### How finance does it + +| System | Classifies | Granularity | Notes | +|---|---|---|---| +| **MCC** (ISO 18245, assigned by card networks) | the **merchant**, once, at onboarding | 4-digit codes, several hundred (hypothesis; the ISO page returned 403) | Coarse and often wrong for marketplaces (hypothesis). Analogue for us: **sector per sender domain**. | +| **Plaid Personal Finance Category** | each **transaction** | 16 primary / 104 detailed (observed, [CSV](https://plaid.com/documents/transactions-personal-finance-category-taxonomy.csv)) | primaries: INCOME, TRANSFER_IN/OUT, LOAN_PAYMENTS, BANK_FEES, ENTERTAINMENT, FOOD_AND_DRINK, GENERAL_MERCHANDISE, HOME_IMPROVEMENT, MEDICAL, PERSONAL_CARE, GENERAL_SERVICES, GOVERNMENT_AND_NON_PROFIT, TRANSPORTATION, TRAVEL, RENT_AND_UTILITIES | +| **Ntropy** | each transaction: entities with roles (counterparty, intermediary), category per account-holder type and direction | category sets per holder type (observed, [docs](https://docs.ntropy.com/enrichment/introduction)) | Matches names against its own entity database. **Lesson:** separate the *intermediary* (Stripe, PayPal) from the *counterparty*. In mail this is ESP vs. brand. | +| **Tink, TrueLayer** | similar merchant + category enrichment | — | not checked 2026-11-25 | + +**What carries over (interpretation):** + +- Use two axes: + - **sector**: who the sender is, slow-changing, from lists; + - **message type**: what this mail is, from the message itself. +- Mark the intermediary. A mail signed by `sendgrid.net` but from `brand.com` belongs to `brand.com`; the ESP is the "intermediary". +- Every enrichment API is a per-item network call, so **taxonomy inspiration only**. We cannot use any of them. + +### Signals that already sit in the message (all local) + +| Signal | Source | What it says | +|---|---|---| +| `Auto-Submitted: auto-generated` / `auto-replied` | [RFC 3834](https://www.rfc-editor.org/rfc/rfc3834) (observed) | machine-sent / automatic reply; `no` or absent = maybe human | +| `List-Id` | RFC 2919 (hypothesis: not re-read) | mailing list or newsletter stream | +| `List-Unsubscribe` + `List-Unsubscribe-Post: List-Unsubscribe=One-Click` | RFC 2369 / 8058; required by Gmail and Yahoo for marketing and subscribed mail (observed) | marketing/subscribed. Its absence *weakly* points to transactional mail. | +| `Feedback-ID: a:b:c:SenderId` | Gmail Postmaster FBL (observed, [doc](https://support.google.com/a/answer/6254652)) | bulk stream from a large sender/ESP; the fields often name the campaign or type | +| `Precedence: bulk / list / junk` | legacy (hypothesis) | bulk | +| schema.org JSON-LD / microdata `@type` | [Gmail markup](https://developers.google.com/workspace/gmail/markup/overview) (observed: highlights for bus, car rental, flight, event, order, parcel delivery, hotel, invoice, restaurant, train) | exact type: FlightReservation, Order, ParcelDelivery, Invoice, EventReservation… | +| `text/calendar` part (METHOD REQUEST/CANCEL) | iCalendar | invite | +| `multipart/report` (delivery-status, disposition-notification) | RFC 3462/3464 (hypothesis) | bounce / read receipt | +| `In-Reply-To` / `References` to a message the owner sent; owner wrote to this address before | local history | conversation with a person | +| From local-part (`receipts@`, `noreply@`, `security@`, `news@`) | Gmail asks senders to keep one From address per category (observed) | type hint | +| Body: one-time codes, "sign-in", "password reset", amounts with currency, tracking numbers | local regex/model | security, bill, shipping | +| Tracker/ad hosts in links and pixels (Hagezi, 1Hosts) | section B | marketing | + +**Gmail's own split** (observed, [help](https://support.google.com/mail/answer/3094499)): + +- Primary; +- Social (social networks); +- Promotions (sales, discounts); +- Updates (receipts, alerts, statements, reminders); +- Forums (communities, mailing lists). + +This is coarse but well known to users. Map our types onto it so a user can compare. + +### Proposed message-type taxonomy (IDEA-2) + +Per message. Evaluate in this order; the first match wins. Sector is a separate field. + +| # | Type | Gmail tab | Strongest local signals | +|---|---|---|---| +| 1 | `bounce` / `auto_reply` | Updates | `multipart/report`; `Auto-Submitted: auto-replied`; MAILER-DAEMON | +| 2 | `security` (OTP, sign-in alert, password reset, 2FA) | Updates | short code in the body; local-part `security`/`no-reply`; sector bank/social/any; no List-Unsubscribe | +| 3 | `calendar` (invite, update, cancel) | Primary | `text/calendar` part | +| 4 | `travel` (flight, train, bus, hotel, car) | Updates | schema.org *Reservation; sector airline/travel | +| 5 | `event_ticket` | Updates | EventReservation | +| 6 | `order` (confirmation, receipt) | Updates | schema.org Order; amount + order number; sector shop | +| 7 | `shipping` | Updates | ParcelDelivery; tracking number; sector delivery | +| 8 | `bill` (invoice, statement, payment due, payment made) | Updates | schema.org Invoice; amount + due date; sector bank/telecom/utility/government | +| 9 | `account_notice` (terms change, service notice, account activity) | Updates | `Auto-Submitted: auto-generated`; no List-Unsubscribe-Post | +| 10 | `social_notification` | Social | sector social; `List-Unsubscribe` | +| 11 | `forum_list` | Forums | `List-Id` + `List-Post` (discussion list), many distinct human From addresses | +| 12 | `newsletter` | Promotions/Updates | `List-Id` / `List-Unsubscribe-Post`; sector news; long article body | +| 13 | `promotion` | Promotions | `List-Unsubscribe-Post`; `Feedback-ID`; ESP DKIM; tracker pixels; price/discount words | +| 14 | `system_alert` (monitoring, CI, cron) | Updates | `Auto-Submitted: auto-generated`; From a tool domain (GitHub, Sentry…) | +| 15 | `personal` | Primary | person sender (not bot/org), reply chain, owner wrote before | +| 16 | `other` | — | fallback | + +**Sector** (per sender, MCC-like): + +- keep the current 9 sectors: airline, bank, financial, telecom, social, shop, delivery, news, government; +- add, from UT1/NSI/Wikidata: `travel` (hotel, booking), `health`, `education`, `utility`, `insurance`, `software_saas`, `gaming_gambling`, `adult`, `freemail`. + +IAB Content Taxonomy 3.0 is the richer option if we ever need topics (observed that 3.0 exists; the repo names CC BY 3.0 for OpenRTB, and the taxonomy licence is unclear, [repo](https://github.com/InteractiveAdvertisingBureau/Taxonomies)). Google product taxonomy is for products in an order, not senders ([page](https://support.google.com/merchants/answer/6324436); licence not stated). Neither is needed for v1 (interpretation). + +## Q3. Distribution + +### How others do it + +| Who | Model | Fact | +|---|---|---| +| **tldts** (PSL) | compiled into the npm package; updates = new npm release | v7.5.6, 3,022,070 bytes unpacked (observed, `npm view`). README mentions no runtime download (observed). | +| **Google Safe Browsing v5** | local hashed lists, updated in the background by `hashLists.batchGet`. Unknown URLs: query a 4-byte prefix, optionally via an Oblivious HTTP relay | (observed, [reference](https://developers.google.com/safe-browsing/reference)) | +| **Pi-hole / AdGuard / uBlock Origin** | ship list *URLs*; the client fetches upstream on a schedule | (hypothesis: from how Firebog lists are consumed) | +| **Hagezi** | many mirrors (GitHub, GitLab, Codeberg, own build mirror) | (observed) | +| **ML models in WireCat** | downloaded once by a command | (owner's brief) | + +### Recommendation (IDEA-3) + +1. **Bundle, under ~1 MB gz:** + - Wikidata orgs (CC0); + - PSL; + - disposable + free-mail (MIT); + - NSI join, FDIC, BIC→LEI. + + This works offline on first run and needs no licence text beyond a NOTICE file. +2. **Data pack** (`wirecat data update` or similar): + - **what:** one versioned archive on WireCat's own release asset (GitHub Releases), with a sha256 and a `SOURCES.md` that gives the licence, attribution and date per source; + - **contents:** UT1 (BY-SA), Hagezi categories (GPL-3), Spamhaus DROP, abuse.ch CC0 feeds; + - **why:** share-alike data stays a separate "database" with its own licence, instead of mixing into the MIT/CC0 core (interpretation; not legal advice); + - **updates:** data ships without an npm release, which fits the push-less CI rule. +3. **Upstream-direct fetch** for sources we may not redistribute, or that need the user's own key: abuse.ch URLhaus/ThreatFox, PhishTank, OpenPhish. The command downloads the whole file from the source. The source sees only "this IP downloaded the list", never a sender. +4. The privacy line holds for all three: whole files only, matching on the owner's machine. + +## Open gaps + +- **RISK-2:** ESP, BIMI and bulk-sender lists do not exist publicly. They need our own build-time harvest. Effort is not estimated. +- **RISK-3:** licence status is unclear for PhishTank, OpenPhish, the GLEIF mapping files and the DMOZ archive. Read the terms before shipping any of them. +- **NEED-a:** will WireCat ever charge money? If yes, every NC source (Stop Forum Spam, Disconnect, DDG Tracker Radar, Safe Browsing, the StevenBlack extensions) is out now. If no, they become options. +- Not checked: Tink and TrueLayer categories, ISO 18245 (403), Cloudflare Radar categories (403), the official UT1 site (503), the Crunchbase ODM (404), Curlie dump status. diff --git a/docs/dev/plans/2026-11-25-contact-kinds-mail-products.md b/docs/dev/plans/2026-11-25-contact-kinds-mail-products.md new file mode 100644 index 000000000..417da26e5 --- /dev/null +++ b/docs/dev/plans/2026-11-25-contact-kinds-mail-products.md @@ -0,0 +1,495 @@ +# How mail products screen and sort mail, and what WireCat can copy + +Checked 2026-11-25. Research only, no code changed. + +**Short answer.** Most products save the user's correction **per sender**. Several also let you move **one message** without +touching the sender (HEY, Outlook, Proton), and a few add a **domain** level (HEY, SaneBox, Spark, Tuta, Fastmail). Only +SaneBox documents a full order of priority (subject beats domain, domain can override address). Open source has one +small piece of code worth porting: Zero's 82-line header classifier, which sorts each message on its own (MIT). The +owner's model fits what the market does: + +- each message gets its own category; +- rules exist at the address level and at the domain level; +- tabs are saved filters. + +The one thing to add is a guard for free-mail domains, so that nobody writes a rule for all of `gmail.com`. + +How each fact is labelled: + +- **doc**: the vendor's own help page, fetched today. +- **code**: source code read today, linked with a permalink. +- **search summary**: a search engine result that I did not open. Treat it as unverified. +- **opinion**: a review, a blog post or a competitor's claim. + +--- + +## 1. Products + +### 1.1 Summary table + +| Product | Categories | Scope of the automatic sort | User correction applies to | First-contact screen | ML or rules | +|---|---|---|---|---|---| +| HEY | Imbox, The Feed, Paper Trail (+ Set Aside, Reply Later as per-email piles) | Per sender (contact), set by the user | Sender, domain (only Imbox / screen-out), or one email | Yes, The Screener, mandatory | User decisions only | +| Gmail | Primary, Social, Promotions, Updates, Forums; views: Manage subscriptions, Purchases | Per message | One message (drag); sender via filter | No | ML (undocumented) | +| Apple Mail (iOS 18.2+) | Primary, Transactions, Updates, Promotions | Per message, grouped by sender in a digest | Sender ("Categorize Sender") | No | ML (Apple Intelligence) | +| Outlook Focused Inbox | Focused, Other | Per message | One message or sender ("Always move") | No | ML | +| Superhuman | Split Inbox sections; Auto Labels Marketing, Pitch, Social, News + custom | Per message (labels) | Custom labels: rewrite the prompt | No | AI (LLM) | +| Shortwave | Splits; labels (Newsletters, Promotions, Travel…) | Per message (AI filters) or per sender (auto-apply) | Sender (auto-apply rule); drag thread between splits | No | AI + sender rules | +| Spark | Gatekeeper, Priority, People, Notifications, Newsletters | Per sender for corrections; auto method undocumented | Sender ("change category") | Yes, Gatekeeper (paid): address or domain | Undocumented | +| Fastmail | Folders by rules; Masked Email per recipient address | Per message (rule match) | Rule from message; block address or domain | No | Rules | +| Proton | Views → Mailing lists (Active / Unsubscribed) | Per sender list, detected from headers | Sender: move to folder, "apply to future messages" | No | Header "signals" | +| Notion Mail | AI auto labels (shut down 2026-09-22) | Per message | One message (add/remove label trains it) | No | AI | +| Yahoo | Tabs Primary, Offers, Social, Newsletters; Views: Subscriptions, Shopping, Receipts, Travel… | Per message | Not documented | No | Undocumented | +| SaneBox | Inbox, @SaneLater, @SaneNews, custom folders | Per sender (people); sender + subject (services) | Sender (move = train), domain filter, subject filter | Partly (@SaneBlackHole, unknown senders to later) | Rules + history scoring | +| Clean Email | Screener, Smart Folders, Auto Clean rules | Per sender (name + address) | Sender; allow-list by address/domain/keyword | Yes, Screener (off by default) | Rules | +| Unroll.me / Leave Me Alone | List of subscriptions | Per sender | Keep / unsubscribe / roll up | No | Header + body link | +| Tuta | Folders by inbox rules | Per message (rule) | Rule on sender address or domain (regex allowed) | No | Rules | + +### 1.2 Product notes + +**HEY** (doc) + +- **Screener.** A first-time sender waits in The Screener. "Yes" sends them to the Imbox. The arrow next to "Yes" picks + The Feed or Paper Trail instead. "No" screens them out, and the sender is not told. +- **Who skips the Screener.** Contacts added before the first email skip it. So does anyone who puts your Speakeasy code + in the subject. +- **Screener History** lets you undo a decision. When you screen someone back in, you see their mail from the last 90 + days. Source: [The Screener](https://help.hey.com/article/722-the-screener). +- **Domain level.** The `@domain` button on a contact sets the whole domain to one of three options: screen in to the + Imbox, screen out, or screen individually. Large free-mail domains cannot be screened out ("such as @gmail.com"). A + whole domain cannot be sent to The Feed: "You can't automatically send an entire domain's emails to The Feed." + Sources: [The Screener](https://help.hey.com/article/722-the-screener), [The Feed](https://help.hey.com/article/761-the-feed). +- **Two correction scopes.** "Delivering to" on a contact moves existing and future mail. "Move to The Feed / Paper + Trail" on one email moves only that email: "future emails from the sender still go where they normally do". Source: + [Paper Trail](https://help.hey.com/article/787-paper-trail). +- **Set Aside and Reply Later** are piles of single emails, not sender settings. Sources: + [Focus & Reply](https://help.hey.com/article/764-focus-and-reply), [Set Aside](https://hey.com/features/set-aside/). +- A spam filter runs before the Screener. Source: [Screener feature page](https://www.hey.com/features/the-screener/). + +**Gmail** + +- **Tabs** (doc): Primary ("people you know"), Social, Promotions, Updates ("automated confirmations, notifications, + statements"), Forums ("online groups, discussion boards, mailing lists"). Dragging a message to another tab teaches + Gmail. A filter can send a sender to a category. Source: [Gmail categories](https://support.google.com/mail/answer/3055016?hl=en). +- **Unverified.** People widely report a prompt after a drag, "Do this for future messages from …?". The help page + does not mention it, and I did not confirm it. +- **Manage subscriptions** (doc, 2025-07-08): senders ranked by how often they write, with counts for the last few + weeks. One click sends an unsubscribe request for you. Source: [Google blog](https://blog.google/products/gmail/new-manage-subscriptions-unsubscribe/). +- **Purchases view and Promotions sorted by "most relevant"** (search summary of the Google blog, 2025-09-11): + deliveries and purchase mail are collected in one view, plus a "Top deals for you" card. Source: + [Google blog](https://blog.google/products/gmail/one-stop-purchase-tracking-in-gmail/). +- **Why `List-Unsubscribe` is a reliable signal** (doc): since 2024, anyone who sends more than 5,000 messages a day to + Gmail must add one-click unsubscribe to marketing and subscribed mail (`List-Unsubscribe` + + `List-Unsubscribe-Post`, RFC 2369 / RFC 8058). They must also pass DMARC, with the From domain aligned with SPF or + DKIM. Transactional mail is not named in the rule. Source: [Email sender guidelines](https://support.google.com/a/answer/81126?hl=en). +- **Structured data in receipts** (doc): Gmail reads schema.org `Order` markup (JSON-LD or microdata) with + `merchant`, `orderNumber`, `price` and `acceptedOffer`. This is a deterministic marker of a receipt. Source: + [Order markup](https://developers.google.com/workspace/gmail/markup/reference/order). + +**Apple Mail** (doc: the iCloud guide. The iPhone steps are a search summary from CNET and TechRadar.) + +- Primary: "personal messages, direct communications and time-sensitive information". Transactions: receipts and + shipping. Updates: news, newsletters and social. Promotions. +- Time-sensitive mail from the other categories also shows in Primary. So one message can appear in two places, which + supports "tabs are views". +- Messages in Transactions, Updates and Promotions open as a **digest by sender**. +- "Categorize Sender": "Your choice applies to all current and future messages from the sender." +- "Reset Manual Categorization" undoes all manual changes. +- Source: [Use categories](https://support.apple.com/en-ca/guide/icloud/mmafbebd3108/icloud). +- On iPhone the feature needs iOS 18.2 and Apple Intelligence (search summary). Apple's guide does not say whether the + sorting runs on the device. + +**Outlook Focused Inbox** (doc) + +- Learns from "emails and contacts you interact with" and "filters out noisy sources like automatically generated or + bulk email". +- "Move to Focused/Other" moves one message. "Always move to Focused/Other" moves the sender's future mail. +- Source: [Focused Inbox](https://support.microsoft.com/en-us/office/focused-inbox-for-outlook-f445ad7f-02f4-4294-a82e-71d8964e3978). + +**Superhuman** (search summary. The help centre returned HTTP 403.) + +- Built-in Auto Labels: Marketing, Pitch, Social, News. Custom labels are written as AI prompts (Business plan). +- Split Inbox sections are built from labels or from search queries, such as the sender domain. +- At launch, a wrong custom label could only be fixed by writing a new prompt + ([TechCrunch, 2025-02-19](https://techcrunch.com/2025/02/19/superhuman-introduces-ai-powered-categorization-to-reduce-spammy-emails-in-your-inbox), news). + +**Shortwave** (doc) + +- Labels can be "automatically applied or removed on a per-sender basis". AI filters apply labels from a description + in plain language, with ready-made filters for Travel, Finance and Purchases. +- Splits are built from labels, senders or search queries. You can drag a thread between splits. +- Source: [Bundles and splits](https://www.shortwave.com/docs/guides/bundles/). + +**Spark** + +- **Smart Inbox cards** (doc): People, Notifications, Newsletters, plus Priority and Seen. Changing a sender's category + "sort[s] all future emails from this sender". The help page does not say how Spark picks the category in the first + place. Source: [Customize your inbox](https://sparkmailapp.com/help/manage-your-inbox/customize-your-inbox). +- **Gatekeeper** (doc, paid): a new sender is "somebody with a new email address". You accept or block. Blocking is + silent. You can choose "Block All ". Three modes: screen before the Inbox, screen inside the Inbox, or off. + You can accept or block everyone in the list at once. Source: + [Accept or block new senders](https://sparkmailapp.com/help/set-up-focus/accept-or-block-new-senders). + +**Fastmail** (doc) + +- Rules match From, To/Cc/Bcc, Subject or Body. "Add rule from message…" fills in the conditions from the message. +- You can block an address or a whole domain (the mail goes to Trash). +- Address actions run before rules: you can act on everything sent to one of your addresses. +- Source: [Filters & Rules](https://www.fastmail.help/hc/en-us/articles/1500000278122). +- Masked Email gives each service its own address. The address the mail was **sent to** then tells you which service + sent it (search summary of Fastmail's Masked Email help). + +**Proton** (doc) + +- Views → Mailing lists, with an Active tab and an Unsubscribed tab. Proton finds newsletters from "multiple signals — + like email headers" and admits that "regular emails can be misclassified". +- Each sender shows unread count and how much mail came in the last 30 days. You can sort by least read or by most + frequent. +- Actions: unsubscribe and then trash or archive the old mail, or move to a folder with "apply to future messages". +- **The view moves nothing**: mail stays where it is. It is a view over the data. +- To report a wrong entry, you send Proton the message headers. +- Source: [Mail newsletters view](https://proton.me/support/mail-newsletters-view). + +**Notion Mail** (search summary of the Notion help page): auto labels from AI prompts, with "Show in inbox" or +"Filter from inbox". Adding or removing a label on one email trains the AI. **The product shut down on 2026-09-22.** +Notion said many users now handle mail through agents. Source: +[Notion Mail is going away](https://www.notion.com/help/notion-mail-inbox-is-going-away-what-to-do-next). + +**Yahoo** (doc) + +- Inbox categories: Primary, Offers, Social, Newsletters, with All. Source: [Inbox categories](https://help.yahoo.com/kb/SLN36712.html), + search summary. +- Views: Subscriptions ("active or unsubscribed subscriptions"), Shopping, Receipts, Travel, plus Contacts, Photos and + Documents. Source: [Views](https://help.yahoo.com/kb/new-mail-for-desktop/navigate-emails-views-yahoo-desktop-sln36325.html). +- I found no documented way to move a sender from one tab to another. + +**SaneBox** (doc). This is the clearest public model of scopes and priority. + +- **People.** SaneBox sorts mail from individuals by your history with them. Mail from services is sorted by **sender + and subject**. So one shop's newsletters can go to @SaneNews while its shipping notices go to @SaneLater. +- **No message bodies.** SaneBox does not download message bodies: it uses only the sender and the subject. Source: + [How SaneBox determines trainings](https://www.sanebox.com/help/186-how-does-sanebox-determine-trainings). +- **Domain filters** match the domain exactly. A "match sub-domains" box is optional. An "Override training" box + decides whether the domain rule beats the training you gave one address at that domain. +- **Priority.** "The subject filter will override the domain filter." +- **Replies** stay in the Inbox by default, even when a domain filter matches. Source: + [Can I filter by domain](https://www.sanebox.com/help/121-can-i-filter-by-domain). + +**Clean Email** (doc) + +- **Screener** (off by default). A new sender is one that "has never sent a message to your address before". Allow sends + them to the Inbox, Read Later or a folder. Block or Pause sends them to Trash. +- **Three kinds screened separately.** It screens mailing lists, automated messages and messages from people, and you + can let any one kind through without screening. +- An allow-list lets addresses, domains or keywords skip the screen. +- A sender is identified by "the combination of name and email address". +- Source: [Screener](https://clean.email/help/tools/screener). + +**Unroll.me** (opinion, from reviews and competitors): it scans for subscriptions and offers unsubscribe and a daily +"rollup". In 2017 its parent company Slice sold anonymised receipt data +([The Intercept](https://theintercept.com/2017/04/24/stop-using-unroll-me-right-now-it-sold-your-data-to-uber/)). +This is the privacy argument for a local tool. + +**Leave Me Alone** (doc): reads `List-Unsubscribe` first and falls back to a link in the body. It prefers an RFC 8058 +POST. Source: [Effective unsubscribe methods](https://help.leavemealone.com/en/for-mailing-list-owners/how-to-provide-effective-unsubscribe-methods). +The product is closed source. + +**Tuta** (search summary of the Tuta blog and support): inbox rules match a sender address, a domain, a subject or a +header, and accept JavaScript regular expressions. "Reapply inbox rules" runs them over old mail. Tuta has no automatic +categories. + +--- + +## 2. Open source + +| Project | Licence | Categorization in the code | Reuse | +|---|---|---|---| +| **Zero** (Mail-0/Zero) | MIT (root [LICENSE](https://github.com/Mail-0/Zero/blob/4b642dfd9890a1fdcb1b98a177fe74ca3142c445/LICENSE), no other licence found) | Deterministic header classifier per message (personal / promotions / updates) | **Yes**, port with the copyright notice | +| **Inbox Zero** | AGPL-3.0; `apps/web/ee/` has a commercial licence | Categories per sender by an LLM; cold-email guard; learned FROM/SUBJECT patterns | **Ideas only.** Copying the code would make WireCat AGPL | +| **Mailspring** | GPL-3.0 | Rules (from/to/subject/body); a "Newsletters" view = `listUnsubscribe` present | Ideas only | +| **rspamd** | Apache-2.0 | Scored detection of mailing lists; known senders (owner replied) | Yes, with the NOTICE | +| **SpamAssassin** | Apache-2.0 | `__VIA_ML` mailing-list rule; free-mail domain list; TxRep address and domain reputation | Yes (rules, lists), with the NOTICE | +| **Thunderbird** | MPL-2.0 | Local Bayesian junk filter trained per user; address-book senders are exempt | File-level reuse under MPL. **I did not read the code.** | +| Nylas | Closed (API) | Not checked | — | + +### 2.1 Zero: per-message header classifier (code) + +[`apps/server/src/lib/imap/categorize.ts`](https://github.com/Mail-0/Zero/blob/4b642dfd9890a1fdcb1b98a177fe74ca3142c445/apps/server/src/lib/imap/categorize.ts#L19-L82) +is 82 lines. It reads these headers: `From`, `To`, `Cc`, `List-Id`, `List-Unsubscribe`, `Precedence`, +`Auto-Submitted`, `Feedback-ID`, `X-Auto-Response-Suppress` and `X-Campaign` (L19-20). + +- **Two regular expressions on the local part** (the part of the address before `@`): + - automated senders: `no-reply`, `notifications`, `billing`, `receipts`, `orders`, `support`… (L23-24); + - marketing senders: `news`, `promo`, `deals`, `hello`, `team`, `info`… (L27-28). +- **Order of the checks** (L52-82): + 1. A known contact with no `List-Unsubscribe` and no bulk header → personal. + 2. `Precedence: list` with no campaign marker → updates. This is a discussion list. + 3. `List-Unsubscribe` or `Precedence: bulk` → promotions. The exception is an automated sender with no campaign + marker, which gets updates. This keeps receipts out of Promotions. + 4. `List-Id`, `Auto-Submitted` or an automated local part → updates. + 5. An ESP campaign header → promotions. An ESP is an email service provider such as Mailchimp or SendGrid. The code + comment says: "A marketing-looking address alone (info@, hello@) is often a real person". + 6. Anything else → personal. +- **Known contact = "the owner wrote to them".** When the sync reads the Sent folder, it saves every recipient as a + contact ([`imap-store.ts` L500-525](https://github.com/Mail-0/Zero/blob/4b642dfd9890a1fdcb1b98a177fe74ca3142c445/apps/server/src/lib/imap/imap-store.ts#L500-L525)). + The same function also stores a `bulk` flag on each message. +- **User beats AI.** A thread category has a source, `ai` or `user`, and "A user's choice is never overwritten by the + AI" ([L560-566](https://github.com/Mail-0/Zero/blob/4b642dfd9890a1fdcb1b98a177fe74ca3142c445/apps/server/src/lib/imap/imap-store.ts#L560-L566)). + +This is very close to what WireCat needs for `reach` and `tie`, and it makes no network calls. + +### 2.2 Inbox Zero (code, AGPL-3.0) + +- **Categories are per sender**: Other, Newsletter, Marketing, Receipt, Notification. Thirteen more categories are + commented out + ([`utils/categories.ts` L1-48](https://github.com/elie222/inbox-zero/blob/122474b7d3197822e951d56f43d1b5f14141c335/apps/web/utils/categories.ts#L1-L48)). +- **How a sender is sorted.** An LLM reads the subjects and snippets of the sender's last 3 threads. If the model does + not answer, the sender gets "Other" + ([`categorize/senders/categorize.ts` L17-75](https://github.com/elie222/inbox-zero/blob/122474b7d3197822e951d56f43d1b5f14141c335/apps/web/utils/categorize/senders/categorize.ts#L17-L75)). +- **Cold-email guard.** It runs deterministic checks before the AI, in this order: + 1. an application sender on the allow-list; + 2. a sender from the owner's own organization; + 3. a learned pattern, where a user exclusion wins; + 4. the owner has already written to them, which beats an old "cold" mark; + 5. any earlier contact. + + Only after that does the AI run + ([`cold-email/is-cold-email.ts` L54-161](https://github.com/elie222/inbox-zero/blob/122474b7d3197822e951d56f43d1b5f14141c335/apps/web/utils/cold-email/is-cold-email.ts#L54-L161)). +- **Learned patterns are the correction model.** A `GroupItem` has a type (`FROM` / `SUBJECT` / `BODY`), a value + ("@gmail.com", "matt@gmail.com" or "Receipt from") and an `exclude` flag + ([`schema.prisma` L1091-1103](https://github.com/elie222/inbox-zero/blob/122474b7d3197822e951d56f43d1b5f14141c335/apps/web/prisma/schema.prisma#L1091-L1103)). +- **Matching rules** + ([`group/find-matching-group.ts` L59-140](https://github.com/elie222/inbox-zero/blob/122474b7d3197822e951d56f43d1b5f14141c335/apps/web/utils/group/find-matching-group.ts#L59-L140)): + - an address or domain must match on a boundary, so `ann@acme.com` does not match `joann@acme.com`; + - a subject matches with the numbers removed; + - a user-made pattern beats a learned one, the newest wins, and an exclusion wins a tie. + + When a learned pattern matches, the AI call is skipped. +- **The keyword detectors are thin.** `isNewsletterSender` checks whether the sender contains "newsletter" or one of + three hosts (substack, beehiiv, ghost) + ([`find-newsletters.ts`](https://github.com/elie222/inbox-zero/blob/122474b7d3197822e951d56f43d1b5f14141c335/apps/web/utils/ai/group/find-newsletters.ts#L1-L8)). + The receipt detector is a short list of senders and subjects + ([`find-receipts.ts`](https://github.com/elie222/inbox-zero/blob/122474b7d3197822e951d56f43d1b5f14141c335/apps/web/utils/ai/group/find-receipts.ts#L1-L60)). + Neither is worth copying. + +### 2.3 Mailspring (code, GPL-3.0) + +- Rule conditions: from, to, cc, bcc, any recipient, reply-to, attachment, subject, body + ([`mail-rules-templates.ts` L5-105](https://github.com/Foundry376/Mailspring/blob/7a8ab27168960f967c3b572b014edea6db729655/app/src/mail-rules-templates.ts#L5-L105)). +- The new "Newsletters" starter view is a query: `listUnsubscribe` present, direction received. +- It groups the result by sender **name**, because "one brand sends from several addresses (LinkedIn)" + ([`starters/newsletters/View.jsx` L20-28](https://github.com/Foundry376/Mailspring/blob/7a8ab27168960f967c3b572b014edea6db729655/app/internal_packages/views/starters/newsletters/View.jsx#L20-L28)). + +### 2.4 rspamd (code, Apache-2.0) + +- **`MAILLIST`.** Fingerprints for ezmlm, Mailman, Google Groups and CommuniGate. There is also a generic score: + `List-Id` 0.75, `Precedence: list|bulk` 0.25, other `List-*` headers 0.125 each, and +0.25 when both Subscribe and + Unsubscribe are present + ([`maillist.lua` L153-200](https://github.com/rspamd/rspamd/blob/21d3ad96e527d0f839eef782a9b7858ac7f0b4b4/src/plugins/lua/maillist.lua#L153-L200)). +- **`known_senders`.** Marks `KNOWN_SENDER` / `UNKNOWN_SENDER`. It keeps a set of "verified senders" that the user has + replied to, with optional hashing for privacy + ([`known_senders.lua` L36-48](https://github.com/rspamd/rspamd/blob/21d3ad96e527d0f839eef782a9b7858ac7f0b4b4/src/plugins/lua/known_senders.lua#L36-L48)). +- **Single-header symbols:** + - `HAS_LIST_UNSUB` ([`headers.lua` L959](https://github.com/rspamd/rspamd/blob/21d3ad96e527d0f839eef782a9b7858ac7f0b4b4/rules/regexp/headers.lua#L959)); + - `PRECEDENCE_BULK` ([`upstream_spam_filters.lua` L21](https://github.com/rspamd/rspamd/blob/21d3ad96e527d0f839eef782a9b7858ac7f0b4b4/rules/regexp/upstream_spam_filters.lua#L21)); + - the `Auto-Submitted` check ([`headers_checks.lua` L267](https://github.com/rspamd/rspamd/blob/21d3ad96e527d0f839eef782a9b7858ac7f0b4b4/rules/headers_checks.lua#L267)). + +### 2.5 SpamAssassin (code, Apache-2.0) + +- **`__VIA_ML`** fires on any one of these: `Precedence` list or bulk, `List-Id`, `List-Post`, `Mailing-List`, or a + Return-Path of the form `*-request|-bounces|-admin|-owner@` + ([`20_head_tests.cf` L427-433](https://github.com/apache/spamassassin/blob/be3c2988cc347770adff89072c30573fa242012c/rules/20_head_tests.cf#L427-L433)). +- **Free-mail list.** 480 `freemail_domains` lines (gmail, outlook, yandex, mail.ru…) in + [`20_freemail_domains.cf`](https://github.com/apache/spamassassin/blob/be3c2988cc347770adff89072c30573fa242012c/rules/20_freemail_domains.cf). + This is the list that makes domain-level rules safe. +- **TxRep** keeps a separate weighted reputation for each level: the address with its IP, the address alone, the + **domain**, the IP and the HELO name. A skip list holds domains it should not track + ([`TxRep.pm` ~L705-780](https://github.com/apache/spamassassin/blob/be3c2988cc347770adff89072c30573fa242012c/lib/Mail/SpamAssassin/Plugin/TxRep.pm#L705-L780)). + It is an old precedent for keeping address and domain apart. + +### 2.6 Thunderbird (doc + file link, code not read) + +- The adaptive junk filter is a Bayesian classifier (a word-statistics model), trained per user and on the user's own + machine: + [`mailnews/extensions/bayesian-spam-filter/`](https://searchfox.org/comm-central/source/mailnews/extensions/bayesian-spam-filter). +- Senders in a chosen address book are never marked as junk automatically (search summary of the + [Mozilla support article](https://support.mozilla.org/kb/thunderbird-and-junk-spam-messages)). A Bugzilla report says + the junk filter runs before the user's filters + ([bug 543024](https://bugzilla.mozilla.org/show_bug.cgi?id=543024)). +- This belongs to the later AI feature (local machine learning), not to the deterministic rules. + +### 2.7 Other detectors + +- **schema.org markup** in the HTML: `Order`, and Gmail's other types such as `ParcelDelivery`. This gives a certain + "receipt" or "delivery" label when it is present. See the Gmail markup docs above. +- **Public Suffix List** (MPL-2.0, [publicsuffix.org](https://publicsuffix.org/)). It turns `mail.shop.co.uk` into + `shop.co.uk`, which WireCat needs for the domain level. This is my suggestion: none of the products above names it. +- **Not checked:** Nylas (its sorting is a closed paid API), and other open newsletter or receipt detectors on GitHub. + +--- + +## 3. Findings + +- **FIND-1 · Corrections are per sender by default. A one-message scope is the second most common.** HEY, Outlook, + Proton and Shortwave offer both. Apple and Spark offer only the sender. No product rewrites a category for a single + message without asking which scope the user wants. Outlook's "Move" and "Always move" make the scope a visible choice. +- **FIND-2 · The domain level exists, but it is limited.** HEY allows only screen in or screen out for a domain, never + The Feed. Spark and Fastmail use the domain level only to block. SaneBox has a full domain rule with "override" and + "sub-domains" options. +- **FIND-3 · Free-mail domains break domain rules.** HEY refuses to screen out `@gmail.com`. A domain level needs a + free-mail guard. +- **FIND-4 · "Known" is computed locally everywhere.** Zero: the owner wrote to them. rspamd: the owner replied. HEY: + in the contacts. Inbox Zero: the owner sent to them, or the sender is from the same organization. Clean Email: they + wrote before. None of these needs a network call. +- **FIND-5 · Subscription views are built from headers and are views, not folders.** Gmail, Proton, Yahoo and + Mailspring all do this. Proton says it outright: "The view doesn't move anything." +- **FIND-6 · One sender can send mixed mail.** SaneBox sorts services by sender **and** subject. Apple shows Primary + items in two places. This supports the owner's point that a category belongs to the message, apart from its sender. +- **FIND-7 · The big products use ML; the deterministic ones are smaller or open.** ML: Gmail, Apple, Outlook, + Superhuman, Shortwave, Notion. Deterministic: Zero, SaneBox for subjects and domains, Proton's header signals, rspamd, + SpamAssassin. + +--- + +## 4. Recommendations for WireCat + +The owner's model is: each message gets its own category, rules exist at two levels (address and domain), and tabs are +filtered views. The ideas below fit that model, most useful first. + +### IDEA-1 · Classify each message from its headers + +- **The idea.** A header classifier runs on each message during sync, after Zero's design. It returns `kind`: + - `person`: a direct message from a human; + - `list`: a discussion list; + - `bulk`: marketing or a newsletter; + - `automated`: notifications, receipts, alerts. + + The same pass gives `reach`: + - direct: the owner is in `To`; + - group: Cc or several people; + - broadcast: `List-*`, `Precedence: bulk`, or the owner is not among the recipients. +- **Who does it.** Zero ([`categorize.ts`](https://github.com/Mail-0/Zero/blob/4b642dfd9890a1fdcb1b98a177fe74ca3142c445/apps/server/src/lib/imap/categorize.ts#L52-L82)), + rspamd `MAILLIST`, SpamAssassin `__VIA_ML`. Gmail and Proton use the same headers, but their code is closed. +- **Why it fits a local-first tool.** It uses only headers. It makes no network calls and costs nothing to run. Gmail's + rule since 2024 makes `List-Unsubscribe` present on almost all bulk mail. +- **Cost.** Small. About 100 lines plus fixture tests. The code is MIT, so it can be ported with the notice. Add + rspamd's ezmlm and Mailman fingerprints for discussion lists. + +### IDEA-2 · Store the message's category apart from the sender's, and derive the sender's from its messages + +- **The idea.** `message.category` comes from IDEA-1 plus any override. `sender.profile` is a summary of that sender's + messages, for example "92 % bulk, 8 % automated". +- A tab is a query on the message category. Example: Subscriptions = `kind=bulk` and not overridden. +- A sender with mixed mail (newsletter plus receipts) then shows in two tabs, and the receipts are not lost. +- **Who does it.** Apple (Primary items also show in their category), SaneBox (sender + subject for services), HEY (move + one email without changing the sender), Proton (a view that moves nothing). +- **Why it fits a local-first tool.** The whole mailbox is local, so a summary per sender is a cheap SQL query. +- **Cost.** Medium. A schema change: a category column on each message, and a sender summary built from it. + +### IDEA-3 · Two-level rules with a fixed order of priority and a free-mail guard + +- **The idea.** A rule has a key and an action. The key is the address or the registrable domain (via the Public + Suffix List). Rules are checked in this order: + + | # | Level | Example | Wins over | + |---|---|---|---| + | 1 | One message | "this email is a receipt" | everything | + | 2 | List-Id or subject pattern (optional) | `List-Id: `; "Your order #…" | address, domain | + | 3 | Address | `orders@shop.com` → automated | domain | + | 4 | Domain | `shop.com` → organization "Shop" | header classifier | + | 5 | Header classifier (IDEA-1) | — | default | + +- Within one level, a user rule beats a learned rule. The newest rule wins. "Exclude" wins a tie (Inbox Zero). +- A domain rule may set "override address rules", as in SaneBox. +- **Free-mail guard.** Domain rules are refused for domains on SpamAssassin's `freemail_domains` list. For those, the + UI offers the address rule instead (HEY). +- **Who does it.** SaneBox (subject beats domain, override, sub-domains), HEY `@domain`, Spark "Block All ", + Tuta, Fastmail, Inbox Zero `GroupItem`, SpamAssassin TxRep (address and domain reputation). +- **Why it fits a local-first tool.** The rules are plain local data. The free-mail list and the Public Suffix List are + static files shipped with the app. +- **Cost.** Small to medium. Two files under Apache-2.0 and MPL-2.0, one rules table, and boundary-safe matching. Use + Inbox Zero's fix as the model: anchored matching, so `ann@` does not match `joann@`. + +### IDEA-4 · Every correction asks for its scope + +- **The idea.** When the owner moves or re-labels a message, the choice is **this message / everything from this + address / everything from this domain** (and "this list" when `List-Id` is present). It also offers "Apply to past + messages". +- The owner can "Reset manual sorting" for a sender, a domain or everything. +- **Who does it.** Outlook ("Move" vs "Always move"), HEY (one email vs "Delivering to"), Apple ("Categorize Sender" and + "Reset Manual Categorization"), Proton ("Apply to future messages"), Tuta ("Reapply inbox rules"). +- **Why it fits a local-first tool.** Applying a rule to past mail is a local re-scan, with no cost to any service. +- **Cost.** Small for the CLI flags (`--scope message|address|domain|list`). Medium for the Desktop UI. + +### IDEA-5 · A local screener for first-time senders, limited to people + +- **The idea.** Rules for who gets screened: + - **Known** means any of: the owner has sent mail to this address (Zero, rspamd), the address is in contacts, or the + domain is the owner's own (Inbox Zero). + - Only `kind=person` messages from unknown addresses go to the screener by default. Bulk and automated mail goes to + its tabs, as Clean Email's separate settings for each kind allow. + - A decision is saved per address. It is saved per domain only when the domain is not free mail. + - "Screened-out" hides the sender, deletes nothing and tells nobody. + - Screener history can undo a decision, and screening someone back in shows their old mail (HEY shows 90 days). +- This gives WireCat's `tie` field a user-confirmed value on top of the computed one. +- **Who does it.** HEY Screener, Spark Gatekeeper (address or domain, accept or block in bulk, three modes), Clean Email + Screener. +- **Why it fits a local-first tool.** It needs only the local Sent folder and contacts. Nothing is bounced or reported + to the sender. WireCat holds a copy of the mail and does not deliver it, so "screen out" is a filter on a view. +- **Cost.** Medium. A screener state per address and per domain, a queue view, and an action to accept or block + everyone at once. + +### IDEA-6 · A Subscriptions view grouped by list, with counts + +- **The idea.** Group `kind=bulk` and `kind=list` messages by `List-Id`, falling back to the sender. Show: + - messages in the last 30 days; + - the share of them that was read; + - the date of the last message; + - whether the sender offers one-click unsubscribe. + + Sort by frequency or by "least read". +- **Who does it.** Gmail Manage subscriptions, Proton Mailing lists (unread count and last 30 days), Yahoo + Subscriptions, Mailspring Newsletters view (grouped by brand name). +- **Why it fits a local-first tool.** It is a query over local data. Unsubscribing is the only network action. The + owner starts it, and it goes to the sender's own `List-Unsubscribe` address, never to a WireCat server. +- **Cost.** Small for the view. Unsubscribing (RFC 8058 POST or mailto) is a separate, later step that needs explicit + confirmation. + +### IDEA-7 · Deterministic markers for transactions + +- **The idea.** Mark `automated` messages as `transaction` when any of these is true: + - the HTML contains schema.org `Order` or `ParcelDelivery` markup; + - the local part is `receipt@`, `billing@`, `orders@`, `invoice@` and the like; + - the subject matches an order or invoice pattern, with the numbers removed. +- **Who does it.** Gmail Purchases and order markup, Apple Transactions, Yahoo Receipts. Inbox Zero has small lists, + shown here only for the idea. +- **Why it fits a local-first tool.** It needs no lookup. The markup is in the message itself. +- **Cost.** Small. Accuracy is partial without ML. Note it as a candidate for the AI feature. + +### IDEA-8 · Organization = registrable domain, checked by DKIM, ignoring the ESP + +- **The idea.** Group senders into an organization by the registrable domain of `From`, and only when DKIM `d=` or SPF + agrees with it (the same alignment Gmail asks bulk senders for). Never use the `Return-Path` domain of an ESP + (sendgrid.net, mcsv.net) as the organization. +- **Who does it.** Gmail's sender rules (alignment). rspamd and SpamAssassin read the same headers. +- **Why it fits a local-first tool.** `Authentication-Results` and `DKIM-Signature` are already in the stored headers, + so no DNS lookup is needed. +- **Cost.** Small. Uses the Public Suffix List from IDEA-3. + +### IDEA-9 (for the later AI feature) · Learn patterns and promote them to rules + +- **The idea.** When the AI, or the owner's repeated moves, sort a sender the same way several times, propose a saved + address or subject rule. Inbox Zero does this with a 0.9 threshold + ([`recurring-pattern.ts` L12-13](https://github.com/elie222/inbox-zero/blob/122474b7d3197822e951d56f43d1b5f14141c335/apps/web/utils/decision-model/recurring-pattern.ts#L12-L13)). + After that, the deterministic path handles the sender, and the AI never overrides a user rule (Zero). +- A local Bayesian model trained per user (Thunderbird) is another option that keeps all data on the machine. +- **Cost.** It belongs to the AI feature. The rule table from IDEA-3 is the place where its results land. + +### How this maps to WireCat's current plan + +| WireCat today | Suggested change | +|---|---| +| Entities: people, bots, organizations | Keep them. Derive the entity type from the message summary (IDEA-2) plus rules (IDEA-3), not from one guess per sender | +| `reach` per sender | Compute it **per message** (IDEA-1). The sender's value is the most common one | +| `tie` per sender | Computed from local Sent and contacts, then confirmed by the screener (IDEA-5) | +| Tabs: People, Subscriptions, Bots, Organizations | Saved queries over the message category. People = `kind=person`; Subscriptions = `bulk`/`list`; Bots = `automated`; Organizations = grouped by domain (IDEA-8) | From f340021e806456dbc31b6854bc1ff704ee02405c Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 17:20:20 +0100 Subject: [PATCH 11/16] docs(people): free-mail domain rules allowed with guards, non-commercial lists for free WireCat only Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index baf947955..7cc286a8c 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -191,8 +191,11 @@ code says what the shop is, the bank's category says what the payment was. Resea - **The sender's view is a summary of its mails.** A shop that sends receipts and promotions appears under Bots and under Subscriptions; `reach` is worked out per mail too. - **Rules in a fixed order:** one mail, then a list or a subject pattern, then the address, then the domain, then the - header classifier. The owner's rule beats a rule's guess; within a level the newest wins. A domain rule is refused - for a free-mail domain and the address is offered instead, as HEY does. + header classifier. The owner's rule beats a rule's guess; within a level the newest wins. A domain rule on a free-mail + domain (`gmail.com`) is allowed, since the owner sometimes needs it (owner, 2026-11-25), but it is never made by + accident: a correction of one mail or address never widens to a free-mail domain on its own, the domain scope is + not offered first for such a domain, and setting it shows how many addresses and mails it touches before it + applies. HEY refuses such rules outright. - **A correction asks its scope:** this mail, this address, this domain or this list, and whether to apply it to past mail (Outlook's "Move" and "Always move"). - **Screening first-time senders**, as HEY does, only for people the owner has never written to. Later step. @@ -251,4 +254,6 @@ updates without a package release. Both wait on the owner (open questions 4 and 5. ~~The full split of bots.~~ Decided (owner, 2026-11-25): a bot is its own entity with its own table and `bot:` reference; the person-anchored form of #3339 is replaced. 6. **Paid product.** Will WireCat ever be sold? If so, non-commercial lists (Stop Forum Spam, DuckDuckGo Tracker - Radar, abuse.ch for commercial use) are out now. + Radar, abuse.ch for commercial use) are out now. Answer (owner, 2026-11-25): WireCat stays free and paid services + are built around it, so non-commercial lists may be used by WireCat but never by a paid service. Each such list is + marked in the data pack, and its own terms are checked for how they define commercial use. From e16903387c58defa05135f347aa24df6063c4825 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 19:20:34 +0100 Subject: [PATCH 12/16] docs(people): domain lists as a core in the package plus a downloaded data pack Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index 7cc286a8c..b7e21f61c 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -204,7 +204,7 @@ The domain lists above grow from the catalogue: UT1 (about 100 categories), the banks, the GLEIF bank codes joined to Wikidata, a free-mail list. Spam lists say "bad", never a sector, and many are non-commercial or work only as a lookup per sender, which this plan rules out. Distribution: a small core in the package, a versioned data pack from a WireCat release fetched by a command for larger and share-alike lists, so data -updates without a package release. Both wait on the owner (open questions 4 and 6). +updates without a package release. Decided by the owner, open questions 4 and 6. ## Out of scope @@ -250,7 +250,10 @@ updates without a package release. Both wait on the owner (open questions 4 and 3. **Discussion lists.** A mailing list where people answer each other: are its members People (reach `group`) or one Subscription? Until answered: a `List-Id` with three or more distinct senders is `group`. 4. **Where the domain lists live.** Built into the package at release (no network at run time), or downloaded once by - a `models`-style command the owner runs? + a `models`-style command the owner runs? Answer (owner, 2026-11-25): both. A small permissive core stays in the + package (Wikidata sectors, the Public Suffix List, free-mail and throwaway-mail lists). Larger, often updated and + share-alike lists (UT1, spam lists) ship as a versioned data pack on a WireCat GitHub release, fetched and updated + by a command, with a checksum and a licence per source. 5. ~~The full split of bots.~~ Decided (owner, 2026-11-25): a bot is its own entity with its own table and `bot:` reference; the person-anchored form of #3339 is replaced. 6. **Paid product.** Will WireCat ever be sold? If so, non-commercial lists (Stop Forum Spam, DuckDuckGo Tracker From 28009aa1835faa1cb175c43a7c7d50ee367ceacd Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 21:21:27 +0100 Subject: [PATCH 13/16] docs(people): bots as their own entity built in #3356 Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index b7e21f61c..391581eef 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -51,10 +51,16 @@ proposed as "the same person", cannot be a task's assignee and never counts as s A bot has a name, its identities and an optional organization. It has no ties, no tasks and no merge review: two bots of one organization are grouped under it, not merged. -**Built so far (#3339, store version 74).** A bot is a `sender_bots` row anchored on one person, and its identities -stay on that person, so ingest, merges and `person:` references keep working. A bot is always listed as -`automated`. This is the plan's separation in a first form: lists still tell bots apart by kind. The full form gives -a bot its own reference (`bot:`) and moves its identities off the person; memo and Desktop change with it. +**Built so far (#3339, store version 74, and #3356, store version 75).** A bot is its own entity with the ref +`sender-bot:` (`bot:` already names AI agents in the store; open question 7). It holds its identities in +`sender_bot_identities`, so an identity belongs to one person or one bot. It has a name, identities and an optional +organization (the domain rule of #3347 files it there), no ties, tasks or merge review, and never appears in +`people.list`, its counts, similar people or ties. Messages and mail still point at the identity. The person row a +bot emptied stays hidden, so a move back gives its uid back. `people.listBots` and `people.showBot` read bots; +`moveToBot` and `moveToPerson` move a person, a bot or one identity with its whole history, logged in +`sender_bot_moves`, and the owner's choice wins. `minCompatible` stays 73: triggers keep cli-core 1.0.0 builds from +linking a bot's identity to a person. Not built: memo `bots` commands, the Desktop view, a bot sender's `ref` in mail +fields, and mention, tracker and author lookups for bot identities. **Moving between entities.** A rule can be wrong, so an identity can move from a person to a bot and back. Its messages stay where they are (they point at the identity), the move is logged, and the owner's choice always wins @@ -222,8 +228,7 @@ updates without a package release. Decided by the owner, open questions 4 and 6. in #3334. 3. Store: the `bots` table, `identities` pointing at a person or a bot, the move log, and `reach` and the marks kept like `kind` today (lazily, cleared by triggers). Identities that today make a person `automated` move to bots. - Built in #3339 as `sender_bots` anchored on a person (store version 74), with the move log and the List-Id - index; the full split is open (question 5). + Built in #3339 (store version 74) and split fully in #3356 (store version 75). 4. The owner's choice: move an identity to a person or a bot, for its whole history. Built in #3339 as `PeopleStore.moveToBot` and `moveToPerson`; memo has no command for it yet. 5. Organizations from domains, with the three exceptions above (built in #3347: `From` domain only, no `List-Id` @@ -260,3 +265,5 @@ updates without a package release. Decided by the owner, open questions 4 and 6. Radar, abuse.ch for commercial use) are out now. Answer (owner, 2026-11-25): WireCat stays free and paid services are built around it, so non-commercial lists may be used by WireCat but never by a paid service. Each such list is marked in the data pack, and its own terms are checked for how they define commercial use. +7. **A bot's ref.** `sender-bot:` as built, or `bot:` after the AI agents' `bot:` ref is renamed in a major + release? From ba2c7b6532f6014fd65cd6af9a85db73fe4d89f9 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 21:35:15 +0100 Subject: [PATCH 14/16] docs(people): mail types built in #3358 Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index 391581eef..4cb46ac87 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -204,6 +204,11 @@ code says what the shop is, the bank's category says what the payment was. Resea applies. HEY refuses such rules outright. - **A correction asks its scope:** this mail, this address, this domain or this list, and whether to apply it to past mail (Outlook's "Move" and "Always move"). +- **Built in #3358 (store version 76):** every email has `mailType`, `reach` and `typeSignal`, kept lazily and + cleared by triggers; `store.mail.emails({ types, reaches })` filters and `store.mail.mailSenders` sums a sender's + mail by type and reach. Two changes to the order above: `system_alert` before `account_notice`, and an automated + address with a plain unsubscribe link is `account_notice`, not `promotion`. Not yet stored by mail sync: schema.org + markup (no HTML kept), `Auto-Submitted: auto-replied`, `List-Post`, the calendar method. - **Screening first-time senders**, as HEY does, only for people the owner has never written to. Later step. The domain lists above grow from the catalogue: UT1 (about 100 categories), the OpenStreetMap brand index, FDIC From 1373a872ca40c8cde57c64fbb632b08eda4b09f3 Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 22:03:10 +0100 Subject: [PATCH 15/16] docs(people): domain-list data pack built in #3359 and #3362 Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index 4cb46ac87..ec3498bf4 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -215,7 +215,12 @@ The domain lists above grow from the catalogue: UT1 (about 100 categories), the banks, the GLEIF bank codes joined to Wikidata, a free-mail list. Spam lists say "bad", never a sector, and many are non-commercial or work only as a lookup per sender, which this plan rules out. Distribution: a small core in the package, a versioned data pack from a WireCat release fetched by a command for larger and share-alike lists, so data -updates without a package release. Decided by the owner, open questions 4 and 6. +updates without a package release. Decided by the owner, open questions 4 and 6. Built in #3359 and +#3362: `domain-lists update [--commercial-only]` fetches the pack from the `domain-lists` GitHub release (first pack +2026-11-25: UT1 sectors and webmail, UT1 malware hosts, FDIC banks; Stop Forum Spam fetched from its source, since it +may not be redistributed), published weekly by `.github/workflows/domain-lists.yml`. Webmail domains never make an +organization. Nothing reads the bad lists yet; no source yet for travel, health, education, utility, insurance or +software. ## Out of scope From 06421c10b2891abb79a4cfd64dd7031006c15f8f Mon Sep 17 00:00:00 2001 From: leemour Date: Wed, 25 Nov 2026 22:36:28 +0100 Subject: [PATCH 16/16] docs(people): sorting rules built in #3366 Co-Authored-By: Claude Opus 5.5 --- docs/dev/plans/2026-11-24-contact-kinds.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/dev/plans/2026-11-24-contact-kinds.md b/docs/dev/plans/2026-11-24-contact-kinds.md index ec3498bf4..3bcf35fae 100644 --- a/docs/dev/plans/2026-11-24-contact-kinds.md +++ b/docs/dev/plans/2026-11-24-contact-kinds.md @@ -209,6 +209,11 @@ code says what the shop is, the bank's category says what the payment was. Resea mail by type and reach. Two changes to the order above: `system_alert` before `account_notice`, and an automated address with a plain unsubscribe link is `account_notice`, not `promotion`. Not yet stored by mail sync: schema.org markup (no HTML kept), `Auto-Submitted: auto-replied`, `List-Post`, the calendar method. +- **Built in #3366 (store version 77):** `store.mail.sorting` with `add` (dry run and a `confirm` code, required for + a free-mail domain, owner only there), `rules`, `scopes`, `remove`, `undo` and `reset`; a rule sets a mail type, + moves a sender to a bot or a person through `moveToBot`/`moveToPerson`, or files it under an organization; a typed + mail says `typeSignal: "rule:"`. Follow-up: the owner's rules win across levels, and a removed rule puts senders + back with their earlier author. - **Screening first-time senders**, as HEY does, only for people the owner has never written to. Later step. The domain lists above grow from the catalogue: UT1 (about 100 categories), the OpenStreetMap brand index, FDIC