Commit Graph
27 Commits
Author SHA1 Message Date
Hieu Nguyen (Jack) 52e778ae18 Merge main into feat/pt-br-navigation 2026-10-07 12:25:51 +07:00
Hieu Nguyen (Jack)andClaude Sonnet 5.5 eb64be1c56 Add translation vars, plurals, server translator and RTL support
- t(key, vars) interpolates {placeholders}; numeric count picks a CLDR plural variant
- createTranslator(locale) shares the translator with server code
- registry entries accept dir: "rtl"; layout and provider set <html dir>
- DialogContent translates its close label itself (closeLabel stays an override)
- memoize the language context value, merge double map in dashboard-nav

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-07 12:24:54 +07:00
Hieu Nguyen (Jack)andClaude Sonnet 5.5 b5bd28280b Fix recipient-display test bundling and contain email paint in reader
Stub the DOM-only email HTML module in the recipient-display test bundle,
since css-tree/parse5 do not bundle for node. Add contain:paint to the
reader host so fixed/absolute email CSS cannot cover the app UI.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-07 12:14:06 +07:00
nailao 2b918b8285 Preserve email styles with isolated rendering and remote content controls 2026-10-07 00:55:31 +08:00
forge-z db5a39362a Centralize locale registration for extensible localization 2026-10-06 13:39:46 -03:00
midego 4b7adb748d feat(import): import whole IMAP folders in batches, harden model list and domain removal
- IMAP import: walk a folder newest-first in batches of up to 100 via an
  `offset` / `nextOffset` pair, so folders with more than 100 messages can be
  imported completely. The import page loops until every folder is done and
  shows progress. The per-request limit stays at 100 (default 100).
- IMAP import: recognise iCloud `Sent Messages` and `Deleted Messages`.
- Agent model list: use `redirect: "manual"` instead of `"error"` so
  providers that redirect do not fail the request with a generic error.
- Domains: require typing the hostname before removing a domain, since
  removal deletes the domain's mailboxes and all their messages.
- Add tests for the batch selection helper.
2026-10-06 06:50:20 +07:00
midego 2b7d78bac7 Auto-delete Trash and Spam after a chosen number of days
Adds Settings > Inbox > Trash and Spam clean-up (closes #68, part 2).

- users.trash_retention_days (null = never) via GET/PATCH /api/settings/trash-retention
- messages.trashed_at, kept current by triggers whichever code path changes status
- Scheduled maintenance purges expired messages in batches of 200 (Workers cron and Node scheduler)
2026-10-05 10:48:51 +07:00
midego b0ee52c37d Permanently delete messages from Trash and Spam
Adds a "Delete forever" action and an "Empty Trash"/"Empty Spam" button so
mail can be removed for good from the web UI (closes #68, part 1).

- Bulk action "delete" only destroys messages already in Trash or Spam
- POST /api/messages/empty empties a mailbox's Trash or Spam in batches
- Message view: the delete button becomes "Delete forever" in Trash/Spam
- Every removal deletes R2 objects and writes an email.delete audit entry
2026-10-05 10:35:24 +07:00
forge-z 39bd236502 Add English and Brazilian Portuguese language selection for email navigation 2026-10-04 16:28:08 -03:00
Hieu Nguyen (Jack) be1fe4e3fc Add support for Resend + AWS SES 2026-10-03 11:56:52 +07:00
Hieu Nguyen (Jack) 9edd49d1be Merge pull request #65 from siwel/fix/routing-rule-blank-forward-address
fix(routing): accept a blank forwarding address on deliver and reject rules
2026-10-01 16:59:57 +07:00
lewisandClaude Opus 5.5 61d7dd0883 fix(routing): accept a blank forwarding address on deliver and reject rules
The domain rule dialog submits its whole form state, so "Deliver to
mailbox" and "Reject / block" rules arrive with forwardTo: "". The
schema only allowed an email or null, so those requests failed with a
400 that the dialog shows as "Request failed". This blocked creating
the "*" catch-all, editing such rules, and toggling them on or off.

Treat a blank forwardTo as null. Forward rules still require a valid
address through the existing superRefine check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 15:19:20 +07:00
ssthormess 8d08551b3c Show the recipient address, with an optional full form
Inbound To no longer says "me". To, Cc, and Bcc show the mailbox
address. A switch on the signed-in user, under Settings → Inbox,
shows Name <user@domain.tld> when the header includes a display name.
2026-09-30 07:07:23 -05:00
Hieu Nguyen (Jack) 442dffdc8d Merge PR #60 and preserve booking usernames in shared account creation 2026-09-30 15:16:13 +07:00
Hieu Nguyen (Jack) acf043f7dd perf: optimize message lists with bounded conversation queries 2026-09-30 15:11:11 +07:00
lewis f73b80fd93 Allow choosing aliases when creating accounts 2026-09-29 19:08:41 +07:00
Hieu Nguyen (Jack) 4c5d093d83 Fix #49 2026-09-28 17:21:52 +07:00
James 26923a4cb9 Migrate Cloudflare runtime from OpenNext to vinext 2026-09-27 20:29:09 +01:00
Hieu Nguyen (Jack) b4ab412f7d improve agent 2026-09-27 17:27:17 +07:00
Hieu Nguyen (Jack) da9b803bdb added MCP / Agent 2026-09-27 13:57:31 +07:00
c1441cedd5 feat(jmap): Email/import for MIME-composing clients, and the header query filter (#46)
* fix(jmap): answer the header filter in Email/query instead of ignoring it

conditionToSql() had no `header` branch, so a condition it did not
recognise was dropped and the query matched every message in the
mailbox. A client that de-duplicates drafts by Message-ID before
importing therefore either adopted an unrelated draft or refused to
send because "multiple remote drafts" came back.

Handle `header` per RFC 8621 §4.4.1 from the columns Mailflare already
stores — Message-ID, In-Reply-To and References — and make every other
header name an `unsupportedFilter` error, which is what RFC 8620 §5.5
requires of a filter the server cannot apply. Message-IDs compare
without angle brackets, since inbound rows store them and outbound rows
do not, and header names are matched case-insensitively.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* feat(jmap): Email/import so MIME-composing clients can send

Clients that build MIME locally — Flectar Mail and anything else on the
jmap-client crate — send by uploading the raw message, importing it into
Drafts and submitting it. Email/import answered `unknownMethod`, so
reading worked but every send failed.

Implement it for the Drafts mailbox (RFC 8621 §4.8). The blob must be an
upload this account owns, the target exactly one Drafts mailbox, and the
parsed From has to pass the same getAuthorizedSenderAddress() check a
draft created through Email/set does; anything else comes back in
notCreated as blobNotFound, invalidProperties, invalidEmail, forbidden
or tooLarge. Importing into arbitrary mailboxes is deliberately left
out: delivered mail belongs to the inbound pipeline, which owns
threading, spam scoring and inbound state.

The parsed headers fill the same columns Email/set create writes —
Email/set create and Email/import now share one insert and one target
rule — plus providerMessageId, which is what lets the client find its
own draft again with a Message-ID filter. The uploaded bytes are kept
verbatim under `drafts/<messageId>.eml`, so downloading the message's
blob returns the client's own MIME instead of the rebuilt minimal
message, and the jmap-uploads object is released once claimed.

Email/copy and Email/parse stay unsupported.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* test(jmap): cover Email/import validation and the header filter

tests/jmap-email-import.test.mjs is a node:test file over the pure
pieces — the mailbox rule, keyword and receivedAt parsing, and the SQL
Email/query builds for header conditions, including the unsupportedFilter
throw and the regression that a Message-ID filter narrows the mailbox
instead of matching every draft. The modules are TypeScript behind the
`@/*` alias, so they are bundled with the esbuild the repo already uses
for the self-hosted server rather than loaded directly; nothing here
needs a Workers binding.

scripts/jmap-import-check.mjs is the end-to-end pass against
`npm run dev`: upload a multipart message with an attachment, import it,
read it back, download the blob byte-for-byte, query it by Message-ID,
submit it, and check every rejection path.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* docs(jmap): document Email/import and the header query filter

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(jmap): clean up imported draft objects

---------

Co-authored-by: egamer24 <25360766+egamer24@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Hieu Nguyen (Jack) <nc.hieu@live.com>
2026-09-18 15:16:52 +07:00
rome-xi 4a6328557f fix(domains): skip Worker catch-all on Node/Docker runtime (#42) (#44)
Self-hosted Node/Docker has no Email Worker named mailflare, so the
catch-all PUT 404s (Cloudflare code 2016) during domain setup even when
CF_TOKEN can edit zone routing. Gate ensureEmailRoutingCatchAllToWorker
with isNodeRuntime; Workers still bind catch-all as before.
2026-09-18 15:08:29 +07:00
Edgard Navarro-ClemonsandClaude Opus 5 9719ced1d3 fix(mailboxes): give each personal mailbox its own name and avatar
Renaming any personal mailbox renamed all of them. The account profile and
every personal mailbox shared one identity: syncPersonalIdentity wrote the
profile name and avatar to every row matching (userId, type = 'personal'),
PATCH /api/mailboxes/[id] redirected a rename into that sync instead of the
mailbox row, and both the list response and the client overrode whatever was
stored with the account name. Outgoing mail and message lists did the same,
so a secondary mailbox also sent under the account owner's name.

Only the primary mailbox — the one at the account address — carries the
account identity now. Every other personal mailbox keeps the name and avatar
it was given. The rule lives in one place, lib/profile/identity-utils.ts, and
the API routes, the sender, and the client all go through it.

Existing secondary mailboxes keep whatever name the old blanket update left
on them until they are renamed; the rename now sticks.

Fixes #36

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-11 16:26:48 -07:00
Hieu Nguyen (Jack) c5cfa1be6d Added Spam filter 2026-09-08 15:42:33 +07:00
Hieu Nguyen (Jack) dca90d67ed Merge origin/main into domain sending setup 2026-09-08 12:04:24 +07:00
Hieu Nguyen (Jack) c170b8a1e0 Add switch setting for sending 2026-09-08 11:59:21 +07:00
rome-xi ac4bd9839a fix(setup): sync fresh D1 bootstrap schema with migrations 0013/0021/0022
Signed-off-by: rome-xi <rome-xi@users.noreply.github.com>
2026-09-01 12:43:05 +00:00