← Back to Pull requests

Server: Fixes #16448: Add email (SMTP) setup to .env-sample and documentation #16545

Closed
unknown closed this pull request without merging on Sep 12, 2026 14:00 UTC
View on GitHub
unknown unknown commented on Sep 12, 2026 11:00 UTC
Author

Problem

Joplin Server already supports sending emails (password reset links, email-change confirmations, payment notices, etc.) via SMTP, reading a full set of MAILER_* environment variables (packages/server/src/env.ts, consumed by EmailService.ts / config.ts). However, none of these variables were present in the default .env-sample that self-hosters start from, and the server documentation did not mention email setup at all — so the feature was effectively undiscoverable. Fixes #16448.

What this changes

Docs-only change, no runtime behavior:

1. .env-sample — added an "Email (SMTP) config example" section (commented out, matching the existing style of the file) listing all 8 variables: MAILER_ENABLED, MAILER_HOST, MAILER_PORT, MAILER_SECURITY, MAILER_AUTH_USER, MAILER_AUTH_PASSWORD, MAILER_NOREPLY_NAME, MAILER_NOREPLY_EMAIL.
2. packages/server/README.md — added a "Setting up email (SMTP)" section (between "Setup storage" and "Verify access to the admin page", following the same optional-step format as the neighbouring sections) with a conf example block and a description of each variable.

All defaults, valid values and behaviours documented were verified against env.ts (MailerSecurity enum = tls/starttls/none, defaults port 465 / security tls) and EmailService.ts (service disabled when MAILER_HOST is unset or MAILER_ENABLED is false; MAILER_NOREPLY_EMAIL required).

Note on tests

The monorepo install repeatedly failed on my Windows machine (yarn cache/link EPERM-ENOENT races), so packages/server/src/env.test.ts could not be executed locally. Since this PR changes no code (only .env-sample and a Markdown file, neither of which is referenced by any test), this has no bearing on the change.

How to test

Self-host the server using the updated .env-sample (uncomment the email block), run with a working SMTP server and confirm a password-reset email is delivered.

Diff: 247 lines (+185 / -62) across 3 files Reviewer: abhinav-phi Review duration: 180m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 247 lines diff across 3 files
0.39
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
0.17
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
60%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.330
Shallow Review Depth shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #16545"
general weight: 0.35
Reviewers
Assignees
Unassigned
Labels
risk: low confidence: 60.5% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 38.9% (MEDIUM) · Higher = larger blast radius
38.9%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 60.5% · Lower = rushed or shallow review
60.5%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.4% · Safe to merge
15.4%