Skip to content

mailkite/runcloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MailKite

MailKite for RunCloud

Add email to a RunCloud web app in one command — point your Laravel/PHP site's mail at a verified domain, and (optionally) receive inbound email as a signed webhook.
A tiny CLI (mailkite-runcloud) that writes the mail env through your site's git deploy script — or prints it for the RunCloud Env Editor.

Docs · Library guide · mailkite.dev · AI agents

npm

Read-only mirror. This repo is a generated, release-time mirror of the MailKite monorepo (the private source of truth) — development doesn't happen here. Install from npm and open issues against the MailKite docs.

⚠️ Read this first (RunCloud specifics)

RunCloud is different from Forge and Ploi in two ways this tool is built around:

  1. No .env API. RunCloud exposes no endpoint to set a web app's .env directly. So this CLI writes your mail env through the site's git deploy script (which runs on the server and can write .env) when you pass --git, or — with no --gitprints the exact env block for you to paste into the dashboard Env Editor. Both paths produce the same result.
  2. The RunCloud API is Business/Enterprise-only. On Free/Basic plans the API returns 401/403. The CLI checks this up front (/ping) and, if you're gated, tells you to use the printed env block + Env Editor instead — which needs no API key at all.

Install / run

No install needed — run it with npx:

npx mailkite-runcloud \
  --token <runcloud-api-key> \
  --server <serverId> --webapp <webAppId> --git <gitId> \
  --mailkite-key mk_live_… \
  --from you@yourdomain.com
  • --token — RunCloud API key (Settings → API Key), or set RUNCLOUD_API_KEY. Add --secret (or RUNCLOUD_API_SECRET) to use HTTP Basic (legacy v2); with just a key it uses Bearer (v3).
  • --server / --webapp — RunCloud ids (--site is an alias for --webapp).
  • --git — the web app's git deployment id. With it, the mail env is written into the deploy script (idempotently, inside a # --- mailkite --- marker block). Without it, the env is only printed for the Env Editor.
  • --mailkite-key — MailKite API key (or MAILKITE_API_KEY).
  • --fromMAIL_FROM_ADDRESS; its domain must be verified in MailKite.

No Business/Enterprise plan? Skip the token.

npx mailkite-runcloud --mailkite-key mk_live_… --from you@yourdomain.com

This makes no API calls — it just prints the KEY=value block. Paste it into your web app's Env Editor in the RunCloud dashboard and save.

Two mail paths

--mode smtp (default) --mode api
How SMTP relay through smtp.mailkite.dev:587 Native mailkite/laravel mailer
Code change none composer require mailkite/laravel (added to the deploy script in --mode api)
Env written MAIL_MAILER=smtp, MAIL_HOST, MAIL_PORT, MAIL_USERNAME=apikey, MAIL_PASSWORD=<key>, MAIL_ENCRYPTION=tls, MAIL_FROM_* MAIL_MAILER=mailkite, MAILKITE_API_KEY, MAIL_FROM_*

Receive inbound email (--inbound)

npx mailkite-runcloud --token <key> --server 11 --webapp 22 --git 3 \
  --mailkite-key mk_live_… --from you@yourdomain.com \
  --inbound https://yoursite.com/api/inbound

Creates a MailKite route (*@yourdomain.com → your URL) and adds MAILKITE_WEBHOOK_SECRET to the env block so your app can verify the signature. Inbound requires the domain's MX to be verified — see the inbound guide.

--dry-run

Prints the env, the managed deploy-script block, and what it would do — without any write calls. Great for a review before you commit.

All MailKite libraries

Same contract, every language (full list: https://mailkite.dev/docs/libraries):

Library Repo Distribution
MailKite for RunCloud (this repo) runcloud npm
MailKite for Laravel laravel Packagist
MailKite for PHP mailkite-php Packagist
MailKite for Node.js mailkite-node npm
MailKite for Python mailkite-python PyPI
MailKite for Ruby mailkite-ruby RubyGems
MailKite for Java mailkite-java Maven Central
MailKite for Go mailkite-go Go modules
@mailkite/cli mailkite-cli npm

Docs & links

MIT licensed. © MailKite.

About

MailKite for RunCloud — one-command CLI to wire MailKite email into a RunCloud web app.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

No contributors