{"_id":"@apsulis/emdash-light-smtp","_rev":"4-3e14ceb3e881148ce6f3231c5a382533","name":"@apsulis/emdash-light-smtp","dist-tags":{"latest":"0.1.1"},"versions":{"0.0.0-stage":{"name":"@apsulis/emdash-light-smtp","version":"0.0.0-stage","_id":"@apsulis/emdash-light-smtp@0.0.0-stage","stub":true,"maintainers":[{"name":"xdjuj","email":"npm@apsulis.com"}],"dist":{"shasum":"e63aba9409fcbe1ea80398c8fb75bf669326e3c2","tarball":"https://registry.npmjs.org/@apsulis/emdash-light-smtp/-/emdash-light-smtp-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-JdXK30Cf7rfkOKtdoBc0qzq7AdT30snw3YuqpkmA2dxPZFmslkBql0I+KcM+S3Jn0tyrSrk2A0u6utQLxzVXIQ==","signatures":[{"sig":"MEQCIFPKHd5LYs9KzNqFITjPl4DC73R387Zob7JHAGLDpmiHAiBcIObYmVjUGnBGe+eUcYsHB6ZU5Epd2EC8HkY5WFypQw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":348},"_npmUser":{"name":"xdjuj","email":"npm@apsulis.com"},"deprecated":"Placeholder created by npm staged publishing, use 0.1.0 or later","description":"Temporary package placeholder for staged publishing","directories":{}},"0.1.0":{"name":"@apsulis/emdash-light-smtp","version":"0.1.0","keywords":["emdash","emdash-plugin","smtp","email","nodemailer"],"author":{"url":"https://www.apsulis.com","name":"Apsulis"},"license":"MIT","_id":"@apsulis/emdash-light-smtp@0.1.0","maintainers":[{"name":"xdjuj","email":"npm@apsulis.com"}],"homepage":"https://github.com/apsulis/emdash-light-smtp#readme","bugs":{"url":"https://github.com/apsulis/emdash-light-smtp/issues"},"dist":{"shasum":"076ddb62a0d8ba624e9a8d0fd39d1a9cdb69693d","tarball":"https://registry.npmjs.org/@apsulis/emdash-light-smtp/-/emdash-light-smtp-0.1.0.tgz","fileCount":12,"integrity":"sha512-ekClPkaFYvqSk5ch6dDP/aa+aTASAzqtbkWS53qf+V3RetI8WO/1lGfc4pLTmc0aAd3KHhPy2fj0rB0uN0YXvg==","signatures":[{"sig":"MEQCIBS6V5aRe8Z3QUcIvcF7Ozyim9rIhfFuDPp1rARubm+uAiAYOjSkysJ8ap7klCgkQ2EgtZPX3Ka0mMQhbQeqQKdSKw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQCs6ctUg7Y7B0RTlFdfS+NsJt2OdJvjUsJCBIzfJoxssgIhAKTZAGFYAHJ64xsuRuDGYr9Qu1zqBNRT6OMe3fCh/53D","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":20905},"type":"module","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./plugin":{"types":"./dist/plugin.d.ts","default":"./dist/plugin.js"}},"gitHead":"34d23c12cdaea4b8ec534ae7c2fc3be98bcb336c","scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","prepack":"pnpm build","typecheck":"tsc -p tsconfig.json --noEmit"},"_npmUser":{"name":"xdjuj","email":"npm@apsulis.com"},"repository":{"url":"git+https://github.com/apsulis/emdash-light-smtp.git","type":"git"},"_npmVersion":"11.12.1","description":"Light, hardened SMTP email provider for self-hosted EmDash (Node.js): one-line configuration, mandatory TLS, safe off switch.","directories":{},"_nodeVersion":"24.15.0","dependencies":{"nodemailer":"10.1.1"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"packageManager":"pnpm@12.11.2","devDependencies":{"emdash":"1.3.0","vitest":"5.0.5","typescript":"6.0.3","@types/node":"26.6.5","smtp-server":"3.19.22"},"peerDependencies":{"emdash":">=1.3.0 <2"},"_npmOperationalInternal":{"tmp":"tmp/emdash-light-smtp_0.1.0_1792229169033_0.5576983958051775","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"_id":"@apsulis/emdash-light-smtp@0.1.1","bugs":{"url":"https://github.com/apsulis/emdash-light-smtp/issues"},"dist":{"shasum":"0f95ade9c89acf72930e8fd6bd22b94f9d4fe6f7","tarball":"https://registry.npmjs.org/@apsulis/emdash-light-smtp/-/emdash-light-smtp-0.1.1.tgz","integrity":"sha512-M0lzTz/cJIAvYTUXQ3cjiZ6v2DoLkvUiiky8KqdcU7c0dq6pIGoc4RjPJjobzCmvO2mavFthCPALFVmYOby2Ew==","fileCount":12,"unpackedSize":21463,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apsulis%2femdash-light-smtp@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDhMx+XDu3NlT85Fm6OhPaRbYYAAV5+uJ0S3Rdlh7Ec/QIhALgzovw6u/ya/FN5tYis8VPzfZN4SuG0GNb9kouuuwfV"}]},"name":"@apsulis/emdash-light-smtp","type":"module","author":{"url":"https://www.apsulis.com","name":"Apsulis"},"engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./plugin":{"types":"./dist/plugin.d.ts","default":"./dist/plugin.js"}},"gitHead":"c68166282573b5612ef438349d3635d88adf2b3c","license":"MIT","scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","prepack":"pnpm build","typecheck":"tsc -p tsconfig.json --noEmit"},"version":"0.1.1","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"fc9e9c9d-377b-4ce8-b85d-50b38b79ed9f"},"approver":{"name":"xdjuj","email":"npm@apsulis.com"}},"homepage":"https://github.com/apsulis/emdash-light-smtp#readme","keywords":["emdash","emdash-plugin","smtp","email","nodemailer"],"repository":{"url":"git+https://github.com/apsulis/emdash-light-smtp.git","type":"git"},"_npmVersion":"11.19.1","description":"Light, hardened SMTP email provider for self-hosted EmDash (Node.js): one-line configuration, mandatory TLS, safe off switch.","directories":{},"maintainers":[{"name":"xdjuj","email":"npm@apsulis.com"}],"_nodeVersion":"24.21.0","dependencies":{"nodemailer":"10.1.1"},"publishConfig":{"access":"public","provenance":true},"packageManager":"pnpm@12.11.2","devDependencies":{"emdash":"1.3.0","vitest":"5.0.5","typescript":"6.0.3","@types/node":"26.6.5","smtp-server":"3.19.22"},"peerDependencies":{"emdash":">=1.3.0 <2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/emdash-light-smtp_0.1.1_1792515700210_0.9670455031380807"},"_hasShrinkwrap":false}},"time":{"created":"2026-10-17T09:24:30.417Z","modified":"2026-10-20T17:01:40.691Z","0.0.0-stage":"2026-10-17T09:24:30.417Z","0.1.0":"2026-10-17T09:26:09.131Z","0.1.1":"2026-10-20T17:01:40.318Z"},"bugs":{"url":"https://github.com/apsulis/emdash-light-smtp/issues"},"author":{"url":"https://www.apsulis.com","name":"Apsulis"},"license":"MIT","homepage":"https://github.com/apsulis/emdash-light-smtp#readme","keywords":["emdash","emdash-plugin","smtp","email","nodemailer"],"repository":{"url":"git+https://github.com/apsulis/emdash-light-smtp.git","type":"git"},"description":"Light, hardened SMTP email provider for self-hosted EmDash (Node.js): one-line configuration, mandatory TLS, safe off switch.","maintainers":[{"name":"xdjuj","email":"npm@apsulis.com"}],"readme":"# @apsulis/emdash-light-smtp\n\n[![npm](https://img.shields.io/npm/v/@apsulis/emdash-light-smtp)](https://www.npmjs.com/package/@apsulis/emdash-light-smtp)\n[![CI](https://github.com/apsulis/emdash-light-smtp/actions/workflows/ci.yml/badge.svg)](https://github.com/apsulis/emdash-light-smtp/actions/workflows/ci.yml)\n\nA light, hardened SMTP email provider for **self-hosted [EmDash](https://github.com/emdash-cms/emdash)** (Node.js).\nIt delivers EmDash's emails (magic links, invitations, plugin mail) through any SMTP relay: Mailjet, Sweego,\nBrevo, Amazon SES, Cloudflare Email Service, your own server…\n\n- **One environment variable, one line:** `SMTP_URL`. Nothing is stored in the database, so credentials never\n  end up in backups or site exports, and a fresh clone with an empty `.env` sends nothing.\n- **TLS is mandatory and verified** (TLS 1.2 minimum), either implicit TLS (port 465) or STARTTLS that the\n  server must offer (port 587, no fallback to plain text). Plain text exists only outside production, for a\n  local catcher such as [Mailpit](https://mailpit.axllent.org/).\n- **A single off switch.** No `SMTP_URL`, or `SMTP_DISABLED=1`: the plugin does not register an email\n  provider at all, so nothing can leave, and EmDash keeps its own fallbacks (copy the invite link by hand).\n- **One runtime dependency:** [nodemailer](https://nodemailer.com/), pinned.\n- A small dashboard widget for administrators: state, server, sender, and a **Send a test email** button.\n\nIt is a trusted (native) plugin: SMTP needs raw TCP sockets, which EmDash's sandboxed plugins do not have.\nOn Cloudflare Workers, use EmDash's `cloudflareEmail()` plugin instead.\n\n## Install\n\n```bash\npnpm add @apsulis/emdash-light-smtp\n```\n\n```js\n// astro.config.mjs\nimport emdash from \"emdash/astro\";\nimport emdashLightSmtp from \"@apsulis/emdash-light-smtp\";\n\nexport default defineConfig({\n\tintegrations: [emdash({ /* … */ plugins: [emdashLightSmtp()] })],\n});\n```\n\nWhen it is the only email provider, EmDash selects it automatically (otherwise: **Settings → Email**).\n\n## Configuration\n\n```dotenv\n# Implicit TLS (port 465 by default)\nSMTP_URL=smtps://USER:PASSWORD@smtp.example.com?from=noreply@example.com&name=Example\n# STARTTLS, required (port 587 by default)\nSMTP_URL=smtp://USER:PASSWORD@in-v3.mailjet.com:587?from=noreply@example.com&name=Example\n# Local development with Mailpit (docker run -p 8025:8025 -p 1025:1025 axllent/mailpit)\nSMTP_URL=smtp://localhost:1025?from=noreply@example.test&tls=none\n# Turns everything off, whatever SMTP_URL says\nSMTP_DISABLED=1\n```\n\n| Part | Meaning |\n|---|---|\n| `smtps://` / `smtp://` | Implicit TLS / STARTTLS that the server must offer. Both verify the certificate, TLS 1.2 minimum. |\n| `USER:PASSWORD` | Optional. **Percent-encode** them (`encodeURIComponent`): `@` is `%40`, `:` is `%3A`, `/` is `%2F`, `#` is `%23`, `%` is `%25`. Never logged: masked in error messages. |\n| `:port` | Optional: 465 for `smtps`, 587 for `smtp`. |\n| `from=` | Sender address, of a domain authorised (SPF, DKIM) at your provider. Optional when the user is itself an address (mailbox providers such as OVH). |\n| `name=` | Optional display name, accents and spaces allowed. |\n| `tls=none` | Plain text, for a local catcher only: refused when `NODE_ENV=production`. |\n\nThe URL is read by the WHATWG URL parser built into Node, then turned into the same settings whatever the\nform. Invalid settings turn the plugin off rather than guessing; the reason is logged once at startup and\nshown in the widget.\n\n## What it deliberately does not do\n\nNo redirection of all mail to a test address, no recipient allow-list, no send log, no templates, queues,\nattachments or DKIM signing (your relay signs). Keep a copy of production `.env` files out of local machines;\nto work locally, leave `SMTP_URL` empty or set `SMTP_DISABLED=1`.\n\nIf a project needs them later, they belong in separate, provider-agnostic plugins rather than in this one.\nEmDash 1.3.0 sends every email through `email:beforeSend` (can rewrite or cancel), `email:deliver` (this plugin)\nand `email:afterSend` (fire-and-forget), and system emails (sign-in links, invites) skip the first and last\nstages. So:\n\n- a **redirect** plugin on `email:beforeSend` would reroute form notifications on a staging site while sign-in\n  links still reach the right person;\n- a **send log** plugin on `email:afterSend` would never see a sign-in link.\n\nBoth would work with any email provider, not only this one.\n\n## Logs\n\nOne line at startup (`[emdash-light-smtp] active: host:port (mode), sender …` or `off: reason`), then\none line per email with recipient and subject. Message bodies (which contain sign-in links) and credentials are\nnever logged.\n\n## Development\n\n```bash\npnpm install\npnpm typecheck\npnpm test        # unit tests + integration against a local SMTP server (needs openssl for a throw-away certificate)\npnpm pack        # builds dist/ and produces the npm tarball\n```\n\nReleases: a GitHub release stages the version on npm with provenance (trusted publishing, no token); it goes\nlive only once a maintainer approves it with two-factor authentication.\n\nIssues and pull requests are welcome: keep it light. A feature belongs here only if every self-hosted EmDash\nsite sending email through SMTP needs it; anything else is a separate plugin (see above). Security issues:\nsee [SECURITY.md](SECURITY.md).\n\n## License\n\nMIT © Apsulis\n","readmeFilename":"README.md"}