Skip to content

Free reimplementation of the Mailspring Sync backend (and other required APIs).

License

Notifications You must be signed in to change notification settings

1RandomDev/mailspring-api

Repository files navigation

Selfhosted reimplementation of the Mailspring API

Free reimplementation of the Mailspring Sync backend (and other required APIs). This project aims to provide an alternative sync server that can be self hosted for the Mailspring Email Client.

🔴IMPORTANT🔴 Currently this project can only be used with my fork of the MailSpring Client since the official version doesn't allow changing the API URL.

Supported Features

  • ✔️ Metadata Sync
  • ✔️ Multiple user accounts
  • ✔️ Read Receipts
  • ✔️ Link Tracking
  • ✔️ Follow-up Reminders
  • ✔️ Snooze messages
  • ✔️ Send Later
  • ✔️ Mail Templates
  • ❌ Rich contact profile
  • ❌ Company overviews
  • ✔️ Mailbox insights (+ sharing)
  • ✔️ Translation (using Google Translate)
  • ✔️ Thread sharing

Install

Using Docker Compose

docker-compose.yml

version: "3.4"

services:
  mailspring-api:
    container_name: mailspring-api
    image: ghcr.io/1randomdev/mailspring-api:latest
    network_mode: bridge
    ports:
      - 5101:5101/tcp
    volumes:
      - ./data:/data
    environment:
      - TZ=<timezone>
      - SHARE_URL=https://<my_public_domain>
    restart: unless-stopped

Using Docker CLI

docker run -d --name=mailspring-api \
    --network=bridge \
    -p 5101:5101/tcp \
    -v <data_directory>:/data \
    -e TZ=<timezone> \
    -e SHARE_URL=https://<my_public_domain> \
    ghcr.io/1randomdev/mailspring-api:latest

Install on the host

git clone https://github.com/1RandomDev/mailspring-api.git && cd mailspring-api
npm install

./manage.js user add --fullName "..." --email "..." --password "..."
npm start

Environment variables

Variable Description Default
LOG_LEVEL Set custom log level. Available log levels. info
SHARE_URL External url for shared resources. (Should be on a different domain for securrity purposes.) http://localhost:5101
API_PORT The port that is used for the webinterface and the API. 5101

Create/Manage a user account

You can create a new user account using the CLI tool.

docker exec -it mailspring-api ./manage.js user add --fullName "..." --email "..." --password "..."

For more info use

$ docker exec -it mailspring-api ./manage.js user --help
manage.js user <operation> [options]

Magage user accounts.

Commands:
  manage.js user add [options]       Create a new user.
  manage.js user delete [options]    Delete a user.
  manage.js user changepw [options]  Change the password of a user.
  manage.js user info [options]      Show details about a user.
  manage.js user list                List all users.

Options:
  -h, --help     Show help                                             [boolean]
  -v, --version  Show version number                                   [boolean]