inboxer 0.4.4 → 0.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -195,13 +195,17 @@ Two domains are involved, and they are configured separately:
195
195
 
196
196
  The app's host name does not have to match the addresses. A name like `inboxer.` avoids confusion with mail-server hosts such as `mail.`. The steps below use these two examples.
197
197
 
198
- 1. **Deploy Inboxer first.** Point `inboxer.example.com` at your server, serve it over HTTPS (roster-server issues certificates on its own; otherwise use your reverse proxy), and set `publicUrl` to that URL. The webhook and login links depend on it.
199
- 2. **Add the domain in Resend.** In *Domains*, add `example.com`. Resend lists the DNS records to create at your DNS provider: the SPF and DKIM records for sending, and the MX record for receiving. Enable receiving for the domain. Wait until Resend shows the domain as verified.
200
- 3. **Mind the MX switch.** Once the MX record points to Resend, every address of the domain is delivered to Resend and no longer to your previous mail host or forwarding rules. Mail to addresses you did not configure still reaches Inboxer, in the `catchall` mailbox. If you need to keep the root domain on another host, use a subdomain such as `help.example.com` for Inboxer's addresses.
201
- 4. **Add DMARC.** Create a TXT record at `_dmarc.example.com`, for example `v=DMARC1; p=none; rua=mailto:dmarc@example.com`, and tighten the policy once reports look clean.
198
+ 0. **Sign up at Resend and add the domain.** Create an account at [resend.com](https://resend.com). In *Domains*, add `example.com` and enable receiving for it. Resend then lists the four DNS records below with the exact values for your account. Copy each value from there: keys and regions differ per domain, and the ones below are examples.
199
+ 1. **TXT — DKIM.** Name `resend._domainkey`, value the public key Resend shows (`p=MIGfMA0GCSq…`). It signs outgoing mail.
200
+ 2. **MX and TXT — `send`.** The `send` subdomain handles bounces and SPF for outgoing mail. MX `send` → `feedback-smtp.us-east-1.amazonses.com`, priority `10`. TXT `send` → `v=spf1 include:amazonses.com ~all`.
201
+ 3. **TXT — DMARC.** Name `_dmarc`, value `v=DMARC1; p=none; rua=mailto:dmarc@example.com`. Tighten the policy once reports look clean. Resend does not require this record, but mailbox providers increasingly do.
202
+ 4. **MX — receiving.** Name `@` (the domain itself), value `inbound-smtp.us-east-1.amazonaws.com`, priority `10`. From then on every address of the domain is delivered to Resend and no longer to your previous mail host or forwarding rules; mail to addresses you did not configure lands in Inboxer's `catchall` mailbox. To keep the root domain on another host, put Inboxer's addresses on a subdomain such as `help.example.com` and add this MX there.
203
+
204
+ Wait until Resend shows the domain as verified. That usually takes minutes, sometimes hours while DNS propagates.
202
205
  5. **Create an API key.** In *API Keys*, create a key with full access: Inboxer reads received and sent emails, not just sends. Put it in `provider.apiKey`.
203
- 6. **Create the webhook.** In *Webhooks*, add an endpoint at `https://inboxer.example.com/webhooks/resend` with the `email.received`, `email.sent`, `email.delivered`, `email.bounced`, `email.failed` and `email.suppressed` events. Copy its signing secret into `provider.webhookSecret`.
204
- 7. **Restart and test.** Restart Inboxer so it loads the secrets. Send an email from an outside account to `support@example.com`. Within seconds it should appear in the UI's Inbox and in `list_threads`. Resend's webhook page shows each delivery and Inboxer's response; a `401` means the signing secret is wrong.
206
+ 6. **Deploy Inboxer.** Point `inboxer.example.com` at your server, serve it over HTTPS (roster-server issues certificates on its own; otherwise use your reverse proxy), and set `publicUrl` to that URL. The webhook and login links depend on it.
207
+ 7. **Create the webhook.** In *Webhooks*, add an endpoint at `https://inboxer.example.com/webhooks/resend` with the `email.received`, `email.sent`, `email.delivered`, `email.bounced`, `email.failed` and `email.suppressed` events. Copy its signing secret into `provider.webhookSecret`.
208
+ 8. **Restart and test.** Restart Inboxer so it loads the secrets. Send an email from an outside account to `support@example.com`. Within seconds it should appear in the UI's Inbox and in `list_threads`. Resend's webhook page shows each delivery and Inboxer's response; a `401` means the signing secret is wrong.
205
209
 
206
210
  Inbound webhooks carry no body, so Inboxer fetches each message from the receiving API. The webhook answers `500` when processing fails, so Resend retries; processing is idempotent by Resend id.
207
211
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "inboxer",
3
- "version": "0.4.4",
3
+ "version": "0.4.6",
4
4
  "description": "A self-hosted mail layer for agents: persists every inbound and outbound email, exposes an MCP server, and ships a minimal UI to review drafts.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
package/src/ui/routes.ts CHANGED
@@ -108,8 +108,9 @@ export function registerUi(app: Hono<UiEnv>, mail: Mail, access: Access, cfg: In
108
108
  };
109
109
 
110
110
  app.get("/", async c => {
111
- const drafts = await mail.listDrafts(undefined, c.get("session").scope);
112
- return page(c, S.navDrafts, V.inboxPage(V.draftList(drafts, null), null), "drafts");
111
+ const session = c.get("session");
112
+ const drafts = await mail.listDrafts(undefined, session.scope);
113
+ return page(c, S.navDrafts, V.inboxPage(V.draftList(drafts, domainsOf(session), null), null), "drafts");
113
114
  });
114
115
 
115
116
  app.get("/drafts/:id", async c => {
@@ -118,7 +119,7 @@ export function registerUi(app: Hono<UiEnv>, mail: Mail, access: Access, cfg: In
118
119
  if (draft.status !== "draft") return c.redirect(`/threads/${draft.thread_id}?status=all`, 303);
119
120
  const { thread, view } = await threadPane(c, draft.thread_id, "/");
120
121
  const drafts = await mail.listDrafts(undefined, session.scope);
121
- return page(c, thread.subject || S.navDrafts, V.inboxPage(V.draftList(drafts, draft.id), view), "drafts", 200, true);
122
+ return page(c, thread.subject || S.navDrafts, V.inboxPage(V.draftList(drafts, domainsOf(session), draft.id), view), "drafts", 200, true);
122
123
  });
123
124
 
124
125
  app.get("/drafts/:id/card", async c => c.html(await draftView(c, c.req.param("id"))));
@@ -75,7 +75,7 @@ body.full .tabbar { display: none; }
75
75
  display: flex; flex-direction: column; gap: 4px;
76
76
  padding: 20px 14px; border-right: 1px solid var(--line);
77
77
  }
78
- .brand { font-size: 20px; font-weight: 700; letter-spacing: -0.03em; padding: 0 12px; }
78
+ .brand { font-size: 21px; line-height: 1.2; font-weight: 700; letter-spacing: -0.03em; text-transform: lowercase; padding: 0 12px; }
79
79
  .brand span { color: var(--accent); }
80
80
  .new-mail { display: flex; align-items: center; justify-content: center; gap: 8px; height: 44px; border-radius: 12px; margin: 16px 0 14px; }
81
81
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
@@ -103,8 +103,9 @@ body.full .tabbar { display: none; }
103
103
  body.context-open .split .list { display: none; }
104
104
  }
105
105
 
106
- .list-head { padding: 18px 16px 12px; }
106
+ .list-head { padding: 20px 16px 12px; }
107
107
  .list-head h1 { font-size: 21px; line-height: 1.2; letter-spacing: -0.02em; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
108
+ .list-head small { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-left: 4px; }
108
109
  .filters { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
109
110
  .chips { display: flex; flex: none; gap: 8px; }
110
111
  .filters .select { min-width: 0; }
@@ -200,8 +201,9 @@ button.thread-title:hover { background: var(--soft); border: none; }
200
201
  }
201
202
  .composer textarea:focus { border-color: var(--focus); }
202
203
  .composer .send { width: 44px; height: 44px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }
203
- .reply-all { flex-basis: 100%; display: flex; align-items: center; gap: 8px; padding: 2px 8px; font-family: var(--mono); font-size: .72rem; color: var(--muted); cursor: pointer; }
204
- .reply-all input { accent-color: var(--accent); }
204
+ .reply-all { flex-basis: 100%; display: flex; align-items: center; gap: 8px; padding: 2px 0; font-family: var(--mono); font-size: .72rem; color: var(--muted); cursor: pointer; }
205
+ /* Centered over the + button below it, which is 44px wide. */
206
+ .reply-all input { width: 16px; height: 16px; margin: 0 0 0 14px; flex: none; accent-color: var(--accent); }
205
207
 
206
208
  /* Context: a side panel on a wide screen, a bottom sheet on a phone */
207
209
  .context-panel { display: none; background: var(--bg); }
package/src/ui/views.ts CHANGED
@@ -369,10 +369,17 @@ export function draftDone(id: string, text: string): View {
369
369
  return h`<article class="card notice" id="draft-${id}">${text}</article>`;
370
370
  }
371
371
 
372
+ /** A list's title: the session's sending domains, with the list's name beside them. */
373
+ function listTitle(domains: string[], label: string): View {
374
+ return domains.length
375
+ ? h`<h1>${domains.join(" · ")} <small>${label}</small></h1>`
376
+ : h`<h1>${label}</h1>`;
377
+ }
378
+
372
379
  /** Drafts waiting for review, listed like the inbox; each opens its thread. */
373
- export function draftList(drafts: Message[], current: string | null): View {
380
+ export function draftList(drafts: Message[], domains: string[], current: string | null): View {
374
381
  return h`<section class="list">
375
- <header class="list-head"><h1>${S.navDrafts}</h1></header>
382
+ <header class="list-head">${listTitle(domains, S.navDrafts)}</header>
376
383
  ${drafts.length ? join(drafts.map(d => h`<a class="row" href="/drafts/${d.id}" ${raw(d.id === current ? 'aria-current="page"' : "")}>
377
384
  <span class="avatar" aria-hidden="true">${initials(d.to[0] ?? d.mailbox)}</span>
378
385
  <span class="row-main">
@@ -404,7 +411,7 @@ export function threadList(threads: Thread[], opts: { mailboxes: string[]; domai
404
411
  h`<a class="chip" href="/inbox?${inboxQuery({ ...filter, status })}" ${raw(filter.status === status ? 'aria-current="page"' : "")}>${label}</a>`;
405
412
  return h`<section class="list">
406
413
  <header class="list-head">
407
- <h1>${opts.domains.length ? opts.domains.join(" · ") : S.navInbox}</h1>
414
+ ${listTitle(opts.domains, S.navInbox)}
408
415
  <form class="filters" method="get" action="/inbox">
409
416
  <input type="hidden" name="status" value="${filter.status}">
410
417
  <nav class="chips" aria-label="${S.filter}">${tab("unanswered", S.filterPending)}${tab("all", S.filterAll)}${tab("archived", S.filterArchived)}</nav>