@protobase/cli 0.121.2 → 0.121.3
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/dist/cli/package.js +1 -1
- package/dist/config/build-project.js +2 -0
- package/dist/config/mail-feedback-config.js +9 -0
- package/dist/doctor/built-in-models.js +2 -1
- package/dist/migration/load-project.js +2 -0
- package/dist/migration/parts.js +10 -3
- package/dist/project/project-admin.js +1 -0
- package/dist/serve/startup-checks.js +4 -2
- package/package.json +8 -8
- package/skills/protobase/references/features/email-and-public-forms.md +1 -0
- package/skills/protobase/references/reference/cli.md +1 -1
- package/skills/protobase/references/reference/config/jobs-and-events.md +11 -0
- package/skills/protobase/references/reference/config.md +1 -1
- package/skills/protobase/references/reference/email.md +32 -0
package/dist/cli/package.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { projectDerived, projectFiles, projectFunctions, projectJobs, projectNotifications, projectOptions, projectResources, projectWebhooks, projectWorkflows } from "./project-parts.js";
|
|
2
|
+
import { mailFeedbackOn } from "./mail-feedback-config.js";
|
|
2
3
|
import { projectUnsubscribe } from "./unsubscribe-config.js";
|
|
3
4
|
import { userTablesOn } from "./user-tables-config.js";
|
|
4
5
|
import { buildAppAuth, buildAuthenticator, checkCallsOptions, checkStatusOptions, isOverSignIn, workflowPlugins } from "@protobase/server/internal";
|
|
@@ -91,6 +92,7 @@ const buildProject = async (config, database) => {
|
|
|
91
92
|
...config.status && { status: checkStatusOptions(config.status) },
|
|
92
93
|
...config.calls && { calls: checkCallsOptions(config.calls) },
|
|
93
94
|
...unsubscribe && { unsubscribe },
|
|
95
|
+
...mailFeedbackOn(config) && { mailFeedback: true },
|
|
94
96
|
...mailer && { mailer },
|
|
95
97
|
...config.mobile && { mobile: config.mobile },
|
|
96
98
|
...config.secret && { secret: config.secret },
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
//#region src/config/mail-feedback-config.ts
|
|
2
|
+
/** Whether the app takes its mail's bounces and complaints: the one reading of `mailFeedback`, which takes only true or false. */
|
|
3
|
+
const mailFeedbackOn = (config) => {
|
|
4
|
+
const value = config.mailFeedback;
|
|
5
|
+
if (value !== void 0 && typeof value !== "boolean") throw new Error(`mailFeedback is ${JSON.stringify(value)}; it takes true or false`);
|
|
6
|
+
return value === true;
|
|
7
|
+
};
|
|
8
|
+
//#endregion
|
|
9
|
+
export { mailFeedbackOn };
|
|
@@ -2,7 +2,7 @@ import { builtInResources, configExports, webhooksModule, workflowsModule } from
|
|
|
2
2
|
//#region src/doctor/built-in-models.ts
|
|
3
3
|
/**
|
|
4
4
|
* The resources and views Protobase adds to an app by what its config enables, as the API serves them: the webhook ones
|
|
5
|
-
* of `webhooks` and the workflow ones of `workflows`, then Failed jobs, Activity and Comments by what the app's resources use, and
|
|
5
|
+
* of `webhooks` and the workflow ones of `workflows`, then Failed jobs, Activity and Comments by what the app's resources use, Unsubscribes with `unsubscribe` and Mail feedback with `mailFeedback`. Doctor checks them as it checks
|
|
6
6
|
* the app's own.
|
|
7
7
|
*/
|
|
8
8
|
const builtInModels = (config, models) => {
|
|
@@ -18,6 +18,7 @@ const builtInModels = (config, models) => {
|
|
|
18
18
|
jobs: Object.keys(config.jobs).length > 0,
|
|
19
19
|
notifications: config.notifications !== void 0,
|
|
20
20
|
unsubscribe: config.unsubscribe === true,
|
|
21
|
+
mailFeedback: config.mailFeedback === true,
|
|
21
22
|
...config.events && { events: config.events }
|
|
22
23
|
});
|
|
23
24
|
return {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { loadNearestEnvFile } from "../dev/env.js";
|
|
2
2
|
import { projectJobs, projectNotifications, projectResources, projectWebhooks } from "../config/project-parts.js";
|
|
3
|
+
import { mailFeedbackOn } from "../config/mail-feedback-config.js";
|
|
3
4
|
import { unsubscribeOn } from "../config/unsubscribe-config.js";
|
|
4
5
|
import { userTablesOn } from "../config/user-tables-config.js";
|
|
5
6
|
import { projectAuth } from "../config/build-project.js";
|
|
@@ -49,6 +50,7 @@ const migrationProject = async (config, url) => {
|
|
|
49
50
|
jobs,
|
|
50
51
|
userTables: userTablesOn(config),
|
|
51
52
|
unsubscribe: unsubscribeOn(config),
|
|
53
|
+
mailFeedback: mailFeedbackOn(config),
|
|
52
54
|
readOnlyQueries: assistantSettings(config.assistant, process.env)?.kind === "built-in",
|
|
53
55
|
authTables: auth ? authStoreTables(auth) : {
|
|
54
56
|
tables: [],
|
package/dist/migration/parts.js
CHANGED
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
import { authMigrationTitle } from "../auth/migration-file.js";
|
|
2
|
-
import { authSchemaMigration, callsMigration, capturedBy, changesMigration, channelSendsMigration, commentsMigration, computedMigration, derivedMigration, jobsSchemaMigration, notificationsMigration, ownedDefinitionsMigration, queryRunnerMigration, realtimeRelayMigration, relayMigration, relayed, sqlSends, statusMigration, unsubscribesMigration, userTablesMigration, webhooksMigration, workflowsMigration } from "@protobase/server";
|
|
2
|
+
import { authSchemaMigration, callsMigration, capturedBy, changesMigration, channelSendsMigration, commentsMigration, computedMigration, derivedMigration, jobsSchemaMigration, mailFeedbackMigration, mailFeedbackResource, notificationsMigration, ownedDefinitionsMigration, queryRunnerMigration, realtimeRelayMigration, relayMigration, relayed, sqlSends, statusMigration, unsubscribesMigration, userTablesMigration, webhooksMigration, workflowsMigration } from "@protobase/server";
|
|
3
3
|
//#region src/migration/parts.ts
|
|
4
4
|
/** Every feature the project's config enables, in the order their files are written. */
|
|
5
5
|
const migrationParts = (project) => {
|
|
6
6
|
const comments = project.models.some((model) => model.comments);
|
|
7
7
|
const aiFields = project.models.some((model) => Object.values(model.fields).some((field) => field.ai));
|
|
8
|
+
const feedback = project.mailFeedback ? [mailFeedbackResource.toModel()] : [];
|
|
9
|
+
const captured = [...project.models, ...feedback];
|
|
8
10
|
return [
|
|
9
11
|
...project.auth ? [{
|
|
10
12
|
name: "auth",
|
|
11
13
|
title: authMigrationTitle,
|
|
12
14
|
sql: () => authSchemaMigration(project.auth)
|
|
13
15
|
}] : [],
|
|
14
|
-
...project.jobs.length > 0 ||
|
|
16
|
+
...project.jobs.length > 0 || captured.some(capturedBy(captured)) || comments || aiFields || project.webhooks || project.workflows || project.notifications || project.realtime?.relay ? [{
|
|
15
17
|
name: "jobs",
|
|
16
18
|
title: "The jobs schema this version of Protobase needs",
|
|
17
19
|
sql: () => jobsSchemaMigration(project.db)
|
|
18
20
|
}] : [],
|
|
21
|
+
...project.mailFeedback ? [{
|
|
22
|
+
name: "mail_feedback",
|
|
23
|
+
title: "The table of the bounces and complaints of the mail the app sends",
|
|
24
|
+
sql: () => mailFeedbackMigration(project.db)
|
|
25
|
+
}] : [],
|
|
19
26
|
{
|
|
20
27
|
name: "changes",
|
|
21
28
|
title: "The change capture the resources' events and history need",
|
|
22
|
-
sql: () => changesMigration(project.db, project.
|
|
29
|
+
sql: () => changesMigration(project.db, captured, project.events, feedback.map((model) => model.name))
|
|
23
30
|
},
|
|
24
31
|
{
|
|
25
32
|
name: "computed",
|
|
@@ -39,6 +39,7 @@ const projectAdmin = (project, db, ui, reporter, upgradeWebSocket, userTables) =
|
|
|
39
39
|
...project.notifications && { notifications: project.notifications },
|
|
40
40
|
...project.status && { status: project.status },
|
|
41
41
|
...project.unsubscribe && { unsubscribe: project.unsubscribe },
|
|
42
|
+
...project.mailFeedback && { mailFeedback: true },
|
|
42
43
|
...project.calls && { calls: project.calls },
|
|
43
44
|
...project.mobile && { mobile: project.mobile },
|
|
44
45
|
...project.app && { app: project.app },
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assistantSettings, authStoreTables, checkAuthSchema, checkCalls, checkChanges, checkChannelSends, checkComments, checkComputed, checkDerived, checkNotificationsSchema, checkQueryRunner, checkRealtimeRelay, checkRelaySchema, checkResourcesOutsideAuthStore, checkStatusSchema, checkUnsubscribesSchema, checkUserTablesSchema, checkWebhooksSchema, checkWorkflowsSchema, configExports, relayed, sqlSends } from "@protobase/server";
|
|
1
|
+
import { assistantSettings, authStoreTables, checkAuthSchema, checkCalls, checkChanges, checkChannelSends, checkComments, checkComputed, checkDerived, checkMailFeedbackSchema, checkNotificationsSchema, checkQueryRunner, checkRealtimeRelay, checkRelaySchema, checkResourcesOutsideAuthStore, checkStatusSchema, checkUnsubscribesSchema, checkUserTablesSchema, checkWebhooksSchema, checkWorkflowsSchema, configExports, mailFeedbackResource, relayed, sqlSends } from "@protobase/server";
|
|
2
2
|
//#region src/serve/startup-checks.ts
|
|
3
3
|
/**
|
|
4
4
|
* The server's startup checks of the database: each throws, with what to write as a migration, while a schema the
|
|
@@ -7,9 +7,11 @@ import { assistantSettings, authStoreTables, checkAuthSchema, checkCalls, checkC
|
|
|
7
7
|
*/
|
|
8
8
|
const checkStartup = async (project, db) => {
|
|
9
9
|
const models = configExports(project.config).resources.map((resource) => resource.toModel());
|
|
10
|
+
const captured = project.mailFeedback ? [...models, mailFeedbackResource.toModel()] : models;
|
|
10
11
|
if (project.auth) await checkAuthSchema(project.auth);
|
|
11
12
|
if (project.auth) await checkResourcesOutsideAuthStore(db, models, project.auth);
|
|
12
|
-
|
|
13
|
+
if (project.mailFeedback) await checkMailFeedbackSchema(db);
|
|
14
|
+
await checkChanges(db, captured, project.events);
|
|
13
15
|
await checkComments(db, models);
|
|
14
16
|
await checkDerived(db, models);
|
|
15
17
|
await checkCalls(db, project.calls, project.events);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@protobase/cli",
|
|
3
|
-
"version": "0.121.
|
|
3
|
+
"version": "0.121.3",
|
|
4
4
|
"description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@better-auth/core": "^1.7.12",
|
|
45
45
|
"@hono/node-server": "^2.1.3",
|
|
46
|
-
"@protobase/config": "0.121.
|
|
47
|
-
"@protobase/layout": "0.121.
|
|
48
|
-
"@protobase/query": "0.121.
|
|
49
|
-
"@protobase/schema": "0.121.
|
|
50
|
-
"@protobase/server": "0.121.
|
|
51
|
-
"@protobase/ui": "0.121.
|
|
52
|
-
"@protobase/workflows": "0.121.
|
|
46
|
+
"@protobase/config": "0.121.3",
|
|
47
|
+
"@protobase/layout": "0.121.3",
|
|
48
|
+
"@protobase/query": "0.121.3",
|
|
49
|
+
"@protobase/schema": "0.121.3",
|
|
50
|
+
"@protobase/server": "0.121.3",
|
|
51
|
+
"@protobase/ui": "0.121.3",
|
|
52
|
+
"@protobase/workflows": "0.121.3",
|
|
53
53
|
"@react-email/render": "^2.1.0",
|
|
54
54
|
"@scalar/hono-api-reference": "^0.12.10",
|
|
55
55
|
"@sentry/vite-plugin": "^11.10.0",
|
|
@@ -11,6 +11,7 @@ Mail the app sends, the PDF documents it makes, and forms for people without an
|
|
|
11
11
|
- [Protobase's mail look](../reference/email.md#the-look-of-protobases-own-mail): Your emails use a layout, button, code and note with the look of Protobase's own mail.
|
|
12
12
|
- [Header fields](../reference/email.md#templates): Your emails carry header fields of their own.
|
|
13
13
|
- [One-click unsubscribe](../reference/email.md#unsubscribe) (beta): Mail you mark as bulk carries a one-click unsubscribe, and Protobase stops sending that kind of mail to whoever used it.
|
|
14
|
+
- [Bounces and complaints](../reference/email.md#bounces-and-complaints) (beta): Bounces and spam complaints that Amazon SES or Resend report arrive as Mail feedback records with `bounced` and `complained` events, so a workflow, webhook or your own code can act on them.
|
|
14
15
|
- [Attachments](../reference/email.md#attachments): A message carries files, such as an invoice's PDF, through the app's mail or someone's own mailbox.
|
|
15
16
|
- [PDF documents](../reference/pdf.md#documents): PDF files such as invoices and quotes are React components with typed data, rendered from jobs, hooks or functions and attached to mail as they are.
|
|
16
17
|
- [Mail from your own mailbox](../reference/email.md#from-someones-own-mailbox) (beta): People link their Gmail on the account page, and the app's functions send mail from it; an action offers to connect the mailbox right there when the link is missing or expired.
|
|
@@ -634,7 +634,7 @@ Applies the project's `db/migrations/*.sql` that the database has not applied ye
|
|
|
634
634
|
protobase migration [--dir db/migrations] [--extend <dir>]
|
|
635
635
|
```
|
|
636
636
|
|
|
637
|
-
Writes what the database still needs for every feature the config enables, as the project's next migrations in `--dir`, one file per feature: the auth schema when sign-in is on (`NNN_auth.sql`, as [`auth migration`](#auth-migration) writes it), the [jobs schema](jobs.md#the-jobs-schema) when the config has jobs, `webhooks`, `workflows` or `
|
|
637
|
+
Writes what the database still needs for every feature the config enables, as the project's next migrations in `--dir`, one file per feature: the auth schema when sign-in is on (`NNN_auth.sql`, as [`auth migration`](#auth-migration) writes it), the [jobs schema](jobs.md#the-jobs-schema) when the config has jobs, `webhooks`, `workflows`, `notifications` or `mailFeedback`, or a resource has events, history, comments or an [AI field](ai.md) (`NNN_jobs.sql`), the table of the bounces and complaints of [`mailFeedback`](email.md#bounces-and-complaints) (`NNN_mail_feedback.sql`), the [capture of events](events.md#migrations-and-startup) and the [history table](history.md#the-table) (`NNN_changes.sql`), the columns of [rollup and formula fields](data-config.md#rollups-and-formulas), the triggers that keep the rollups, and the tables, indexes and refresh functions of [time rollups](data-config.md#time-rollups) (`NNN_computed.sql`), the role the [assistant's read-only queries](assistant.md#the-built-in-backend) run as, when it finds the built-in assistant's key (`NNN_query.sql`), the [comments table](comments.md#the-table) (`NNN_comments.sql`), the [webhook subscriptions](webhooks.md#subscriptions-in-the-admin-app) of `webhooks` (`NNN_webhooks.sql`), the [workflows, versions, runs and steps](workflows.md#turning-them-on) of `workflows` (`NNN_workflows.sql`), the [devices and history tables](notifications.md#table-names) of `notifications` (`NNN_notifications.sql`), the table of who unsubscribed from bulk mail of [`unsubscribe`](email.md#unsubscribe) (`NNN_unsubscribes.sql`), the `realtime_relay` schema of [`realtime: { processes: 'many' }`](supabase-realtime.md#several-processes) (`NNN_realtime_relay.sql`), the `channels` schema of [`realtime: { sqlSends: true }`](channels.md#from-sql) (`NNN_channel_sends.sql`), the trigger of [`realtime.relay`](realtime-relay.md#sessions) that ends a deleted session's sockets (`NNN_relay.sql`), and, with [`userTables`](user-tables.md#the-switch), the schemas of user tables (`NNN_user_tables.sql`) and the delete of the definitions of tables that resources in code [own now](user-tables.md#taking-a-table-over-as-code) (`NNN_owned_definitions.sql`). It compares the database, with the project's migrations applied, with the config (for the auth schema, it reads the store's record of the migrations it applied), merged with those of `--extend` as `dev` merges them, and writes nothing when the database is current. Apply the files with the project's other migrations. It reads the `.env` nearest the current directory and needs `DATABASE_URL`.
|
|
638
638
|
|
|
639
639
|
```sh
|
|
640
640
|
bun run db:migrate # the database at the project's current schema
|
|
@@ -386,3 +386,14 @@ Gives bulk mail a one-click unsubscribe: mail a job sends with `bulk: true` and
|
|
|
386
386
|
```ts
|
|
387
387
|
export default defineConfig({ unsubscribe: true })
|
|
388
388
|
```
|
|
389
|
+
|
|
390
|
+
## mailFeedback
|
|
391
|
+
|
|
392
|
+
- **Type:** `boolean`
|
|
393
|
+
- **Default:** `false`
|
|
394
|
+
|
|
395
|
+
Takes the bounces and spam complaints of the mail the app sends as `mail_feedback` records, with the events `mail_feedback.bounced` and `mail_feedback.complained`, at `POST /api/mail/feedback/<provider>` for each provider whose variable is set. The table, `mail.feedback`, and the capture of its events are written by `protobase migration` as migrations of the project's own: apply them with the project's migrations, as `protobase serve` refuses to start while the table is missing. See [Bounces and complaints](../email.md#bounces-and-complaints).
|
|
396
|
+
|
|
397
|
+
```ts
|
|
398
|
+
export default defineConfig({ mailFeedback: true })
|
|
399
|
+
```
|
|
@@ -30,7 +30,7 @@ Each key is described with its type and default in the option pages:
|
|
|
30
30
|
| [Sign-in options](config/sign-in.md) | `auth`, `authenticate`, `signingKeyDays`, `signingKeyGraceDays` |
|
|
31
31
|
| [API options](config/api.md) | `apiPath`, `apiKeys`, `cors`, `defaultAccess`, `rowPermissions`, `statementTimeoutMs`, `scanGuard`, `errorReporting`, `writeHooks`, `mcpEndpoint`, `remoteResources`, `runtimeUpdates`, `realtime`, `calls`, `userTables` |
|
|
32
32
|
| [Admin app options](config/admin-app.md) | `assistant`, `maps`, `plugins` |
|
|
33
|
-
| [Jobs and events options](config/jobs-and-events.md) | `jobs`, `events`, `history`, `webhooks`, `workflows`, `notifications`, `status`, `unsubscribe` |
|
|
33
|
+
| [Jobs and events options](config/jobs-and-events.md) | `jobs`, `events`, `history`, `webhooks`, `workflows`, `notifications`, `status`, `unsubscribe`, `mailFeedback` |
|
|
34
34
|
| [Files options](config/files.md) | `files` |
|
|
35
35
|
|
|
36
36
|
## Config types
|
|
@@ -310,6 +310,37 @@ await mail.send({ to: member.email, subject: 'News', text: '...', bulk: true, to
|
|
|
310
310
|
- <gap>Bulk mail cannot be sent from an API function because only a job's `mail` adds the unsubscribe; enqueue a job instead.</gap>
|
|
311
311
|
- <gap>Email templates cannot be marked bulk because `defineTemplate` does not take `bulk` and `topic` yet.</gap>
|
|
312
312
|
|
|
313
|
+
## Bounces and complaints
|
|
314
|
+
|
|
315
|
+
:::caution[Beta]
|
|
316
|
+
Amazon SES (through SNS) and Resend report to their own endpoints so far, beside the `protobase` one a platform reports to.
|
|
317
|
+
:::
|
|
318
|
+
|
|
319
|
+
A mail provider tells the app when a message bounced or its recipient marked it as spam. With `mailFeedback` on, each report becomes a `mail_feedback` record, one per recipient, with the events `mail_feedback.bounced` and `mail_feedback.complained`, which [workflows](workflows.md), [subscriptions](webhooks.md) and your own code act on, such as marking a contact's address undeliverable. Protobase records and notifies only: it keeps sending to the address, and the app decides what a bounce means.
|
|
320
|
+
|
|
321
|
+
Turn it on in the config, then run `protobase migration`, which writes its table, `mail.feedback`, and the capture of its events as migrations of the project's own; apply them with the project's migrations, as `protobase serve` refuses to start while the table is missing:
|
|
322
|
+
|
|
323
|
+
```ts
|
|
324
|
+
export default defineConfig({ mailFeedback: true })
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
Each provider reports to `POST /api/mail/feedback/<provider>` with the default [`apiPath`](config/api.md#apipath), without sign-in, and has that endpoint only once its variable is set:
|
|
328
|
+
|
|
329
|
+
| Provider | Variable | |
|
|
330
|
+
| --- | --- | --- |
|
|
331
|
+
| `ses` | `PROTOBASE_MAIL_FEEDBACK_SES_TOPICS` | The ARNs of the SNS topics SES publishes bounces and complaints to, separated by commas. Subscribe the endpoint to each topic over HTTPS: the endpoint confirms the subscription itself. |
|
|
332
|
+
| `resend` | `PROTOBASE_MAIL_FEEDBACK_RESEND_SECRET` | The webhook's signing secret, `whsec_...`, of a webhook that sends `email.bounced` and `email.complained` to the endpoint. |
|
|
333
|
+
| `protobase` | `PROTOBASE_SECRET` | The platform secret, which a hosting platform reports bounces and complaints with. |
|
|
334
|
+
|
|
335
|
+
A value that is not a topic ARN or a signing secret stops startup, naming the variable.
|
|
336
|
+
|
|
337
|
+
- **Signatures:** a report writes nothing unless its signature checks out. `ses` takes SNS's signature, versions 1 and 2, with the signing certificate fetched from an SNS host over HTTPS and kept an hour, and only messages of the named topics, since anyone can sign with a topic of their own. `resend` and `protobase` take [Standard Webhooks](https://www.standardwebhooks.com) signatures, made at most five minutes before. A missing or wrong signature answers `401`, another topic `403`.
|
|
338
|
+
- **The record:** `type` is `bounce` or `complaint`; `bounce_type` `hard` (permanent) or `soft` (transient), and empty when the provider could not tell; `recipient`, lower-cased; `message_id`, the `Message-ID` header of the message it is about, when the report states it; `provider_message_id`, the provider's own id of that message; `reason`, as the provider gives it, such as the receiving server's diagnostic, a bounce subtype or a complaint's feedback type; `occurred_at`, when the provider says it happened; `provider`, `event_id`, the provider's id of the report, and `created_at`. A value the report does not state is empty, never guessed. Match it to the mail it answers by the [message id](#message-id) you stored.
|
|
339
|
+
- **Once:** a provider sends a report again when it got no answer in time; the same report writes nothing new. A report of another kind, such as a delivery, answers `204` and writes nothing.
|
|
340
|
+
- **Who sees it:** admins see the reports under **Mail feedback** in the admin app, and the app's code reads them as the `mail_feedback` resource, `GET /api/v1/mail_feedback?filter=recipient = "ada@example.com"`, filtered by `recipient`, `type`, `message_id` or `provider_message_id`. Nobody changes them but the endpoints.
|
|
341
|
+
- **The `protobase` endpoint:** its body is one record as above, without `provider`, `event_id` and `created_at`, such as `{ "type": "bounce", "bounce_type": "hard", "recipient": "ada@example.com", "message_id": "<...>", "reason": "smtp; 550 5.1.1 user unknown" }`, signed as Standard Webhooks with a key derived from `PROTOBASE_SECRET`, so the secret itself never travels: `mailFeedbackHeaders(secret, id, body)` of `@protobase/server` makes the headers. `webhook-id` names the report, and a retry keeps it.
|
|
342
|
+
- <gap>Other mail providers cannot report bounces and complaints because only the `ses`, `resend` and `protobase` endpoints are implemented.</gap>
|
|
343
|
+
|
|
313
344
|
## Attachments
|
|
314
345
|
|
|
315
346
|
A message takes files beside its body, such as an invoice's PDF: `attachments`, each a `filename`, its bytes as `content` (a `Uint8Array`, such as a `Buffer`) and, optionally, its `contentType`, else the one the name implies. A template's `send` takes them as its fourth argument:
|
|
@@ -366,6 +397,7 @@ export default defineFunction(async (request, { personalMail }) => {
|
|
|
366
397
|
- **Sign-in is not a mailbox:** under **Mailbox**, the account page says when someone signs in with Google without having allowed it to send mail, so a linked Google sign-in is not taken for a connected mailbox.
|
|
367
398
|
- <gap>The account page cannot show which account a mailbox is linked through or disconnect it because unlinking a mailbox is not implemented.</gap>
|
|
368
399
|
- <gap>Mailboxes other than Gmail cannot be linked because no other mail provider is implemented.</gap>
|
|
400
|
+
- **Bounces:** mail sent from someone's own mailbox bounces back to the sender, not to the app. It reaches none of the [mail feedback](#bounces-and-complaints) endpoints, so it makes no `mail_feedback` records and no `bounced` or `complained` events. Handling its bounces is the sender's own concern.
|
|
369
401
|
- <gap>A send through Gmail cannot return its [message id](#message-id) because Gmail sets its own and reading it back needs a scope that reads the mailbox, which the link does not ask for.</gap>
|
|
370
402
|
|
|
371
403
|
### From addresses
|