Email on a self-hosted server
GitNotify supports personal digests by email in two ways. A self-hosted operator can provide one SMTP service for the whole installation, or each Discord server, Slack workspace, and Telegram group can provide its own relay.
Built-in SMTP
Section titled “Built-in SMTP”Set at least:
SMTP_HOST=smtp.example.comEMAIL_FROM=gitnotify@example.comEMAIL_RECIPIENTS={"octocat":"octocat@example.com","hubot":"hubot@example.com"}The other SMTP settings are optional:
SMTP_PORT=587SMTP_USERNAME=replace-with-the-loginSMTP_PASSWORD=replace-with-the-passwordSMTP_USE_TLS=trueBuilt-in email turns on only when both SMTP_HOST and EMAIL_FROM are set. It is then available to every Discord server, Slack workspace, and Telegram group on this installation. GitNotify looks up the recipient by GitHub login in EMAIL_RECIPIENTS. The lookup is case-insensitive.
Built-in SMTP uses STARTTLS, so a provider that only offers implicit TLS on port 465 needs its STARTTLS port, usually 587. Set SMTP_USE_TLS=false only for an SMTP service that expects a plain connection. Setting a password without a username does not enable SMTP authentication.
When built-in SMTP is enabled, it takes precedence over per-space relays. An administrator does not need to run the relay setup command. A linked person can select email when creating a personal digest, and GitNotify sends a test before saving it.
Per-space relay
Section titled “Per-space relay”Leave SMTP_HOST or EMAIL_FROM unset if each space should bring its own sender. The relay in cloud/relay/ is a separate Cloudflare Worker that accepts signed digest requests and maps GitHub logins to addresses in its own configuration. Email relay explains how to deploy it.
The setup command differs by platform:
| Platform | Get a new relay secret | Test and save the relay |
|---|---|---|
| Discord | /digest email |
/digest email url: https://relay.example.com |
| Slack | /gitnotify digest email |
/gitnotify digest email https://relay.example.com |
| Telegram | /digest email |
/digest email https://relay.example.com |
Run the command without an address first. GitNotify creates a new secret and shows it once. Put that value in the relay's GITNOTIFY_SECRET. Configure the relay's RECIPIENTS and FROM values, deploy it, then run the second command with its normal HTTPS address.
GitNotify sends a signed test before marking the relay active. A new secret replaces the old one. The existing relay stops working until it has the new secret and passes another test.
Relay secrets are encrypted in SQLite with GITNOTIFY_MASTER_KEY. Keep that key with the database backup.