feat(lead): lead-inbox Grundgerüst, Muster und Einrichtung

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
m3ta-chironandClaude Fable 5.2 committed 2026-11-13 17:06:24 +01:00
1 parent 7e00eb5213
commit cb96ff65cb
3 files changed
+259

No files matched your search

@@ -0,0 +1,76 @@
# One-time setup (`/lead-inbox einrichten`)
Five steps, in this order. Each step is shown to Sascha with what it will change and waits for its own approval. Facts (folder list, cut-off date, rule table) come from `/home/sascha.koenig/ap/PM/.okf/systems/outlook.md`; after each step set the matching `Status` there (an OKF change, shown with the step and validated with the `validate` skill).
Before step 1 note `manage_mail_folder(action='get_details')` for `Inbox` and `Archive` (total and unread). The numbers go into the final report.
## 1. Folders
`manage_mail_folder(action='list')`, then for each missing folder of the table "Ordner": `manage_mail_folder(action='create', folder_name='<Name>', parent_folder='Inbox')`. Existing folders are skipped, never renamed.
**Done when** `list` shows all six folders under `Inbox`.
## 2. Backlog cut-off
Everything received before the cut-off date goes to `Archive` unseen. The connector moves at most one fetch (100 mails) at a time, so loop:
1. `search_emails(folder='Inbox', inference_classification='all', start_date='2015-01-01', end_date='<day before cut-off>T23:59')`.
2. Read all pages with `browse_email_cache(mode='llm')`; collect every cache number and note the first mail (received time, subject).
3. `manage_emails(action='archive_multiple', cache_numbers=[…all numbers of this fetch…])`.
4. Compare the returned count of moved mails with the fetch's `count`.
5. Next fetch.
Stop and report when `failed_count > 0`, or when two fetches in a row start with the same first mail (the move did not take effect). Tell Sascha the progress every five batches. With about 3,500 mails expect about 35 batches.
**Done when** the search returns `count: 0`, and `Inbox` + `Archive` totals equal the totals noted before the step (name any difference; new mail arriving meanwhile explains a few).
## 3. Presort from the cut-off date
Read the mails from the cut-off date to today day by day, as in step 1 of `SKILL.md`. Every mail matching a row in `muster.md` with a target folder becomes part of one batch item per folder. Present the batch items (count plus the list of subjects per folder), and after approval move them with `manage_emails(action='move_single', cache_number=<n>, destination_folder='Inbox/<Name>')`, finding each day's mails again first as `ausfuehren.md` describes. Rows marked "stays in `Inbox`" are left alone.
**Done when** no mail with `[Ticket#` in the subject is left in `Inbox`, and a sample of ten mails per target folder fits its pattern. What remains is the input of the first triage run.
## 4. Outlook rules
The connector cannot create rules, and the skill runs none of the commands below. Give Sascha both forms:
- the rule table from `systems/outlook.md`, for clicking the rules together in Outlook, and
- the Exchange Online PowerShell block below, filled from that table. The table decides; if it differs from this block, follow the table and say so.
```powershell
Connect-ExchangeOnline -UserPrincipalName sascha.koenig@azintec.com
$mb = "sascha.koenig@azintec.com"
# Folder names depend on the mailbox language. Check the real paths first:
Get-MailboxFolderStatistics $mb -FolderScope Inbox | ft Name,FolderPath
# If the inbox is shown as /Posteingang, replace "Inbox" below accordingly.
New-InboxRule -Mailbox $mb -Name "lead-inbox 01 Helpdesk" -FromAddressContainsWords "bot@az-gruppe.com" -SubjectContainsWords "[Ticket#" -MoveToFolder "${mb}:\Inbox\Helpdesk" -StopProcessingRules $true -WhatIf
New-InboxRule -Mailbox $mb -Name "lead-inbox 02 Alarme" -FromAddressContainsWords "MSSecurity-noreply@microsoft.com","Office365Alerts@microsoft.com","budgets@costalerts.amazonaws.com","quarantine@messaging.microsoft.com" -MoveToFolder "${mb}:\Inbox\Alarme" -StopProcessingRules $true -WhatIf
New-InboxRule -Mailbox $mb -Name "lead-inbox 03 Belege" -SubjectContainsWords "Invoice","Zahlungsbeleg","receipt","Neue Rechnungen sind jetzt verfügbar" -ExceptIfFromAddressContainsWords "@azintec.com" -MoveToFolder "${mb}:\Inbox\Belege" -StopProcessingRules $true -WhatIf
New-InboxRule -Mailbox $mb -Name "lead-inbox 04 Kalender" -MessageTypeMatches CalendaringResponse -MoveToFolder "${mb}:\Inbox\Kalender" -StopProcessingRules $true -WhatIf
New-InboxRule -Mailbox $mb -Name "lead-inbox 05 Newsletter" -FromAddressContainsWords <newsletter senders from muster.md, quoted and comma-separated> -MoveToFolder "${mb}:\Inbox\Newsletter" -StopProcessingRules $true -WhatIf
New-InboxRule -Mailbox $mb -Name "lead-inbox 06 Codes" -SubjectContainsWords "OTP","login code","passcode","Verification Code","sicherer Link zu Claude" -MoveToFolder "${mb}:\Inbox\Codes" -StopProcessingRules $true -WhatIf
New-InboxRule -Mailbox $mb -Name "lead-inbox 07 Workist-Bericht" -FromAddressContainsWords "noreply@workist.com" -SubjectContainsWords "Dein Workist Fortschrittsbericht" -MoveToFolder "${mb}:\Inbox\Newsletter" -StopProcessingRules $true -WhatIf
New-InboxRule -Mailbox $mb -Name "lead-inbox 08 Basecamp-Community" -FromAddressContainsWords "notifications@app.basecamp.com" -SubjectContainsWords "Basecamp (Community)" -MoveToFolder "${mb}:\Inbox\Newsletter" -StopProcessingRules $true -WhatIf
Get-InboxRule -Mailbox $mb | ft Name,Enabled,Priority
```
Write out rule 05 with the real sender list before handing the block over. Tell Sascha: run each line with `-WhatIf` first, then without it; rule 03 comes after 01 and 06 so that tickets and codes are sorted first; rules 07 and 08 can be removed once the reports are unsubscribed. No rule for Sage invoice approvals: they need action and stay in the inbox.
**Done when** Sascha reports which rules exist; set those rows to `aktiv` in `systems/outlook.md`.
## 5. Noise at the source
Not something the skill can do. Hand over the table "Lärm an der Quelle" from `systems/outlook.md` as `Für dich:` points, with where each setting lives as far as known:
- Zammad: avatar → Profil → Benachrichtigungen. Switch off the escalation reminders; limit updates to "meine Tickets" and mentions.
- Workist: unsubscribe link in the progress report.
- Basecamp Community: notification settings of the Community account.
- UPS Billing: change the invoice recipient in the UPS billing centre to accounting.
**Done when** the points are handed over. When Sascha reports one as done, set its status in `systems/outlook.md`.
## Final report
In German: folders created, mails archived (count, totals before and after), mails presorted per folder, rules handed over, open `Für dich:` points, and the number of mails left in `Inbox` for the first triage run.
+77
View File
@@ -0,0 +1,77 @@
# Known mail patterns
Read in step 2 of `SKILL.md`. A thread matching a row here is class 2 (Systemmail nach Muster) and goes to the target folder as a batch item, unless the row says otherwise. Several systems share one sender address, so a row matches only when sender **and** subject fit. Folder paths are relative to `Inbox/`.
Source: inventory of the inbox 06.–13.11.2026. The Outlook rules in `/home/sascha.koenig/ap/PM/.okf/systems/outlook.md` cover the same patterns at delivery time; this file catches what arrives before a rule exists or slips past one.
## System mails
| Sender | Subject contains | Kind | Target | Note |
|---|---|---|---|---|
| `bot@az-gruppe.com` | `[Ticket#` | Zammad notification | `Helpdesk` | do not read these for questions to Sascha; step 1 gets mentions from the API |
| `bot@az-gruppe.com` | `Helpdesk-Anmeldung von einem neuen Gerät` | Zammad login notice | `Alarme` | under "Prüfen" |
| `bot@az-gruppe.com` | `Vaultwarden Login Verification Code` | one-time code | `Codes` | |
| `bot@az-gruppe.com` | `Invitation to` … `accepted` | Vaultwarden invitation accepted | stays in `Inbox` | needs Sascha: confirm the user in Vaultwarden → `Für dich:` |
| `noreply@azintec.com` | `Freigabe Rechnung vom` | Sage invoice approval | stays in `Inbox` | class 3 (Freigabe); display names "Sage Rechnungsprüfung" and "Prüfprozess" |
| `account-service@azintec.com` | `Passwort läuft bald ab` | password expiry | stays in `Inbox` | `Für dich:` |
| `MSSecurity-noreply@microsoft.com` | `synchronization errors in your directory` | Entra Connect sync alert | `Alarme` | recurring since August 2026; name once under "Prüfen" with the count |
| `Office365Alerts@microsoft.com` | `alert:` | M365 alert | `Alarme` | under "Prüfen", always |
| `quarantine@messaging.microsoft.com` | `messages in quarantine` | quarantine digest | `Alarme` | under "Prüfen" |
| `budgets@costalerts.amazonaws.com` | `AWS Budgets` | budget alert | `Alarme` | under "Prüfen" |
| `no-reply@raynet.cz` | `Successful login from new location` | login notice | `Alarme` | under "Prüfen" |
| `no-reply@sharepointonline.com` | `wants to access` | SharePoint access request | stays in `Inbox` | `Für dich:` |
| `no-reply@sharepointonline.com` | `Besprechungsaufzeichnung ist abgelaufen` | recording expired | `Alarme` | |
| `noreply@workist.com` | `Dein Workist Fortschrittsbericht` | progress report | `Newsletter` | until unsubscribed |
| `notifications@app.basecamp.com` | `Basecamp (Community)` | community digest | `Newsletter` | until unsubscribed |
| `notifications@app.basecamp.com` | `added you to a project` | project invitation | `Inbox` → archive | class 7 |
| `no.reply@upsbilling.ups.com` | `Neue Rechnungen sind jetzt verfügbar` | UPS invoice notice | `Belege` | |
| `notifications@frappecloud.com` | `Invoice` | invoice | `Belege` | |
| `notifications@frappecloud.com` | `Insufficient balance` | payment problem | stays in `Inbox` | `Für dich:` |
| `notifications@frappecloud.com` | `OTP for Frappe Cloud Login` | one-time code | `Codes` | |
| `invoice+statements@sally.io` | `Zahlungsbeleg` | receipt | `Belege` | |
| `invoice+statements+…@stripe.com` | `receipt from` | receipt | `Belege` | sender address varies after `+` |
| `support@mailgun.net` | `login passcode` | one-time code | `Codes` | |
| `no-reply@account.canva.com` | `login code` | one-time code | `Codes` | |
| `no-reply-…@mail.anthropic.com` | `sicherer Link zu Claude` | login link | `Codes` | sender address varies |
| `customercare@gotowebinar.com` | `Webinar` | webinar reminder / thanks | `Newsletter` | |
| `do-not-reply@eecpro.knowbe4.com`, `donotreply@knowbe4.com` | `KnowBe4` | report / order confirmation | `Belege` | |
| `no-reply@d-velop.cloud` | `Nutzerkonto angelegt` | account created | `Inbox` → archive | class 7 |
| `security@info.n8n.io` | `Security Update` | security bulletin | stays in `Inbox` | `Für dich:` (decide whether to patch) |
| `support@mailgun.zendesk.com` | `[Request #` | vendor support ticket | stays in `Inbox` | a person waits for an answer: class 6 |
| any internal person | `Zugesagt:`, `Angenommen:`, `Accepted:` | meeting acceptance | `Kalender` | |
| any internal person | `Abgelehnt:`, `Declined:` | meeting decline | `Kalender` | has body text → read it first; information in it goes into the Lagebild |
| any internal person | `Automatische Antwort:` | out-of-office | `Kalender` | |
## Newsletters and cold outreach
Target `Newsletter`. Match on the sender address, or on the domain where marked.
| Sender | Kind |
|---|---|
| `updates@e.nextcloud.com` | newsletter |
| `news@llamaindex.ai`, `marketing@llamaindex.ai` | newsletter |
| `no-reply@cncf.io` | newsletter |
| `updates@learn.mailgun.com` | onboarding series |
| `kunde@ibes.ag` | supplier newsletter |
| `notifications@email.link.com` | marketing |
| `luis.semprun@moodle.com` | cold outreach |
| `nicolas@teammood.io` | cold outreach |
| `johannes@ondeva.com` | cold outreach |
| `hirs@swisscom-tech.de` | cold outreach |
A mail from a known supplier contact that reads like outreach but refers to running business (an open order, an agreed date) is no newsletter: classify it normally. Two senders seen so far need that check every time: `rysanek@raynet.cz` (Raynet is a running vendor) and `Kundeninformation@information.dsv.com` (DSV customer notices can change invoice handling).
## Shared mailboxes
The sender address is a mailbox, the person is in the signature. The signature decides; the table is only the usual case.
| Mailbox (local part) | Usually |
|---|---|
| `Finanzen@…` | Conny Buchwald |
| `FinanzenAZP@…` | Conny Buchwald |
| `erechnung@…` | Conny Buchwald |
| `auftrag.cz@…` | Kateřina Brudíková |
## Adding a pattern
A system sender that matches no row is handled once as a single proposal. In the same proposal list add one numbered item: the new row for this file (sender, subject fragment, kind, target). After approval write the row here, and name the matching Outlook rule as a `Für dich:` point, since the connector cannot create rules.