{"_id":"@bradsjm/mail-smtp-mcp-rs","_rev":"3-8b726d4addd8fe201f6105aa6168d55f","name":"@bradsjm/mail-smtp-mcp-rs","dist-tags":{"latest":"0.2.0"},"versions":{"0.0.0":{"name":"@bradsjm/mail-smtp-mcp-rs","version":"0.0.0","license":"MIT","_id":"@bradsjm/mail-smtp-mcp-rs@0.0.0","maintainers":[{"name":"bradsjm","email":"jb@nrgup.net"}],"homepage":"https://github.com/bradsjm/mail-smtp-mcp-rs#readme","bugs":{"url":"https://github.com/bradsjm/mail-smtp-mcp-rs/issues"},"dist":{"shasum":"cf13310bac83bd27042a39f8a8811e920772c90d","tarball":"https://registry.npmjs.org/@bradsjm/mail-smtp-mcp-rs/-/mail-smtp-mcp-rs-0.0.0.tgz","fileCount":2,"integrity":"sha512-9M0cw07Tcv5G8MeUFQw5qRPME8QYCvBoywWCTICpm/ypvxQ9MZFyK5m0KlgOsuazSvVm0zveR1ShRPf1WVGg9w==","signatures":[{"sig":"MEUCIQCf1F4yyQxYNZl1t4Kg5vq5340bjpqwBcO3zJGIfn83PQIgfJts1yTK58bgLV19etWnKUAtiZW5ZyN4feDD7KeAvrw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":591},"_npmUser":{"name":"bradsjm","email":"jb@nrgup.net"},"repository":{"url":"git+https://github.com/bradsjm/mail-smtp-mcp-rs.git","type":"git"},"_npmVersion":"11.8.0","description":"Placeholder for Trusted Publishing setup. This version contains no runtime code.","directories":{},"_nodeVersion":"24.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/mail-smtp-mcp-rs_0.0.0_1772480685581_0.48632375055403965","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@bradsjm/mail-smtp-mcp-rs","version":"0.1.0","keywords":["email","api-bindings","mcp","smtp","mail","protocol"],"license":"MIT","_id":"@bradsjm/mail-smtp-mcp-rs@0.1.0","maintainers":[{"name":"bradsjm","email":"jb@nrgup.net"}],"homepage":"https://github.com/bradsjm/mail-smtp-mcp-rs#readme","bugs":{"url":"https://github.com/bradsjm/mail-smtp-mcp-rs/issues"},"bin":{"mail-smtp-mcp-rs":"run-mail-smtp-mcp-rs.js"},"dist":{"shasum":"d0196d47b95543af4c66a4ca7c2474386cb89591","tarball":"https://registry.npmjs.org/@bradsjm/mail-smtp-mcp-rs/-/mail-smtp-mcp-rs-0.1.0.tgz","fileCount":10,"integrity":"sha512-LrWnO7K+M0xc/SPaQ2xZCEaV5D53y16cMqFphoLtMZOBxzYn7ZHCiTogLLT6GT+vJ59u0+SYG3UT8Bt6LP7CNQ==","signatures":[{"sig":"MEYCIQDagqi4NZrmGyrKAAv/prRgGIt25/T/u9DFLsNGpOFBZQIhAPoT82OdjyVFW26MEXaNfs7z03vLihB85PUr5WMYt4K0","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bradsjm%2fmail-smtp-mcp-rs@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":39012},"_from":"file:npm/mail-smtp-mcp-rs-npm-package.tar.gz","volta":{"npm":"9.5.0","node":"18.14.1"},"engines":{"npm":">=6","node":">=14"},"scripts":{"fmt":"prettier --write **/*.js","fmt:check":"prettier --check **/*.js","postinstall":"node ./install.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bfe41a7b-631e-44b1-ae75-1491e4e3d82b"}},"_resolved":"/home/runner/work/mail-smtp-mcp-rs/mail-smtp-mcp-rs/npm/mail-smtp-mcp-rs-npm-package.tar.gz","_integrity":"sha512-LrWnO7K+M0xc/SPaQ2xZCEaV5D53y16cMqFphoLtMZOBxzYn7ZHCiTogLLT6GT+vJ59u0+SYG3UT8Bt6LP7CNQ==","repository":{"url":"git+https://github.com/bradsjm/mail-smtp-mcp-rs.git","type":"git"},"_npmVersion":"11.8.0","description":"Secure SMTP MCP server over stdio with multi-account support, and TLS-only connections","directories":{},"_nodeVersion":"24.13.1","dependencies":{"axios":"^1.13.5","rimraf":"^6.1.3","detect-libc":"^2.1.2","console.table":"^0.10.0","axios-proxy-builder":"^0.1.2"},"glibcMinimum":{"major":2,"series":35},"_hasShrinkwrap":true,"devDependencies":{"prettier":"^3.8.1"},"preferUnplugged":true,"supportedPlatforms":{"x86_64-apple-darwin":{"bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs"},"zipExt":".tar.xz","artifactName":"mail-smtp-mcp-rs-x86_64-apple-darwin.tar.xz"},"aarch64-apple-darwin":{"bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs"},"zipExt":".tar.xz","artifactName":"mail-smtp-mcp-rs-aarch64-apple-darwin.tar.xz"},"x86_64-pc-windows-gnu":{"bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs.exe"},"zipExt":".zip","artifactName":"mail-smtp-mcp-rs-x86_64-pc-windows-msvc.zip"},"x86_64-pc-windows-msvc":{"bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs.exe"},"zipExt":".zip","artifactName":"mail-smtp-mcp-rs-x86_64-pc-windows-msvc.zip"},"aarch64-pc-windows-msvc":{"bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs.exe"},"zipExt":".zip","artifactName":"mail-smtp-mcp-rs-x86_64-pc-windows-msvc.zip"},"x86_64-unknown-linux-gnu":{"bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs"},"zipExt":".tar.xz","artifactName":"mail-smtp-mcp-rs-x86_64-unknown-linux-gnu.tar.xz"}},"artifactDownloadUrls":["https://github.com/bradsjm/mail-smtp-mcp-rs/releases/download/v0.1.0"],"_npmOperationalInternal":{"tmp":"tmp/mail-smtp-mcp-rs_0.1.0_1772501932408_0.6447124017685559","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"artifactDownloadUrls":["https://github.com/bradsjm/mail-smtp-mcp-rs/releases/download/v0.2.0"],"bin":{"mail-smtp-mcp-rs":"run-mail-smtp-mcp-rs.js"},"dependencies":{"axios":"^1.13.5","axios-proxy-builder":"^0.1.2","console.table":"^0.10.0","detect-libc":"^2.1.2","rimraf":"^6.1.3"},"description":"Secure SMTP MCP server over stdio with multi-account support, and TLS-only connections","devDependencies":{"prettier":"^3.8.1"},"engines":{"node":">=14","npm":">=6"},"glibcMinimum":{"major":2,"series":35},"keywords":["email","api-bindings","mcp","smtp","mail","protocol"],"license":"MIT","name":"@bradsjm/mail-smtp-mcp-rs","preferUnplugged":true,"repository":{"type":"git","url":"git+https://github.com/bradsjm/mail-smtp-mcp-rs.git"},"scripts":{"fmt":"prettier --write **/*.js","fmt:check":"prettier --check **/*.js","postinstall":"node ./install.js"},"supportedPlatforms":{"aarch64-apple-darwin":{"artifactName":"mail-smtp-mcp-rs-aarch64-apple-darwin.tar.xz","bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs"},"zipExt":".tar.xz"},"aarch64-pc-windows-msvc":{"artifactName":"mail-smtp-mcp-rs-x86_64-pc-windows-msvc.zip","bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs.exe"},"zipExt":".zip"},"x86_64-apple-darwin":{"artifactName":"mail-smtp-mcp-rs-x86_64-apple-darwin.tar.xz","bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs"},"zipExt":".tar.xz"},"x86_64-pc-windows-gnu":{"artifactName":"mail-smtp-mcp-rs-x86_64-pc-windows-msvc.zip","bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs.exe"},"zipExt":".zip"},"x86_64-pc-windows-msvc":{"artifactName":"mail-smtp-mcp-rs-x86_64-pc-windows-msvc.zip","bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs.exe"},"zipExt":".zip"},"x86_64-unknown-linux-gnu":{"artifactName":"mail-smtp-mcp-rs-x86_64-unknown-linux-gnu.tar.xz","bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs"},"zipExt":".tar.xz"},"x86_64-unknown-linux-musl-dynamic":{"artifactName":"mail-smtp-mcp-rs-x86_64-unknown-linux-musl.tar.xz","bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs"},"zipExt":".tar.xz"},"x86_64-unknown-linux-musl-static":{"artifactName":"mail-smtp-mcp-rs-x86_64-unknown-linux-musl.tar.xz","bins":{"mail-smtp-mcp-rs":"mail-smtp-mcp-rs"},"zipExt":".tar.xz"}},"version":"0.2.0","volta":{"node":"18.14.1","npm":"9.5.0"},"_id":"@bradsjm/mail-smtp-mcp-rs@0.2.0","bugs":{"url":"https://github.com/bradsjm/mail-smtp-mcp-rs/issues"},"homepage":"https://github.com/bradsjm/mail-smtp-mcp-rs#readme","_integrity":"sha512-cYuqin2RQVcxfiCJD4r2VkZgpCiuuRuC3/S82oat6Lty+CIBWhnUldf60KSVZMjAgXbk1yvo2GhVWp+aMhN61Q==","_resolved":"/home/runner/work/mail-smtp-mcp-rs/mail-smtp-mcp-rs/npm/mail-smtp-mcp-rs-npm-package.tar.gz","_from":"file:npm/mail-smtp-mcp-rs-npm-package.tar.gz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-cYuqin2RQVcxfiCJD4r2VkZgpCiuuRuC3/S82oat6Lty+CIBWhnUldf60KSVZMjAgXbk1yvo2GhVWp+aMhN61Q==","shasum":"b3158d517ec4fd1b37a57a3c617ebeb39921322a","tarball":"https://registry.npmjs.org/@bradsjm/mail-smtp-mcp-rs/-/mail-smtp-mcp-rs-0.2.0.tgz","fileCount":10,"unpackedSize":40133,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bradsjm%2fmail-smtp-mcp-rs@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGbqSmrjQzTiarHOlFai8+cubjBRpHxkOHbc+1RmGuskAiEA32l3zymdylvM2X+qtHvj+0eQHJZ4dqy/q0XOaAq8X8g="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bfe41a7b-631e-44b1-ae75-1491e4e3d82b"}},"directories":{},"maintainers":[{"name":"bradsjm","email":"jb@nrgup.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mail-smtp-mcp-rs_0.2.0_1774786108845_0.3767382555917733"},"_hasShrinkwrap":true}},"time":{"created":"2026-03-02T19:44:45.459Z","modified":"2026-03-29T12:08:29.324Z","0.0.0":"2026-03-02T19:44:45.721Z","0.1.0":"2026-03-03T01:38:52.556Z","0.2.0":"2026-03-29T12:08:29.066Z"},"bugs":{"url":"https://github.com/bradsjm/mail-smtp-mcp-rs/issues"},"license":"MIT","homepage":"https://github.com/bradsjm/mail-smtp-mcp-rs#readme","keywords":["email","api-bindings","mcp","smtp","mail","protocol"],"repository":{"type":"git","url":"git+https://github.com/bradsjm/mail-smtp-mcp-rs.git"},"description":"Secure SMTP MCP server over stdio with multi-account support, and TLS-only connections","maintainers":[{"name":"bradsjm","email":"jb@nrgup.net"}],"readme":"# mail-smtp-mcp-rs\n\n`mail-smtp-mcp-rs` is a secure SMTP Model Context Protocol (MCP) server that runs over stdio.\nIt provides a focused tool surface for listing configured SMTP accounts and sending policy-bounded email messages.\n\n## Features\n\n- **SMTP-focused MCP surface**: two tools, `smtp_list_accounts` and `smtp_send_message`\n- **Secure-by-default send gate**: live sends are blocked unless `MAIL_SMTP_SEND_ENABLED=true`\n- **Policy enforcement**: recipient allowlists and configurable limits for recipients, message size, body size, and attachments\n- **Input hardening**: strict email validation, CR/LF header-injection checks, strict base64 decoding, and safe attachment filename checks\n- **Structured responses**: consistent envelope with `summary`, `data`, and execution `meta`\n- **Multi-account support**: discover and route by `MAIL_SMTP_<ACCOUNT>_*` environment sections\n- **Rust + tokio runtime**: async MCP server implementation with `rmcp`\n\n## Installation\n\nPick one of the supported install methods.\n\nSupported release artifacts:\n\n- macOS: `aarch64-apple-darwin`, `x86_64-apple-darwin`\n- Linux: `x86_64-unknown-linux-gnu`, `x86_64-unknown-linux-musl`\n- Windows: `x86_64-pc-windows-msvc`\n\nLinux musl support covers `x86_64` systems such as Alpine. Linux ARM64 npm installs are not supported.\n\n### NPX (recommended)\n\n```bash\nnpx -y @bradsjm/mail-smtp-mcp-rs@latest\n```\n\nOr install globally:\n\n```bash\nnpm install -g @bradsjm/mail-smtp-mcp-rs\nmail-smtp-mcp-rs\n```\n\n### Curl installer (Linux/macOS)\n\n```bash\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/bradsjm/mail-smtp-mcp-rs/releases/download/v0.1.0/mail-smtp-mcp-rs-installer.sh | sh\n```\n\nSafer alternative (download, inspect, then run):\n\n```bash\ncurl --proto '=https' --tlsv1.2 -LsSf -o mail-smtp-mcp-rs-installer.sh https://github.com/bradsjm/mail-smtp-mcp-rs/releases/download/v0.1.0/mail-smtp-mcp-rs-installer.sh\nsh mail-smtp-mcp-rs-installer.sh\n```\n\n### Docker\n\nPull and run from GHCR:\n\n```bash\ndocker pull ghcr.io/bradsjm/mail-smtp-mcp-rs:latest\ndocker run --rm -i --env-file .env ghcr.io/bradsjm/mail-smtp-mcp-rs:latest\n```\n\nBuild locally:\n\n```bash\ndocker build -t mail-smtp-mcp-rs .\ndocker run --rm -i --env-file .env mail-smtp-mcp-rs\n```\n\n### From source\n\n```bash\ncargo install --path .\n```\n\nBinary path: `~/.cargo/bin/mail-smtp-mcp-rs`.\n\n## Quick Start\n\n### 1) Configure an account and policy env vars\n\nAt least one SMTP account section is required at startup.\n\n```bash\n# Required account section\nMAIL_SMTP_DEFAULT_HOST=smtp.example.com\nMAIL_SMTP_DEFAULT_USER=your-user\nMAIL_SMTP_DEFAULT_PASS=your-app-password\n\n# Optional account fields\nMAIL_SMTP_DEFAULT_PORT=587\nMAIL_SMTP_DEFAULT_SECURE=false\nMAIL_SMTP_DEFAULT_FROM=noreply@example.com\n\n# Global policy\nMAIL_SMTP_SEND_ENABLED=false\nMAIL_SMTP_ALLOWLIST_DOMAINS=\nMAIL_SMTP_ALLOWLIST_ADDRESSES=\nMAIL_SMTP_MAX_RECIPIENTS=10\nMAIL_SMTP_MAX_MESSAGE_BYTES=2500000\nMAIL_SMTP_MAX_ATTACHMENTS=5\nMAIL_SMTP_MAX_ATTACHMENT_BYTES=2000000\nMAIL_SMTP_MAX_TEXT_CHARS=20000\nMAIL_SMTP_MAX_HTML_CHARS=50000\nMAIL_SMTP_CONNECT_TIMEOUT_MS=10000\nMAIL_SMTP_SOCKET_TIMEOUT_MS=20000\n```\n\nUse app passwords or service credentials where your provider requires them.\n\n### 2) Wire the server into your MCP client\n\nExample MCP config:\n\n```json\n{\n  \"mcpServers\": {\n    \"mail-smtp\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@bradsjm/mail-smtp-mcp-rs@latest\"],\n      \"env\": {\n        \"MAIL_SMTP_DEFAULT_HOST\": \"smtp.example.com\",\n        \"MAIL_SMTP_DEFAULT_USER\": \"your-user\",\n        \"MAIL_SMTP_DEFAULT_PASS\": \"your-app-password\",\n        \"MAIL_SMTP_DEFAULT_FROM\": \"noreply@example.com\",\n        \"MAIL_SMTP_SEND_ENABLED\": \"false\"\n      }\n    }\n  }\n}\n```\n\n### 3) Enable sending only when ready\n\nLive delivery is intentionally disabled by default:\n\n```bash\nMAIL_SMTP_SEND_ENABLED=true\n```\n\n## Multiple Accounts\n\nAccount IDs are discovered from `MAIL_SMTP_<ACCOUNT>_...` keys and normalized to lowercase.\n\n```bash\n# Default account\nMAIL_SMTP_DEFAULT_HOST=smtp.gmail.com\nMAIL_SMTP_DEFAULT_USER=user@gmail.com\nMAIL_SMTP_DEFAULT_PASS=app-password\n\n# Work account\nMAIL_SMTP_WORK_HOST=smtp.office365.com\nMAIL_SMTP_WORK_USER=user@company.com\nMAIL_SMTP_WORK_PASS=work-password\nMAIL_SMTP_WORK_SECURE=true\nMAIL_SMTP_WORK_PORT=465\n```\n\n## Tool Reference\n\nAll tools return a common envelope:\n\n```json\n{\n  \"summary\": \"Human-readable outcome\",\n  \"data\": {},\n  \"meta\": {\n    \"now_utc\": \"2026-03-01T12:34:56Z\",\n    \"duration_ms\": 42\n  }\n}\n```\n\n| Tool | Purpose |\n|------|---------|\n| `smtp_list_accounts` | List configured account metadata (`account_id`, host, port, secure, optional default sender) |\n| `smtp_send_message` | Validate and send one message with optional `cc`, `bcc`, `reply_to`, `html_body`, and attachments |\n\nFor complete schema-level details and validation rules, see [docs/tool-contract.md](docs/tool-contract.md).\n\n## Message and Policy Limits\n\nHard safety caps are enforced in code:\n\n- max recipients: 50\n- max attachments: 10\n- max bytes per attachment: 5,000,000\n- max text chars: 100,000\n- max HTML chars: 200,000\n- subject length: 1..=256 chars\n\nPolicy caps are configurable by env and can be stricter than hard caps.\n\n## Troubleshooting\n\n### Startup fails with missing config\n\nThe server requires at least one complete account (`HOST`, `USER`, `PASS`).\n\n### Sending is disabled\n\nIf `smtp_send_message` returns a send-disabled error, set:\n\n```bash\nMAIL_SMTP_SEND_ENABLED=true\n```\n\n### Account lookup fails\n\n`account_id` matching is case-insensitive and normalized to lowercase. Verify that the account section exists and includes required keys.\n\n### SMTP connection or send failures\n\nCheck host/port/secure settings, credentials, and network reachability. Tune:\n\n- `MAIL_SMTP_CONNECT_TIMEOUT_MS`\n- `MAIL_SMTP_SOCKET_TIMEOUT_MS`\n\n### npm install or npx fails on an unsupported platform\n\nThe published npm package supports only the release artifacts listed above. Common unsupported cases include Linux ARM64 and Windows ARM64.\n\nOn Linux `x86_64`, both glibc and musl environments are supported. For other platforms, use Docker or install from source if you need to run the server outside the published npm matrix.\n\n## Security Notes\n\n- Secrets are not returned in tool responses.\n- Password values are redacted in help diagnostics.\n- Recipient policy enforcement supports domain and exact-address allowlists.\n- Attachment handling validates filename safety, content type parsing, and strict base64 input.\n\n## Development\n\nContributor guidance and validation flow are documented in `AGENTS.md`.\n\n```bash\ncargo fmt -- --check\ncargo clippy --all-targets -- -D warnings\ncargo test\n```\n\nOptional SMTP integration smoke test:\n\n```bash\nscripts/test-greenmail.sh\n```\n\nRun GreenMail integration tests directly (requires a running GreenMail endpoint):\n\n```bash\ncargo test --test smtp_greenmail -- --ignored --nocapture\n```\n\n## License\n\nMIT License. See [LICENSE](LICENSE).\n","readmeFilename":"README.md"}