Skip to content

feat(email): integrate private mail runtime, APIs and mailbox UI - #308

Draft
tamaina wants to merge 20 commits into
developfrom
feat/email-live-integration
Draft

tamaina wants to merge 20 commits into
developfrom
feat/email-live-integration

Conversation

@tamaina

@tamaina tamaina commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

2026-11-21 配送再試行・添付取得・MFM表示のフォローアップ

最新 head: ae6272b45ae33f59a379115eea91534381b59aaf。この差分は #308 のみで、#306 は変更していません。

  • 受理済みの配送は、原文の再保存や現在の受信設定を確認する前に、永続化済みの受領記録を照合します。原文ハッシュ・エンベロープ送信者が異なる再利用は拒否し、新規宛先の一時失敗で既存の受理結果を失いません。
  • 添付取得では原文取得より先に処理枠を確保し、混雑は 429、取得・処理障害は 503、対象なしは 404 を返します。混雑で拒否したリクエストは原文を読み込みません。
  • feat(markup): standalone MFM renderer #307 からは 1bc05e23f961ac01de04e512e40e415226def2e8 の修正だけを取り込みました。旧形式のロケール指定と日時フォールバック、単体HTMLでのぼかし解除を検証しています。

ローカル検証: backend bundle、メールの実ビルドを使った合成テスト12件、隔離したUnixソケットのPostgreSQL 17での43件(skipなし)、メールAPI 8件とOpenAPI上の添付エラー宣言、standalone MFM 20件、変更ファイルlint(エラーなし)、SPDX、locale safety、差分チェック。最後の型注記のみの差分は生成JavaScriptが同一であることを確認しました。GitHub CIの結果は最新headのChecksを参照してください。

共通API側の別作業はここに含めていません。実MTA/S3/Redisや外部メールクライアントの運用検証、メール送信、マージ、デプロイは行っていません。以下は以前のheadでの経緯です。

Mail browser regression follow-up

Head df7a37f7db499e17442babc0a983031f0d3b853f fixes two mailbox UI races: a failed enable/disable request now keeps the checkbox aligned with confirmed server state, and back navigation is disabled while a pending read updates the selected message.

The actual Vue mail page/component and Japanese locale now run in an isolated Chromium fixture, wired into the feature frontend CI workflow. All 10 browser scenarios passed locally (Chromium 151): signed-out/unavailable/disabled views; pagination/read/unread; native raw/attachment downloads; deletion confirmation; opaque scriptless received HTML with no external requests; MFM preview and same-key send retry; forwarding-link cleanup without automatic confirmation; configuration failure recovery; pending-read navigation; mobile layout. Mobile/desktop screenshots were also inspected. The six existing UI/security regressions, changed-file typed lint, fixture lint, SPDX and locale safety passed. Final-head CI completed: all 18 workflows succeeded, with no failures or pending runs. Feature frontend CI passed all 10 mail browser scenarios on Chromium 156; Lint/typecheck CI passed all 16 jobs; Backend CI passed all five jobs, including all 42 mail PostgreSQL tests with zero skips on both supported Node versions.

API/auth/dialog/router adapters are synthetic. No real email, service configuration, merge or deployment occurred. Full application integration, live relay/S3/Redis interoperability and external email-client rendering remain unverified. The 42-test real PostgreSQL concurrency follow-up below remains intact; no backend or migration changed in this round. Local validation was serialized with the shared lock; the slot is released and only this task's copied dependencies were removed.

CHANGELOG candidate: メール設定の保存失敗時の表示ずれと、既読処理中の一覧への移動による競合を修正。

PostgreSQL concurrency follow-up

Head 7302145d9cdd2744e073f6382ecbd5886bd610a3 adds a disposable Unix-socket PostgreSQL runner and runs it in backend CI for both supported Node versions. The concurrency fixture uses a transaction rendezvous and distinct pg_backend_pid() assertions for staging, delivery retry deduplication, double deletion, mailbox/spool quotas, send idempotency and competing submission-worker claims. It also preserves owner-only raw/deletion assertions and uses TypeORM-compatible query results.

Local PostgreSQL 17: all 42 mail persistence/submission tests passed, with zero skips; changed-file lint, SPDX and locale safety passed. SMTP and object storage are in-memory doubles, with no external mail delivery. Production implementation, permissions and migrations are unchanged. Validation was serialized with the shared lock and independent dependency copies; the local slot is released. Final-head CI completed: 20 workflows succeeded, Storybook was conditionally skipped, and no runs failed or remain pending. Backend CI passed all five jobs, including this PostgreSQL fixture on both Node versions. Lint/typecheck CI passed all 16 jobs. Live relay/S3/Redis integration, external-service crash recovery and browser validation remain outside this verification. No merge or deployment.

2026-11-16 develop follow-up

Integration head: d63a917511d0060a9caf36af738c0bc2ec5ad8b3, integrating develop 039982e806c3b4b0c9b1095b390b8ec4c9d43553. The previous head caf55046 is the first parent, preserving all #306/#307 history.

Actual conflicts were limited to six authentication PostgreSQL test fixtures. The resolution preserves migration timestamp-order/required-policy assertions and policy-suffix down/up coverage, together with develop's no-pending-migrations assertions. Email/markup implementation, authentication contracts and existing migration bodies remain unchanged.

Local validation passed: 115 authentication PostgreSQL/Redis tests, 9 MCP PostgreSQL tests, 44 legacy chat webhook tests, changed-file lint, SPDX and locale safety. Validation used independent dependency copies and the shared serial lock. An initial dependency copy and one fixture setup hit temporary filesystem quota; only this task's partial copies/caches and stopped fixture data were cleaned. The previously blocked fixture then passed. Source dependency metadata remained unchanged; no external symlinks or shared hardlinks were introduced. No new live MTA/S3/browser validation in this integration-only round. Latest-head CI completed: 20 workflows succeeded, Storybook conditionally skipped, no failures or pending runs. Backend CI passed all five jobs; Lint CI passed all 16 jobs. No PR merge or deployment.

Summary

Connect the #254–257 mail foundation and standalone MFM renderer to an opt-in runtime, owner-only APIs, and mailbox UI. Includes the foundation and markup commits from draft PRs #306 and #307; this integration draft should not be merged alongside those without reconciling the overlapping history.

  • Loopback authenticated HTTP MTA handoff and stable-delivery-ID CLI, bounded raw input, durable per-recipient acceptance, private S3 storage and quota enforcement.
  • Dedicated parsing/submission workers, DB outbox reconciliation, durable submission state, safe partial-recipient retries and conservative unknown handling after uncertain SMTP outcomes.
  • Owner-only session APIs with typed SDK routing, inbox/raw/attachment access, sent state, idempotent sending and one-use forwarding verification.
  • Mailbox page/window/Deck column, text/MFM compose and preview, attachment download, settings and confirmation-link cleanup.
  • Forwarding revision and destination rechecks, sender-identity checks, finite spool retention, reversible migrations and operator documentation.

Safety and limitations

Disabled by default. No merge, deployment, DNS, live MTA/S3 configuration or real external email delivery was performed. Forwarding requires explicit operator safety contracts (trusted ingress, loop checking and forwarding relay). The HTTP bridge is not an SMTP/LMTP server.

Real PostgreSQL multi-connection mail concurrency is now covered by the follow-up above. Deployed MTA/S3/Redis end-to-end flows remain unverified. PGlite alone does not prove interconnection lock behavior. Received remote/CID images and clickable HTML links remain blocked; attachments download through owner checks. Mail MFM currently uses text fallback for custom emoji rather than resolving/embedding external assets. Major email-client rendering and browser visual/E2E QA remain required. Uncertain submissions are not automatically resent; an administrator must reconcile with relay logs.

Verification

  • Backend production bundle: pass.
  • Backend source typecheck: pass using TypeScript 7 single-thread mode with bounded Go memory.
  • Email node tests with PGlite: 60 pass, 1 skipped (real PostgreSQL concurrency).
  • API contract/authorization tests: 8 pass.
  • Standalone MFM tests: 17 pass.
  • SDK build and portable contract scan: pass (350 modules).
  • i18n build: pass.
  • Aggregate shipping lint, SPDX and locale safety: pass on final committed source.
  • Frontend Vue typecheck: blocked by heap OOM (exit 134). Frontend production build: killed by environment (SIGKILL). Focused SFC/security/download tests pass; no full frontend or browser E2E pass is claimed.

CHANGELOG candidate

  • Feat: 管理者が有効化できるユーザーメールの受信・送信・確認付き転送と、MFM 対応メール画面を追加(要専用 MTA・非公開ストレージ設定)。

Refs #254, #255, #256, #257. Kept draft: operational validation and remaining rendering limitations are explicit above.

Cloudflare R2 compatibility note

The current private-mail storage implementation does not support Cloudflare R2: Cloudflare’s S3 compatibility table lists GetPublicAccessBlock, GetBucketPolicyStatus and GetBucketAcl as unimplemented. These checks are mandatory, so verification fails closed and raw-mail put/get/delete operations remain blocked rather than bypassing privacy checks. This conclusion is based on the current code and official documentation; no live R2 bucket was tested. Supporting R2 requires a dedicated implementation and tests that separately verify its independent r2.dev and custom-domain public-access routes.

2026-11-16 develop integration verification

Merged develop 9f85e84e while preserving the existing email/markup work and the #306/#307 ancestry. OpenAPI inverse coverage now accounts for all 521 operations (481 legacy, 27 security, 13 mail).

  • This integration round passed 97 focused API/MFM/mail/SQL tests; the real PostgreSQL multi-connection mail concurrency test remains skipped. SQL coverage used an isolated PGlite instance. SDK/i18n/Reversi/backend builds and aggregate shipping lint/SPDX/locale passed.
  • Follow-up caf55046 fixes only tests: migration fixtures check all registered migrations in timestamp order and retain required authentication migrations; the canonical CSS parity test uses Vitest's file path to work in both CommonJS and ESM. No authentication implementation or migration body was changed.
  • Follow-up validation passed all 115 tests in six owned PostgreSQL 17/Redis 8 fixtures, the complete backend test-project typecheck, 10 standalone MFM tests, and changed-file typed lint. All 369 migrations and the policy suffix down/up cycle were verified with no pending DDL.
  • Independent review found no required additional fix. New-head CI is running; CI uses PostgreSQL 18. The preceding unit CI attempt failed before test startup because host port 54312 was already occupied. No browser UI or live MTA/S3 verification was added in this conflict-resolution round.

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

このPRによるapi.jsonの差分

11287 追加行 / 0 削除行 (420990 bytes)

大きい差分のため、先頭8 KiBのみ表示します。全文とbase/head JSONはartifactに保存しています。

差分の先頭(省略あり)
--- base
+++ head
@@ -163881,6 +163881,11293 @@
   },
   "openapi": "3.1.1",
   "paths": {
+    "/email/state": {
+      "post": {
+        "operationId": "post___email___state",
+        "tags": [
+          "email"
+        ],
+        "requestBody": {
+          "required": true,
+          "content": {
+            "application/json": {
+              "schema": {
+                "allOf": [
+                  {
+                    "type": "object",
+                    "properties": {},
+                    "required": []
+                  },
+                  {}
+                ],
+                "type": "object",
+                "properties": {},
+                "required": [],
+                "$schema": "https://json-schema.org/draft/2020-12/schema"
+              }
+            }
+          }
+        },
+        "responses": {
+          "200": {
+            "description": "OK",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "type": "object",
+                  "properties": {
+                    "available": {
+                      "type": "boolean"
+                    },
+                    "enabled": {
+                      "type": "boolean"
+                    },
+                    "address": {
+                      "anyOf": [
+                        {
+                          "type": "string"
+                        },
+                        {
+                          "type": "null"
+                        }
+                      ]
+                    },
+                    "usedBytes": {
+                      "type": "string",
+                      "pattern": "^\\d+$"
+                    },
+                    "quotaBytes": {
+                      "type": "string",
+                      "pattern": "^\\d+$"
+                    },
+                    "forwarding": {
+                      "type": "object",
+                      "properties": {
+                        "address": {
+                          "anyOf": [
+                            {
+                              "type": "string"
+                            },
+                            {
+                              "type": "null"
+                            }
+                          ]
+                        },
+                        "verified": {
+                          "type": "boolean"
+                        },
+                        "enabled": {
+                          "type": "boolean"
+                        },
+                        "keepLocalCopy": {
+                          "type": "boolean"
+                        },
+                        "revision": {
+                          "type": "number"
+                        }
+                      },
+                      "required": [
+                        "address",
+                        "verified",
+                        "enabled",
+                        "keepLocalCopy",
+                        "revision"
+                      ],
+                      "additionalProperties": false
+                    }
+                  },
+                  "required": [
+                    "available",
+                    "enabled",
+                    "address",
+                    "usedBytes",
+                    "quotaBytes",
+                    "forwarding"
+                  ],
+                  "additionalProperties": false,
+                  "$schema": "https://json-schema.org/draft/2020-12/schema"
+                }
+              }
+            }
+          },
+          "400": {
+            "description": "400",
+            "content": {
+              "application/json": {
+                "schema": {
+                  "type": "object",
+                  "required": [
+                    "error"
+                  ],
+                  "properties": {
+                    "error": {
+                      "anyOf": [
+                        {
+                          "type": "object",
+                          "properties": {
+                            "id": {
+                              "type": "string"
+                            },
+                            "kind": {
+                              "enum": [
+                                "client",
+                                "permission",
+                                "server"
+                              ],
+                              "type": "string"
+                            },
+                            "info": {
+                              "type": "object",
+                              "propertyNames": {
+                                "type": "string"
+                              },
+                              "additionalProperties": {}
+                            },
+                            "code": {
+                              "const": "ACCESS_DENIED"
+                            },
+                            "message": {
+                              "type": "string"
+                            }
+                          },
+                          "required": [
+                            "code",
+                            "message",
+                            "id",
+                            "kind"
+                          ],
+                          "$schema": "https://json-schema.org/draft/2020-12/schema"
+                        },
+                        {
+                          "type": "object",
+                          "properties": {
+                            "id": {
+                              "type": "string"
+                            },
+                            "kind": {
+                              "enum": [
+                                "client",
+                                "permission",
+                                "server"
+                              ],
+                              "type": "string"
+                            },
+                            "info": {
+                              "type": "object",
+                              "propertyNames": {
+                                "type": "string"
+                              },
+                              "additionalProperties": {}
+                            },
+                            "code": {
+                              "const": "INVALID_PARAM"
+                            },
+                            "message": {
+                              "type": "string"
+                            }
+                          },
+                          "required": [
+                            "code",
+                            "message",
+                            "id",
+                            "kind"
+                          ],
+                          "$schema": "https://json-schema.org/draft/2020-12/schema"
+                        },
+                        {
+                          "type": "object",
+                          "properties": {
+                            "id": {
+                              "type": "string"
+                            },
+                            "kind": {
+                              "enum": [
+                                "client",
+                                "permission",
+                                "server"
+                              ],
+                              "type": "string"
+                            },
+                            "info": {
+                              "type": "object",
+                              "propertyNames": {
+                                "type": "string"
+                              },
+                              "additionalProperties": {}
+                            },
+                            "code": {
+                              "const": "MAIL_INVALID_INPUT"
+                            },
+                            "message": {
+                              "type": "string"
+                            }
+                          },
+                          "required": [
+                            "code",
+               

Full diff and API JSON artifact

Workflow Page

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

⚙️ Backend Diagnostics Report

Memory: After GC

Metric @ Base @ Head Δ MAD
HeapUsed 74.8 MB
± 0 MB
78.5 MB
± 0 MB
$\color{orange}{\text{+3.7~MB}}$
$\color{orange}{\text{+5\%}}$
0 MB

Only metrics showing significant changes are displayed.

V8 Heap Snapshot Statistics

Metric @ Base @ Head Δ MAD
$\color{gray}{\rule{8pt}{8pt}}$ Total 87 MB
± 920 B
91 MB
± 384 B
$\color{orange}{\text{+3.8 MB}}$
$\color{orange}{\text{+4.3\%}}$
997 B
$\color{orange}{\rule{8pt}{8pt}}$ Code 24 MB 25 MB $\color{orange}{\text{+942 KB}}$ 2.3 KB
$\color{red}{\rule{8pt}{8pt}}$ Strings 25 MB 26 MB $\color{orange}{\text{+1.4 MB}}$ 505 B
$\color{cyan}{\rule{8pt}{8pt}}$ JS arrays 6.4 MB 6.5 MB $\color{orange}{\text{+155 KB}}$ 0 B
$\color{green}{\rule{8pt}{8pt}}$ Typed arrays 723 KB 747 KB $\text{+24 KB}$ 0 B
$\color{yellow}{\rule{8pt}{8pt}}$ System objects 3 MB 3.1 MB $\text{+75 KB}$ 719 B
$\color{violet}{\rule{8pt}{8pt}}$ Other JS objs 28 MB 30 MB $\color{orange}{\text{+1.2 MB}}$ 134 B
$\color{pink}{\rule{8pt}{8pt}}$ Other non-JS objs 65 KB 66 KB $\text{+1.4 KB}$ 0 B

Download representative heap snapshot: base / head

@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

🖥 Frontend Diagnostics Report

Metric @ Base @ Head Δ MAD
Encoded network 4.1 MB
± 7 B
4.1 MB
± 11 B
$\color{orange}{\text{+33 KB}}$
$\color{orange}{\text{+0.8\%}}$
13 B
Decoded body 3.8 MB
± 0 B
3.8 MB
± 0 B
$\color{orange}{\text{+33 KB}}$
$\color{orange}{\text{+0.9\%}}$
0 B
Same-origin encoded 3.9 MB
± 0 B
3.9 MB
± 0 B
$\color{orange}{\text{+33 KB}}$
$\color{orange}{\text{+0.8\%}}$
0 B
Script encoded 3.3 MB
± 0 B
3.3 MB
± 0 B
$\color{orange}{\text{+27 KB}}$
$\color{orange}{\text{+0.8\%}}$
0 B

Only metrics showing significant changes are displayed.

View details

Requests by resource type
Type Requests Encoded bytes
Base Head Δ Base Head Δ
Document 2 2 0 37 KB 37 KB 0 B
Script 179 179 0 3.3 MB 3.3 MB $\color{orange}{\text{+27 KB}}$
Stylesheet 62 62 0 282 KB 281 KB $\color{green}{\text{-828 B}}$
Fetch 23 23 0 76 KB 83 KB $\color{orange}{\text{+6.9 KB}}$
Image 11 11 0 70 KB 70 KB 0 B
Font 2 2 0 119 KB 119 KB 0 B
Other 9 9 0 173 KB 173 KB $\color{orange}{\text{+9 B}}$
V8 heap snapshot statistics
Metric @ Base @ Head Δ MAD
$\color{gray}{\rule{8pt}{8pt}}$ Total 14 MB
± 9.9 KB
14 MB
± 15 KB
$\text{+40 KB}$
$\text{+0.3\%}$
18 KB
$\color{orange}{\rule{8pt}{8pt}}$ Code 3.3 MB 3.3 MB $\text{+13 KB}$ 1.6 KB
$\color{red}{\rule{8pt}{8pt}}$ Strings 1.6 MB 1.6 MB $\text{+7.2 KB}$ 128 B
$\color{cyan}{\rule{8pt}{8pt}}$ JS arrays 130 KB 130 KB $\text{+108 B}$ 67 B
$\color{green}{\rule{8pt}{8pt}}$ Typed arrays 0 B 0 B 0 B 0 B
$\color{yellow}{\rule{8pt}{8pt}}$ System objects 0 B 0 B 0 B 0 B
$\color{violet}{\rule{8pt}{8pt}}$ Other JS objs 2.6 MB 2.7 MB $\text{+6.5 KB}$ 200 B
$\color{pink}{\rule{8pt}{8pt}}$ Other non-JS objs 6.1 MB 6.1 MB $\text{+16 KB}$ 17 KB

Download representative heap snapshot: base / head

📦 Bundle Stats

Chunk size diff (47 updated, 1 added, 0 removed)
Chunk Base Head Δ Δ (%)
(total) 17 MB 17 MB $\color{orange}{\text{+159 KB}}$ $\color{orange}{\text{+0.9\%}}$
virtual:vite-vue-internationalization/locale/th-TH scripts/hvhWu9yWI-6BUDGO2j.js → scripts/tw81fMbzt-I01gYaPM.js
416 KB 419 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+0.8\%}}$
virtual:vite-vue-internationalization/locale/ru-RU scripts/hvhWu9yWI-De2wrp_j.js → scripts/tw81fMbzt-sBPFwlmJ.js
309 KB 312 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.1\%}}$
virtual:vite-vue-internationalization/locale/uk-UA scripts/hvhWu9yWI-CBYVEasZ.js → scripts/tw81fMbzt-BC07B6HE.js
303 KB 306 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.1\%}}$
virtual:vite-vue-internationalization/locale/bn-BD scripts/hvhWu9yWI-DNymQIjt.js → scripts/tw81fMbzt-By6Q3H_a.js
275 KB 279 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/lo-LA scripts/hvhWu9yWI-DM-W39QP.js → scripts/tw81fMbzt-Banv4mHD.js
275 KB 279 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/si-LK scripts/hvhWu9yWI-BCklwFpA.js → scripts/tw81fMbzt-DKnStZC3.js
275 KB 279 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/el-GR scripts/hvhWu9yWI-1rfwoNGS.js → scripts/tw81fMbzt-BiVNG3xs.js
275 KB 279 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/fa-IR scripts/hvhWu9yWI-BuCLsn8O.js → scripts/tw81fMbzt-DdlkOSze.js
275 KB 279 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/jbo-EN scripts/hvhWu9yWI-B6ey4ku4.js → scripts/tw81fMbzt-wqoqpYgw.js
275 KB 278 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/ja-JP scripts/hvhWu9yWI-CpUax1nh.js → scripts/tw81fMbzt-DOpWox7p.js
275 KB 278 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/ro-RO scripts/hvhWu9yWI-cHjlvOEx.js → scripts/tw81fMbzt-C_T-PIxP.js
275 KB 278 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/tl-PH scripts/hvhWu9yWI-WmFh-QtI.js → scripts/tw81fMbzt-DtmuH8zs.js
275 KB 278 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/ko-GS scripts/hvhWu9yWI-CIQmXLQs.js → scripts/tw81fMbzt-CaJ5Ufcj.js
275 KB 278 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/hu-HU scripts/hvhWu9yWI-D0NOThS3.js → scripts/tw81fMbzt-6zb1PuT-.js
275 KB 278 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/uz-UZ scripts/hvhWu9yWI-IhM6IV_a.js → scripts/tw81fMbzt-B9Ya9pS1.js
275 KB 278 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/sv-SE scripts/hvhWu9yWI-_wg6hYhw.js → scripts/tw81fMbzt-1QjzhZip.js
275 KB 278 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/hr-HR scripts/hvhWu9yWI-FzpAY-OZ.js → scripts/tw81fMbzt-BxjmlR7-.js
275 KB 278 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/ht-HT scripts/hvhWu9yWI-BtOFlaHL.js → scripts/tw81fMbzt-BzBctYs7.js
275 KB 278 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/ja-KS scripts/hvhWu9yWI-ZNUP_OHJ.js → scripts/tw81fMbzt-CL_ZxN8C.js
273 KB 277 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.2\%}}$
virtual:vite-vue-internationalization/locale/de-DE scripts/hvhWu9yWI-BNkDhIaF.js → scripts/tw81fMbzt-Dk82TxzH.js
256 KB 259 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/ko-KR scripts/hvhWu9yWI-C74MFsQK.js → scripts/tw81fMbzt-AeJgqddk.js
255 KB 259 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/ar-SA scripts/hvhWu9yWI-KMowWDhb.js → scripts/tw81fMbzt-Bze66Qpc.js
253 KB 256 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/ca-ES scripts/hvhWu9yWI-4D-oVee6.js → scripts/tw81fMbzt-BlgzwQ1o.js
253 KB 256 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/vi-VN scripts/hvhWu9yWI-DBUdLXRb.js → scripts/tw81fMbzt-CtLztcUu.js
252 KB 255 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/es-ES scripts/hvhWu9yWI-D3EJmvcB.js → scripts/tw81fMbzt-C5H4nCNH.js
251 KB 255 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/fr-FR scripts/hvhWu9yWI-BESGr_Oo.js → scripts/tw81fMbzt-BF_-qzrm.js
250 KB 254 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/tr-TR scripts/hvhWu9yWI-CvwmuTDC.js → scripts/tw81fMbzt-tsk2I7hG.js
250 KB 253 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/it-IT scripts/hvhWu9yWI-DfrzBRAx.js → scripts/tw81fMbzt-BEdvM0W8.js
248 KB 251 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/pt-PT scripts/hvhWu9yWI-B06ksqfl.js → scripts/tw81fMbzt-CxApxdUA.js
247 KB 250 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.3\%}}$
virtual:vite-vue-internationalization/locale/cs-CZ scripts/hvhWu9yWI-6P8kiDNq.js → scripts/tw81fMbzt-DBM44Xb2.js
240 KB 244 KB $\color{orange}{\text{+3.3 KB}}$ $\color{orange}{\text{+1.4\%}}$
(other generated chunks) 2.5 MB 2.5 MB $\color{orange}{\text{+19 KB}}$ $\color{orange}{\text{+0.8\%}}$
(other) 2.8 MB 2.9 MB $\color{orange}{\text{+41 KB}}$ $\color{orange}{\text{+1.4\%}}$
Startup chunk size (0 updated, 0 added, 0 removed)
Chunk Base Head Δ Δ (%)
(total) 130 KB 130 KB 0 B 0%
(other generated chunks) 124 KB 124 KB 0 B 0%
(other) 5.3 KB 5.3 KB 0 B 0%

Startup chunks are the Vite entry for src/_boot_.ts and its static imports.

Bundles Modules Entries Imports Size
Static Dynamic Rendered Gzip Brotli
Base 538 3,214 24 10,884 389 24 MB 6.3 MB 5 MB
Head 540 3,197 24 10,881 390 24 MB 6.3 MB 5 MB
Δ $\color{orange}{\text{+2}}$ $\color{green}{\text{-17}}$ 0 $\color{green}{\text{-3}}$ $\color{orange}{\text{+1}}$ $\color{orange}{\text{+178 KB}}$ $\color{orange}{\text{+50 KB}}$ $\color{orange}{\text{+41 KB}}$
Δ (%) $\color{orange}{\text{+0.4\%}}$ $\color{green}{\text{-0.5\%}}$ 0% $\text{-0\%}$ $\color{orange}{\text{+0.3\%}}$ $\color{orange}{\text{+0.8\%}}$ $\color{orange}{\text{+0.8\%}}$ $\color{orange}{\text{+0.8\%}}$

Open treemap HTML

tamaina commented Nov 21, 2026

Copy link
Copy Markdown
Owner Author

メール原文の非公開保管:PostgreSQL 試作と R2 の判断

#255 の保管方式について、まず既定の S3 経路を変えずに PostgreSQL 案を検証しました。原文は公開 URL や配信ヘッダーに頼らず、専用の bytea テーブルの権限、アプリ側の所有者チェック、ネットワーク制限で保護する案です。

隔離 PostgreSQL 19.0(人工データ、TCP 無効)で 5 件成功・スキップなし。原文と ready 状態の同一トランザクション、コミット前の別接続からの不可視とコミット後のバイト一致、権限なしロールの読み書き拒否と許可ロールの読み取り、途中失敗時の原文ロールバック、サイズ制限と外部キーによる連動削除を確認しました。今回の証拠は DB の試作に限り、アプリ・メール配送・R2 への接続は未実施です。

  • 次の小さな実装案:方針決定後、新規導入時に限り明示選択できる PostgreSQL アダプタを追加し、所有者限定の取得、quota、失敗時の巻き戻し、回収を既存の MailStore 経由で試験します。既定の S3 とそのプライバシー検査はそのまま。既存データの切替・移行は別設計で、WAL/DB 容量・バックアップと復元を確認するまで本番は対象外です。
  • R2 は別案:専用バケットで 管理 URL と独自ドメイン の両方が無効であることを管理 API で再検査し、未確認・エラー時は拒否します。管理用とバケット限定のデータ用資格情報を分離し、Worker 等の公開経路は別途運用で排除します。原文の認証付き暗号化と別管理の鍵は追加防御であり、アクセス制御の代わりにはしません。公開リンクを発行する経路は設けません。実 R2 での互換性は未検証で、既定にはしません。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants