mail: send through CARLOS mail submission (BLOCKED: the re-pin is red)
CARLOS platform mail submission (carlos plan Task 9). When the agent sets CARLOS_MAIL=submit and its control socket, Calls builds its sender with rastrillo's mail.FromCarlos (newMailer in cmd/calls, From CALLS_MAIL_FROM else CARLOS_MAIL_FROM) and holds no SMTP credential. SMTP alone still boots; neither is still the existing refusal outside development, now naming both ways to fix it. A half-configured submission refuses to start. Tests cover the three boots, and a submit send reaching POST /v1/mail on the socket. Deploy notes name carlos ship --mail submit, then promote: carlos deploy has no --mail flag yet (carlos main 9eec0236). NOT READY: mail.FromCarlos needs rastrillo at or after 11044699, and that re-pin (here to main 96812bea) brings every rastrillo change since this app's old pin. make ci is red on those, not on the mail change: the en locale pack rastrillo now requires at boot (the binary does not come up), a re-vendored select.js, sign-in return_to answers, the CSP tests, and credits. See the Task 9 report.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 files changed,
+219
−28
Makefile+3 −1README.md+12 −0cmd/calls/mail_test.go+120 −0cmd/calls/main.go+30 −5go.mod+7 −3go.sum+18 −18internal/calls/config.go+1 −1internal/calls/mail_refusal_test.go+28 −0
CI failed — run details
CI log
=== vet ===
go vet ./...
go: downloading amadan.net/rastrillo/rastrillo v0.35.1-0.20261116213651-96812beacacc
go: downloading github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3
go: downloading github.com/modelcontextprotocol/go-sdk v1.8.0
go: downloading amadan.net/rastrillo/fiesta v1.3.0
go: downloading github.com/tdewolff/minify/v2 v2.24.19
go: downloading github.com/tdewolff/parse/v2 v2.8.16
=== fmt ===
=== test ===
go test ./...
ok amadan.net/oficina/calls/callscore 7.464s
--- FAIL: TestSIGTERMDrainsQueuedSigninMail (20.02s)
shutdown_test.go:43: server never came up: Get "http://127.0.0.1:42063/healthz": dial tcp 127.0.0.1:42063: connect: connection refused
shutdown_test.go:271: process output:
time=2026-11-16T22:37:08.466Z level=INFO msg="calls: SMTP configured" host=127.0.0.1 from=calls@example.test
time=2026-11-16T22:37:08.473Z level=INFO msg=migrate applied="[sessions/0001_init auth/0001_init auth/0002_sessions_backfill calls/0001_init calls/0002_agents calls/0003_alter_meeting_links calls/0004_alter_persons calls/0005_create_device_tokens calls/0006_alter_meetings]" skipped=0 adopted=false
time=2026-11-16T22:37:08.474Z level=ERROR msg="calls: exiting" err="serve failed: rastrillo: refusing to start: locale configuration: \"en\" needs the en pack: import _ \"amadan.net/rastrillo/rastrillo/locales/en\""
--- FAIL: TestSIGTERMDeliversAnInFlightSigninsLink (20.01s)
shutdown_test.go:95: server never came up: Get "http://127.0.0.1:42355/healthz": dial tcp 127.0.0.1:42355: connect: connection refused
shutdown_test.go:271: process output:
time=2026-11-16T22:37:28.466Z level=INFO msg="calls: SMTP configured" host=127.0.0.1 from=calls@example.test
time=2026-11-16T22:37:28.473Z level=INFO msg=migrate applied="[sessions/0001_init auth/0001_init auth/0002_sessions_backfill calls/0001_init calls/0002_agents calls/0003_alter_meeting_links calls/0004_alter_persons calls/0005_create_device_tokens calls/0006_alter_meetings]" skipped=0 adopted=false
time=2026-11-16T22:37:28.474Z level=ERROR msg="calls: exiting" err="serve failed: rastrillo: refusing to start: locale configuration: \"en\" needs the en pack: import _ \"amadan.net/rastrillo/rastrillo/locales/en\""
--- FAIL: TestSIGTERMDrainsMailWhenHTTPShutdownTimesOut (20.01s)
shutdown_test.go:159: server never came up: Get "http://127.0.0.1:45515/healthz": dial tcp 127.0.0.1:45515: connect: connection refused
shutdown_test.go:271: process output:
time=2026-11-16T22:37:48.481Z level=INFO msg="calls: SMTP configured" host=127.0.0.1 from=calls@example.test
time=2026-11-16T22:37:48.487Z level=INFO msg=migrate applied="[sessions/0001_init auth/0001_init auth/0002_sessions_backfill calls/0001_init calls/0002_agents calls/0003_alter_meeting_links calls/0004_alter_persons calls/0005_create_device_tokens calls/0006_alter_meetings]" skipped=0 adopted=false
time=2026-11-16T22:37:48.489Z level=ERROR msg="calls: exiting" err="serve failed: rastrillo: refusing to start: locale configuration: \"en\" needs the en pack: import _ \"amadan.net/rastrillo/rastrillo/locales/en\""
FAIL
FAIL amadan.net/oficina/calls/cmd/calls 60.135s
? amadan.net/oficina/calls/cmd/calls-contract [no test files]
ok amadan.net/oficina/calls/cmd/quality-summary 0.011s
2026/11/16 22:37:10 INFO migrate applied="[sessions/0001_init auth/0001_init auth/0002_sessions_backfill calls/0001_init calls/0002_agents calls/0003_alter_meeting_links calls/0004_alter_persons calls/0005_create_device_tokens calls/0006_alter_meetings]" skipped=0 adopted=false
2026/11/16 22:37:10 INFO migrate applied="[sessions/0001_init auth/0001_init auth/0002_sessions_backfill calls/0001_init calls/0002_agents calls/0003_alter_meeting_links calls/0004_alter_persons calls/0005_create_device_tokens calls/0006_alter_meetings]" skipped=0 adopted=false
2026/11/16 22:37:10 INFO migrate applied="[sessions/0001_init auth/0001_init auth/0002_sessions_backfill calls/0001_init calls/0002_agents calls/0003_alter_meeting_links calls/0004_alter_persons calls/0005_create_device_tokens calls/0006_alter_meetings]" skipped=0 adopted=false
--- FAIL: TestCreditsMatchProductionDependencies (0.17s)
credits_inventory_test.go:76: embedded credits differ from production dependencies; run make credits (the toolchain is already ruled out by the check at the top of this test)
--- FAIL: TestHomeCSPPreservesPinnedFrameworkDirectives (0.00s)
home_security_test.go:22: rastrillo: refusing to start: locale configuration: "en" needs the en pack: import _ "amadan.net/rastrillo/rastrillo/locales/en"
FAIL
FAIL amadan.net/oficina/calls/internal/calls 12.983s
ok amadan.net/oficina/calls/internal/calls/apns 0.009s
ok amadan.net/oficina/calls/internal/calls/hub 1.122s
? amadan.net/oficina/calls/internal/calls/icons [no test files]
? amadan.net/oficina/calls/internal/calls/keymailtest [no test files]
ok amadan.net/oficina/calls/internal/calls/relay 0.003s
ok amadan.net/oficina/calls/internal/calls/seal 0.002s
? amadan.net/oficina/calls/internal/calls/teamstate [no test files]
--- FAIL: TestABearerOnAnHTMLRouteIsIgnored (0.01s)
api_test.go:209: GET / with a bearer: 303 → "/signin?return_to=%2F", want 303 → /signin
<a href="/signin?return_to=%2F">See Other</a>.
--- FAIL: TestSignInComesBackToTheDeepLink (0.01s)
chrome_test.go:179: the stream's signed-out answer changed: 303 "/signin?return_to=%2Fm%2Fzpckpf8wbk%2Fstream"
2026/11/16 22:37:11 INFO migrate applied="[sessions/0001_init auth/0001_init auth/0002_sessions_backfill calls/0001_init calls/0002_agents calls/0003_alter_meeting_links calls/0004_alter_persons calls/0005_create_device_tokens calls/0006_alter_meetings]" skipped=0 adopted=false
--- FAIL: TestProductionServesRastrillosDefaultCSP (0.00s)
confirm_test.go:148: rastrillo: refusing to start: locale configuration: "en" needs the en pack: import _ "amadan.net/rastrillo/rastrillo/locales/en"
--- FAIL: TestTheConfirmDoorKeepsEveryPolicy (0.01s)
confirm_test.go:184: rastrillo.Handler: rastrillo: refusing to start: locale configuration: "en" needs the en pack: import _ "amadan.net/rastrillo/rastrillo/locales/en"
2026/11/16 22:37:18 INFO migrate applied="[sessions/0001_init auth/0001_init auth/0002_sessions_backfill calls/0001_init calls/0002_agents calls/0003_alter_meeting_links calls/0004_alter_persons calls/0005_create_device_tokens calls/0006_alter_meetings]" skipped=0 adopted=false
--- FAIL: TestVendoredAssetsMatchTheLibrary (0.00s)
vendored_test.go:33: static/tokens.css differs from the library copy; re-copy it (or delete its pin if the edit was deliberate)
vendored_test.go:33: static/select.js differs from the library copy; re-copy it (or delete its pin if the edit was deliberate)
FAIL
FAIL amadan.net/oficina/calls/internal/callstest 12.435s
ok amadan.net/oficina/calls/protocol 0.002s
? amadan.net/oficina/calls/scripts/writeestilo [no test files]
FAIL
make: *** [Makefile:74: test] Error 1
amadan: step test failed: exit status 2
amadan: job failed at step test — its output is above, not at the tail of this log
diff --git a/Makefile b/Makefile| index 795a27f..6e72c4b 100644 |
| --- a/Makefile |
| +++ b/Makefile |
| @@ -53,7 +53,9 @@ release: version-check |
| @echo |
| @echo "built $(RELEASE_BIN) reporting version $(VERSION)" |
| @echo "ship it with:" |
| - @echo " carlos ship -app $(APP) -target $(RELEASE_GOOS)-$(RELEASE_GOARCH) $(RELEASE_BIN)" |
| + @echo " carlos ship -app $(APP) -mail submit -target $(RELEASE_GOOS)-$(RELEASE_GOARCH) $(RELEASE_BIN)" |
| + @echo "then promote it (carlos deploy has no -mail flag yet; see README/AGENTS):" |
| + @echo " carlos promote -app $(APP) <version>" |
| version-check: |
| @if [ -z "$(VERSION)" ]; then \ |
diff --git a/README.md b/README.md| index 97d76f8..b35fe47 100644 |
| --- a/README.md |
| +++ b/README.md |
| @@ -124,6 +124,18 @@ promote and wait (its own help text). Building for your own |
| architecture and shipping that uploads fine and fails to exec on the |
| instance. |
| +**Mail submission.** Ship every Calls build with `--mail submit`, which |
| +declares that it can send through CARLOS mail submission |
| +(`mail.FromCarlos`, `newMailer` in `cmd/calls`). Until `carlos email |
| +submission on --app calls` runs, Calls keeps sending over SMTP; after |
| +it the agent sets `CARLOS_MAIL=submit` and Calls holds no SMTP |
| +credential, and every instance must run a build shipped with the flag. |
| +`carlos deploy` has no `--mail` flag yet (carlos main 9eec0236), so |
| +until it does, ship and promote: `carlos ship --app calls --account |
| +oficina --mail submit --version <sha> --target linux-arm64 |
| +releases/calls-linux-arm64`, then `carlos promote --app calls --account |
| +oficina <sha> edge`. |
| + |
| These are the settings a deploy needs (`config.go`, `standing.go`). |
| Five refuse startup when empty outside `-env development`: |
| `CALLS_ORIGIN` (the external origin, scheme included); |
diff --git a/cmd/calls/mail_test.go b/cmd/calls/mail_test.go| new file mode 100644 |
| index 0000000..d86cda8 |
| --- /dev/null |
| +++ b/cmd/calls/mail_test.go |
| @@ -0,0 +1,120 @@ |
| +package main |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "io" |
| + "log/slog" |
| + "net" |
| + "net/http" |
| + "os" |
| + "path/filepath" |
| + "strings" |
| + "testing" |
| + |
| + "amadan.net/rastrillo/rastrillo/mail" |
| +) |
| + |
| +// The three boots CARLOS platform mail submission needs (carlos plan |
| +// Task 9): on submission with the agent's socket, on SMTP alone, and |
| +// with neither, where newMailer returns nil and calls.App refuses |
| +// outside development (the mail case of resolve, |
| +// in internal/calls config.go). |
| + |
| +var mailVars = []string{"CARLOS_MAIL", "CARLOS_CONTROL_SOCKET", |
| + "CARLOS_ADMIN_TOKEN", "CARLOS_MAIL_FROM", "CALLS_MAIL_FROM"} |
| + |
| +func mailerWith(t *testing.T, env map[string]string) (mail.Sender, error) { |
| + t.Helper() |
| + for _, k := range mailVars { |
| + t.Setenv(k, "") |
| + } |
| + for _, p := range []string{"CALLS_SMTP_", "CARLOS_SMTP_"} { |
| + for _, s := range []string{"HOST", "PORT", "USER", "PASS", "FROM"} { |
| + t.Setenv(p+s, "") |
| + } |
| + } |
| + for k, v := range env { |
| + t.Setenv(k, v) |
| + } |
| + return newMailer(slog.New(slog.DiscardHandler)) |
| +} |
| + |
| +// controlSocket stands in for the agent's socket: it answers POST |
| +// /v1/mail and reports each request's path and From. |
| +func controlSocket(t *testing.T) (string, chan string) { |
| + t.Helper() |
| + dir, err := os.MkdirTemp("/tmp", "calls-mail") // unix paths are short |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + t.Cleanup(func() { os.RemoveAll(dir) }) |
| + socket := filepath.Join(dir, "control.sock") |
| + ln, err := net.Listen("unix", socket) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + seen := make(chan string, 1) |
| + srv := &http.Server{Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| + var body struct { |
| + From string `json:"from"` |
| + } |
| + raw, _ := io.ReadAll(r.Body) |
| + _ = json.Unmarshal(raw, &body) |
| + seen <- r.Method + " " + r.URL.Path + " " + body.From |
| + w.Write([]byte(`{"message_id":"m-1"}`)) |
| + })} |
| + go srv.Serve(ln) |
| + t.Cleanup(func() { srv.Close() }) |
| + return socket, seen |
| +} |
| + |
| +func TestNewMailerSubmits(t *testing.T) { |
| + for _, tc := range []struct{ name, fromVar, from string }{ |
| + {"the platform's From", "CARLOS_MAIL_FROM", "noreply@calls.oficina.works"}, |
| + {"Calls' own From first", "CALLS_MAIL_FROM", "decks@calls.oficina.works"}, |
| + } { |
| + t.Run(tc.name, func(t *testing.T) { |
| + socket, seen := controlSocket(t) |
| + sender, err := mailerWith(t, map[string]string{ |
| + "CARLOS_MAIL": "submit", "CARLOS_CONTROL_SOCKET": socket, |
| + "CARLOS_ADMIN_TOKEN": "token", tc.fromVar: tc.from, |
| + // SMTP left over beside it is not used. |
| + "CARLOS_SMTP_HOST": "email-smtp.eu-west-1.amazonaws.com", |
| + "CARLOS_SMTP_FROM": "old@calls.oficina.works"}) |
| + if err != nil || sender == nil { |
| + t.Fatalf("sender %v, err %v", sender, err) |
| + } |
| + if err := sender.Send(context.Background(), "ana@example.com", "Sign in", "link"); err != nil { |
| + t.Fatal(err) |
| + } |
| + if got, want := <-seen, "POST /v1/mail "+tc.from; got != want { |
| + t.Fatalf("got %q, want %q", got, want) |
| + } |
| + }) |
| + } |
| +} |
| + |
| +func TestNewMailerUsesSMTPAlone(t *testing.T) { |
| + sender, err := mailerWith(t, map[string]string{ |
| + "CARLOS_SMTP_HOST": "email-smtp.eu-west-1.amazonaws.com", |
| + "CARLOS_SMTP_FROM": "noreply@calls.oficina.works"}) |
| + if err != nil || sender == nil || !mail.IsConfigured(sender) { |
| + t.Fatalf("sender %v, err %v", sender, err) |
| + } |
| +} |
| + |
| +func TestNewMailerWithNeitherLeavesItToNew(t *testing.T) { |
| + sender, err := mailerWith(t, nil) |
| + if err != nil || sender != nil { |
| + t.Fatalf("sender %v, err %v: with no channel calls.App must decide", sender, err) |
| + } |
| +} |
| + |
| +func TestNewMailerRefusesHalfASubmission(t *testing.T) { |
| + _, err := mailerWith(t, map[string]string{"CARLOS_MAIL": "submit", |
| + "CARLOS_MAIL_FROM": "noreply@calls.oficina.works"}) |
| + if err == nil || !strings.Contains(err.Error(), "CARLOS_CONTROL_SOCKET") { |
| + t.Fatalf("submission with no control socket: %v", err) |
| + } |
| +} |
diff --git a/cmd/calls/main.go b/cmd/calls/main.go| index 76e82ab..ea6af6b 100644 |
| --- a/cmd/calls/main.go |
| +++ b/cmd/calls/main.go |
| @@ -71,7 +71,10 @@ func run(logger, reportLogger *slog.Logger) error { |
| // Raw: calls.resolve wraps every mailer in RedactMailErrors, so the |
| // invariant holds for whatever a caller passes, not only for what |
| // this main happens to build (review C1-2). |
| - mailer := newMailer(logger) |
| + mailer, err := newMailer(logger) |
| + if err != nil { |
| + return fmt.Errorf("configure mail: %w", err) |
| + } |
| cfg := calls.Config{ |
| Home: connect.CredentialsFromEnv("CALLS"), |
| @@ -156,17 +159,39 @@ func smtpSecret(name string) string { |
| return os.Getenv("CARLOS_SMTP_" + name) |
| } |
| -// newMailer builds the magic-link sender. HOST and FROM have no sane |
| +// newMailer builds the magic-link sender: CARLOS mail submission when |
| +// the agent turned it on, else SMTP from the settings above. |
| +// |
| +// Submission ($CARLOS_MAIL=submit, which only the CARLOS agent sets, |
| +// beside its control socket) goes through rastrillo's mail.FromCarlos, |
| +// and the instance holds no mail credential. The From is |
| +// $CALLS_MAIL_FROM when set, else $CARLOS_MAIL_FROM, the one the |
| +// platform delivers for Calls' CARLOS_SMTP declaration: the SMTP |
| +// settings' CALLS-then-CARLOS order. A submission missing its socket, |
| +// token or From is an error, so Calls refuses to start rather than fail |
| +// the first sign-in. run calls this only on the serving path: a CARLOS |
| +// seed or one-shot has no control socket, and the agent strips |
| +// $CARLOS_MAIL from it. |
| +// |
| +// SMTP is mail.SMTP directly, because FromCarlos reads one prefix and |
| +// this needs the per-variable fallback. HOST and FROM have no sane |
| // default, so either missing means no relay, and a nil return is what |
| // lets calls.App refuse to start outside development rather than log |
| // live links. |
| -func newMailer(logger *slog.Logger) mail.Sender { |
| +func newMailer(logger *slog.Logger) (mail.Sender, error) { |
| + if os.Getenv("CARLOS_MAIL") == "submit" { |
| + prefix := "CARLOS" |
| + if strings.TrimSpace(os.Getenv("CALLS_MAIL_FROM")) != "" { |
| + prefix = "CALLS" |
| + } |
| + return mail.FromCarlos(prefix, logger) |
| + } |
| host, from := smtpSetting("HOST"), smtpSetting("FROM") |
| if host == "" || from == "" { |
| - return nil |
| + return nil, nil |
| } |
| logger.Info("calls: SMTP configured", "host", host, "from", from) |
| - return mail.SMTP(host, smtpSetting("PORT"), from, smtpSecret("USER"), smtpSecret("PASS")) |
| + return mail.SMTP(host, smtpSetting("PORT"), from, smtpSecret("USER"), smtpSecret("PASS")), nil |
| } |
| // extractEnvFlag pulls -env (in its four spellings) out of argv and |
diff --git a/go.mod b/go.mod| index 48abede..d86bbef 100644 |
| --- a/go.mod |
| +++ b/go.mod |
| @@ -9,9 +9,9 @@ require ( |
| amadan.net/oficina/home/handoff v0.0.0-20261024233715-ff16bf56bc4d |
| amadan.net/oficina/home/roster v0.0.0-20261028171508-67c12e39a9d2 |
| amadan.net/oficina/home/teammode v0.0.0-20261028171508-67c12e39a9d2 |
| - amadan.net/rastrillo/rastrillo v0.27.1-0.20261006204347-fb806a287060 |
| + amadan.net/rastrillo/rastrillo v0.35.1-0.20261116213651-96812beacacc |
| github.com/go-chi/chi/v5 v5.3.2 |
| - github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2 |
| + github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 |
| github.com/google/uuid v1.6.0 |
| github.com/keymaildev/signin v0.1.1 |
| golang.org/x/crypto v0.56.0 |
| @@ -19,6 +19,7 @@ require ( |
| ) |
| require ( |
| + amadan.net/rastrillo/fiesta v1.3.0 // indirect |
| amadan.net/rastrillo/rastrillo/money v0.1.0 // indirect |
| github.com/BurntSushi/toml v1.6.0 // indirect |
| github.com/carlosframework/rastrillo v0.23.0 // indirect |
| @@ -27,12 +28,14 @@ require ( |
| github.com/jinzhu/inflection v1.0.0 // indirect |
| github.com/jinzhu/now v1.1.5 // indirect |
| github.com/mattn/go-isatty v0.0.20 // indirect |
| - github.com/modelcontextprotocol/go-sdk v1.7.0 // indirect |
| + github.com/modelcontextprotocol/go-sdk v1.8.0 // indirect |
| github.com/ncruces/go-strftime v1.0.0 // indirect |
| github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect |
| github.com/santhosh-tekuri/jsonschema/v6 v6.0.3 // indirect |
| github.com/segmentio/asm v1.1.3 // indirect |
| github.com/segmentio/encoding v0.5.4 // indirect |
| + github.com/tdewolff/minify/v2 v2.24.19 // indirect |
| + github.com/tdewolff/parse/v2 v2.8.16 // indirect |
| github.com/yosida95/uritemplate/v3 v3.0.2 // indirect |
| golang.org/x/mod v0.38.0 // indirect |
| golang.org/x/oauth2 v0.35.0 // indirect |
| @@ -40,6 +43,7 @@ require ( |
| golang.org/x/sys v0.47.0 // indirect |
| golang.org/x/text v0.41.0 // indirect |
| golang.org/x/time v0.15.0 // indirect |
| + golang.org/x/tools v0.48.0 // indirect |
| gorm.io/plugin/dbresolver v1.6.2 // indirect |
| modernc.org/libc v1.74.1 // indirect |
| modernc.org/mathutil v1.7.1 // indirect |
diff --git a/go.sum b/go.sum| index 8c46365..b416cd1 100644 |
| --- a/go.sum |
| +++ b/go.sum |
| @@ -10,36 +10,30 @@ amadan.net/oficina/home/roster v0.0.0-20261028171508-67c12e39a9d2 h1:yKUTS0nOiVw |
| amadan.net/oficina/home/roster v0.0.0-20261028171508-67c12e39a9d2/go.mod h1:gqshuXyDtFZUCYbhuZyV3Epc51pUcsLbpqAqiA5UiXg= |
| amadan.net/oficina/home/teammode v0.0.0-20261028171508-67c12e39a9d2 h1:0PQiRUkC+9cbTHE67Y4/SmW1sPH1NNWNwTceNFyMjTY= |
| amadan.net/oficina/home/teammode v0.0.0-20261028171508-67c12e39a9d2/go.mod h1:dXBZeB2ic33SIZiGUCzafmviUT8TYWgzSYZvo2rM6zA= |
| -amadan.net/rastrillo/rastrillo v0.27.1-0.20261006204347-fb806a287060 h1:K2PXcCKfm+AYrqgH1ea6cNsFs4sN7MKLvq+uBY11NZE= |
| -amadan.net/rastrillo/rastrillo v0.27.1-0.20261006204347-fb806a287060/go.mod h1:WmC8TAIfqjAkSwmD+FCTqr7VuqAO5FaX03HlV49K608= |
| +amadan.net/rastrillo/fiesta v1.3.0 h1:7SsHw4aeWPLStR3RHFEEtX4CwqKu+Ig3PgNX8FvD8WM= |
| +amadan.net/rastrillo/fiesta v1.3.0/go.mod h1:LpO391W1dIRUxOIKklHm+bGyWXtlFyBRRPQCysb9LjY= |
| +amadan.net/rastrillo/rastrillo v0.35.1-0.20261116213651-96812beacacc h1:QakboVkj9nqA6ZaKXeDVXWLPobQSVvd80ic521aA8/U= |
| +amadan.net/rastrillo/rastrillo v0.35.1-0.20261116213651-96812beacacc/go.mod h1:y45ucMD+Al4tN47mmnm7h6pGDw7N20k0CMg6IwB9vfc= |
| amadan.net/rastrillo/rastrillo/money v0.1.0 h1:MxU4oqNrW8abxRTkgZBv24OYNpFnvonajNqeLIzmmaM= |
| amadan.net/rastrillo/rastrillo/money v0.1.0/go.mod h1:cmgkjBEIQh1pFSYvQk0UU6oPYS8kSDypdT9+t4Flx0U= |
| github.com/BurntSushi/toml v1.6.0 h1:dRaEfpa2VI55EwlIW72hMRHdWouJeRF7TPYhI+AUQjk= |
| github.com/BurntSushi/toml v1.6.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= |
| github.com/carlosframework/rastrillo v0.23.0 h1:tKAAlwPt4Pg/rkqk7o6jvV12bbZ0r34oEVpuOlKfX7w= |
| github.com/carlosframework/rastrillo v0.23.0/go.mod h1:pZlrE5F5OhspvZFzef0DrfjHAjA8FXycb9J5/8vc8Tw= |
| -github.com/chromedp/cdproto v0.0.0-20250724212937-08a3db8b4327 h1:UQ4AU+BGti3Sy/aLU8KVseYKNALcX9UXY6DfpwQ6J8E= |
| -github.com/chromedp/cdproto v0.0.0-20250724212937-08a3db8b4327/go.mod h1:NItd7aLkcfOA/dcMXvl8p1u+lQqioRMq/SqDp71Pb/k= |
| -github.com/chromedp/chromedp v0.14.2 h1:r3b/WtwM50RsBZHMUm9fsNhhzRStTHrKdr2zmwbZSzM= |
| -github.com/chromedp/chromedp v0.14.2/go.mod h1:rHzAv60xDE7VNy/MYtTUrYreSc0ujt2O1/C3bzctYBo= |
| -github.com/chromedp/sysutil v1.1.0 h1:PUFNv5EcprjqXZD9nJb9b/c9ibAbxiYo4exNWZyipwM= |
| -github.com/chromedp/sysutil v1.1.0/go.mod h1:WiThHUdltqCNKGc4gaU50XgYjwjYIhKWoHGPTUfWTJ8= |
| +github.com/chromedp/cdproto v0.158.6 h1:jaKiXWuhcxbvKbSe8U6Dp5U4Hcj2w6lETYgZqBD5n34= |
| +github.com/chromedp/cdproto v0.158.6/go.mod h1:h68JaIuFr9o3yiayxEYhBdvaxgYO3shDrPSYhNlyfu0= |
| +github.com/chromedp/chromedp v0.21.0 h1:nVHgS2LHyhZJ1l3BWRbG2eFIFYiJMnvkJbELbd8WBoQ= |
| +github.com/chromedp/chromedp v0.21.0/go.mod h1:6z1Y5FdKUxRzxx2qcC5h1xjaBJrSWrZp1mjgITfNZig= |
| github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= |
| github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= |
| github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= |
| github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= |
| github.com/go-chi/chi/v5 v5.3.2 h1:5YQkICvTCSZ25hoRsyJazN0scjzKGiu4VAUc7H1o1nY= |
| github.com/go-chi/chi/v5 v5.3.2/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto= |
| -github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2 h1:iizUGZ9pEquQS5jTGkh4AqeeHCMbfbjeb0zMt0aEFzs= |
| -github.com/go-json-experiment/json v0.0.0-20250725192818-e39067aee2d2/go.mod h1:TiCD2a1pcmjd7YnhGH0f/zKNcCD06B029pHhzV23c2M= |
| +github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3 h1:UADEEmDKgfXbtnGJZ97beY5XLo9ZechG1nlU4KnRrkE= |
| +github.com/go-json-experiment/json v0.0.0-20260820222146-c27c302e5fc3/go.mod h1:tphK2c80bpPhMOI4v6bIc2xWywPfbqi1Z06+RcrMkDg= |
| github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= |
| github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= |
| -github.com/gobwas/httphead v0.1.0 h1:exrUm0f4YX0L7EBwZHuCF4GDp8aJfVeBrlLQrs6NqWU= |
| -github.com/gobwas/httphead v0.1.0/go.mod h1:O/RXo79gxV8G+RqlR/otEwx4Q36zl9rqC5u12GKvMCM= |
| -github.com/gobwas/pool v0.2.1 h1:xfeeEhW7pwmX8nuLVlqbzVc7udMDrwetjEv+TZIz1og= |
| -github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= |
| -github.com/gobwas/ws v1.4.0 h1:CTaoG1tojrh4ucGPcoJFiAQUAsEWekEWvLy7GsVNqGs= |
| -github.com/gobwas/ws v1.4.0/go.mod h1:G3gNqMNtPppf5XUz7O4shetPpcZ1VJ7zt18dlUeakrc= |
| github.com/golang-jwt/jwt/v5 v5.3.1 h1:kYf81DTWFe7t+1VvL7eS+jKFVWaUnK9cB1qbwn63YCY= |
| github.com/golang-jwt/jwt/v5 v5.3.1/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= |
| github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= |
| @@ -62,8 +56,8 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE |
| github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= |
| github.com/mattn/go-sqlite3 v1.14.22 h1:2gZY6PC6kBnID23Tichd1K+Z0oS6nE/XwU+Vz/5o4kU= |
| github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y= |
| -github.com/modelcontextprotocol/go-sdk v1.7.0 h1:yqjY2dsbKAC0LSuWZVBMrHgiG8ukXv6NRo0JiALay44= |
| -github.com/modelcontextprotocol/go-sdk v1.7.0/go.mod h1:dL7u98E/zjJTGzEq+j30jQ8K2k1mb6LeAH4inEcSGts= |
| +github.com/modelcontextprotocol/go-sdk v1.8.0 h1:KIvahhYqwtbeniWVPs3TcXEA7b8jEtwfBpOTAI+Urx4= |
| +github.com/modelcontextprotocol/go-sdk v1.8.0/go.mod h1:dL7u98E/zjJTGzEq+j30jQ8K2k1mb6LeAH4inEcSGts= |
| github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w= |
| github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= |
| github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= |
| @@ -76,6 +70,12 @@ github.com/segmentio/encoding v0.5.4 h1:OW1VRern8Nw6ITAtwSZ7Idrl3MXCFwXHPgqESYfv |
| github.com/segmentio/encoding v0.5.4/go.mod h1:HS1ZKa3kSN32ZHVZ7ZLPLXWvOVIiZtyJnO1gPH1sKt0= |
| github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e h1:MRM5ITcdelLK2j1vwZ3Je0FKVCfqOLp5zO6trqMLYs0= |
| github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e/go.mod h1:XV66xRDqSt+GTGFMVlhk3ULuV0y9ZmzeVGR4mloJI3M= |
| +github.com/tdewolff/minify/v2 v2.24.19 h1:j2exx54gvrCFN9UiFm0Z5vbNWBFcuY5Ql1VmaM2Dkeo= |
| +github.com/tdewolff/minify/v2 v2.24.19/go.mod h1:HVgQO08FJeDxQx+lcFOVDi1IySi/77WlN/dDckCkZoA= |
| +github.com/tdewolff/parse/v2 v2.8.16 h1:bLk5svUOQRkW/Y2SJ+DeENSIkZBcTIkq+Atyv5D8feI= |
| +github.com/tdewolff/parse/v2 v2.8.16/go.mod h1:XdsoSFThlVIRIajAuqz1evNY7bagZS8LBOPA3aVopwQ= |
| +github.com/tdewolff/test v1.0.12 h1:7F21DqIajswxuche0geHdrUZRCWE4oko4b7bcmkkrxk= |
| +github.com/tdewolff/test v1.0.12/go.mod h1:XPuWBzvdUzhCuxWO1ojpXsyzsA5bFoS3tO/Q3kFuTG8= |
| github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zIM+UJPGz4= |
| github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= |
| golang.org/x/crypto v0.56.0 h1:GUh5Ii4J5jtcseSMiRqr1jXCNHoxjeV9Fmekc2oLy6Y= |
diff --git a/internal/calls/config.go b/internal/calls/config.go| index c7f8e0e..84d8a5b 100644 |
| --- a/internal/calls/config.go |
| +++ b/internal/calls/config.go |
| @@ -190,7 +190,7 @@ func resolve(cfg Config) (resolved, error) { |
| case cfg.development(): |
| out.mailer = RedactMailErrors(mail.Logged(cfg.Logger), cfg.Logger) |
| default: |
| - return out, fmt.Errorf("calls: mail is not configured (set $CALLS_SMTP_HOST and $CALLS_SMTP_FROM) and Env is %q, not %q; a sign-in that cannot send its link is not sign-in", cfg.Env, EnvDevelopment) |
| + return out, fmt.Errorf("calls: mail is not configured (CARLOS mail submission sets $CARLOS_MAIL=submit; otherwise set $CALLS_SMTP_HOST and $CALLS_SMTP_FROM, or $CARLOS_SMTP_*) and Env is %q, not %q; a sign-in that cannot send its link is not sign-in", cfg.Env, EnvDevelopment) |
| } |
| list, err := resolveAllowlist(cfg) |
diff --git a/internal/calls/mail_refusal_test.go b/internal/calls/mail_refusal_test.go| new file mode 100644 |
| index 0000000..8c5aeaa |
| --- /dev/null |
| +++ b/internal/calls/mail_refusal_test.go |
| @@ -0,0 +1,28 @@ |
| +package calls |
| + |
| +import ( |
| + "strings" |
| + "testing" |
| +) |
| + |
| +// TestNoMailRefusesOutsideDevelopment is the third boot of CARLOS mail |
| +// submission (cmd/calls mail_test.go has the other two): with neither |
| +// channel, cmd/calls passes a nil Mailer, and resolve refuses anywhere |
| +// but development, naming both ways to fix it. |
| +func TestNoMailRefusesOutsideDevelopment(t *testing.T) { |
| + cfg := minimalConfig(t) |
| + cfg.Mailer = nil |
| + _, err := resolve(cfg) |
| + if err == nil { |
| + t.Fatal("started with no mail in production") |
| + } |
| + for _, want := range []string{"CARLOS_MAIL=submit", "CALLS_SMTP_HOST"} { |
| + if !strings.Contains(err.Error(), want) { |
| + t.Errorf("refusal %q does not name %s", err, want) |
| + } |
| + } |
| + cfg.Env = EnvDevelopment |
| + if _, err := resolve(cfg); err != nil { |
| + t.Fatalf("development with no mail: %v", err) |
| + } |
| +} |