Skip to content
Projects

About

Free, open-source self-hosted webmail client in Go. Lightweight Roundcube alternative for any IMAP/SMTP server: no database, OpenPGP, SSO, 7 MB Docker image.

Systems & Infrastructure

How these counts are measured

What you can do

  • Three-pane layout with resizable columns, light and dark themes, and a mobile layout
  • Folders with unread counts, sizes and quota; create, rename, delete, empty and subscribe
  • Server-side sorting and paging, fast on folders with tens of thousands of messages
  • Threaded view (IMAP THREAD) as an option

Measured star growth

in 24h
0
in 7 days
Collecting history
in 15 days
Collecting history
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original

Golub webmail logo, a carrier pigeon

Golub: self-hosted webmail in Go

Free, open-source webmail client for any IMAP and SMTP server.
A lightweight Roundcube alternative in one 7 MB container: no PHP, no database, no tracking.

Release CI Image size Trivy Go version License


Golub is a free, open-source, self-hosted webmail client written in Go. It gives users a modern browser interface for reading and sending mail on any IMAP and SMTP server, and it is a lightweight alternative to Roundcube, SnappyMail and Afterlogic WebMail Lite. It is built and tested against Dovecot and Postfix, with docker-mailserver as the reference stack.

It runs as one small container: no PHP, no database, no cron jobs, no plugins to keep in sync. Restart it whenever you like; there is nothing to migrate. Single sign-on, OpenPGP encryption, contacts, dark mode and a mobile layout are built in.

The name is Serbian for pigeon, as in carrier pigeon.

Try the live demo: the real interface with made-up mail, running entirely in your browser. More at golubmail.com.

Golub webmail inbox in the light theme, with the folder list, message list and an open message

Golub webmail in the dark theme Writing an email in Golub with contact and group suggestions
Dark theme Compose with contact and group suggestions
Golub address book with contact groups Golub webmail message list on a phone Reading an email in Golub on a phone
Contacts and groups Mobile

Privacy first

Webmail sees everything a person writes and reads, so Golub is built to keep as little as possible and to leak nothing.

  • Nothing stored on the server. No database and no files written at runtime. The session lives in an encrypted cookie; settings, contacts and signatures are kept in the user's own mailbox, in hidden IMAP folders that travel with the account.
  • No tracking, no analytics, no third-party requests. Fonts, icons and scripts are all served by Golub itself. There is no telemetry.
  • Remote images are blocked by default. When the user allows them, they load through Golub's image proxy, so senders never see the reader's IP address or browser. The proxy refuses private and internal addresses.
  • Tracking pixels are removed, even when remote images are allowed, and the message view says how many were blocked.
  • HTML mail is sanitized on the server and shown in a sandboxed frame with no scripts and a strict Content Security Policy.
  • Unsubscribe without exposing the reader. One-click unsubscribe (RFC 8058) is sent from the server, not the browser.
  • End-to-end encryption with OpenPGP. Encrypting, signing and decrypting happen in the browser. The private key is stored only passphrase protected, in the user's own mailbox, so neither the server nor anyone reading the mailbox can use it.
  • Read receipts are never sent silently. The user is asked each time.
  • Nothing identifying in outgoing mail. No User-Agent or X-Mailer header is added.
  • Not indexed. Pages carry noindex and robots.txt disallows everything.

Features

Mail

  • Three-pane layout with resizable columns, light and dark themes, and a mobile layout
  • Folders with unread counts, sizes and quota; create, rename, delete, empty and subscribe
  • Server-side sorting and paging, fast on folders with tens of thousands of messages
  • Threaded view (IMAP THREAD) as an option
  • Search in subject and addresses, or also in the message text, in one folder or all of them, filtered by unread, flagged, attachments and dates
  • Live updates through IMAP IDLE
  • Drag and drop to folders, multi-select, swipe on touch screens, undo for moves and deletes
  • Keyboard shortcuts for the list, messages, compose and settings

Reading

  • Plain text and sanitized HTML, inline images, attachment download and preview (images, PDF, text)
  • HTML mail shown dark in the dark theme, with pictures kept as they are, switchable per message
  • Legacy charsets, broken MIME and Unicode addresses (ime@pošta.rs) handled
  • Unsubscribe button for mailing lists, read receipt prompts, priority markers
  • View the raw message and all headers

Writing

  • Rich text or plain text, signatures per identity, canned responses
  • Reply, reply all, forward inline or as attachment, drafts with autosave
  • Address autocomplete from contacts, groups and people you have written to
  • Priority and read receipt requests, browser spell check
  • Unicode domains (IDNA) and mailboxes (SMTPUTF8)

Encryption

  • OpenPGP encryption and signatures, compatible with Thunderbird, Mailvelope and other PGP/MIME clients
  • Create or import keys, export them, and import other people's keys from a file, a paste or an attachment
  • Decrypt in the browser after unlocking with the passphrase; keys lock again after 15 minutes
  • Signed mail shows who signed it and whether the signature checks out

Contacts

  • Address book with groups, collected recipients, vCard import and export

Folders

  • Import .eml and .mbox files, export any folder as .mbox

For hosting

  • One IMAP connection per user, kept open and reused, instead of a new login on every click
  • Settings, contacts and signatures live on the IMAP server in the user's own mailbox, so they move with the account when it is migrated to another server
  • Single sign-on from a control panel with a signed, single-use token
  • Branding with your own name, logo and accent colour
  • English, Serbian (Latin), Arabic and Swedish, with right-to-left support and more languages easy to add

Benchmarks

Golub and other webmail clients

Smallest image, least memory, fastest message list, and one IMAP connection per user instead of one per request.

All four clients read the same mailbox on the same server: an INBOX of 21 messages and a folder of 50,000. The best value in each row is in bold.

Golub 0.3.0 Roundcube 1.7.7 SnappyMail 3.1.4 Afterlogic WebMail Lite 9.8.7
Image download (amd64) 7.1 MB 281 MB 95.5 MB 392 MB¹
Image unpacked 17.7 MB 795 MB 252 MB 1.3 GB¹
RAM at idle 4.6 MB 47 MB 72 MB 478 MB¹
Peak RAM, 10 users 17 MB 173 MB 95 MB 720 MB¹
Message list, INBOX, 10 users 502 req/s, 19 ms 49 req/s, 205 ms 44 req/s, 223 ms 15 req/s, 655 ms
Message list, 50,000 messages, 10 users 70 req/s, 138 ms 23 req/s, 425 ms 26 req/s, 382 ms 6 req/s, 1,705 ms
IMAP connections for 2,000 requests 10 2,000 2,000 2,000
Login page download 38 KB, 7 requests² 331 KB, 12 requests 170 KB, 7 requests 3,460 KB, 24 requests
Sign in to inbox shown 0.86 s 1.24 s 0.86 s 1.83 s
Open the 50,000-message folder 0.22 s 0.31 s 0.31 s 1.35 s
Open a message 0.32 s 0.88 s 0.83 s 0.82 s
Whole session download 244 KB, 24 requests 382 KB, 51 requests 363 KB, 19 requests 5,799 KB, 69 requests

¹ Includes MySQL 8.4, which Afterlogic needs; its own container is 161 MB to download and 480 MB unpacked.

² Once the login page is idle, Golub loads the mailbox code (48 KB) in the background, so signing in only waits for the data. It is counted in the whole session.

Golub keeps one IMAP connection per user open and reuses it, where the other clients connect and log in to IMAP again on every request. That is less work and fewer connections for the mail server, and no "maximum number of connections" errors when one user has several tabs open.

How it was measured, on 27 November 2026, with Golub 0.3.0 measured again the same way on 28 November: a 4-core VPS that also runs OpenPanel, docker-mailserver 17, and each client's official image. Roundcube runs with its defaults (Apache and SQLite), SnappyMail with a domain file pointing at the mail server, and Afterlogic with MySQL as in its own compose file. The load rows come from ten different accounts, each sending 200 requests one after another with ApacheBench; every client asks for the same page of 50 messages without threads, and peak RAM is the cgroup peak of every container the client needs. The page rows are medians of five runs in Chromium over a link with about 120 ms latency, so they include the network. Cypht 2.15.0 was tried too, but its Docker image could not open any folder on the test server, so it is left out. The setup and scripts are in e2e/bench.

Side-by-side comparisons are on the website: Golub vs Roundcube, Golub vs SnappyMail and Golub vs Afterlogic WebMail Lite.

Documentation

The documentation covers installation, every configuration option, single sign-on, branding, and every page and setting of the interface, with screenshots.

Quick start

Golub needs an IMAP and SMTP server. Point it at your mail server by the name on its TLS certificate:

services:
  golub:
    image: ghcr.io/stefanpejcic/golub:stable
    restart: unless-stopped
    ports:
      - "8080:8080"
    environment:
      GOLUB_IMAP_HOST: mail.example.com
      GOLUB_IMAP_TLS: implicit          # port 993
      GOLUB_SMTP_TLS: implicit          # port 465
      GOLUB_SECRET_KEY: "..."           # required, create with: openssl rand -base64 32

If Golub and the mail server share a private network and the server has no certificate, use GOLUB_IMAP_TLS: none and GOLUB_SMTP_TLS: none with the server's container name; Golub only allows unencrypted connections to private addresses.

Then open http://localhost:8080 and sign in with a mailbox address and password.

Put Golub behind your reverse proxy for HTTPS, and set GOLUB_TRUST_PROXY to the proxy's address so it sees the real client IP and protocol. Golub can also serve HTTPS itself with GOLUB_TLS_CERT and GOLUB_TLS_KEY.

Images are published for linux/amd64 and linux/arm64, signed with cosign and carry an SBOM and build provenance. GET /healthz reports the running version.

More ways to install, the image tags and how to check the signature are on golubmail.com/download.

Every CI build is scanned with Trivy and fails on a high or critical vulnerability that has a fix.

Configuration

All settings come from environment variables and are checked at startup; a wrong value stops Golub with a message naming the variable.

Variable Default Notes
GOLUB_LISTEN :8080
GOLUB_IMAP_HOST Required.
GOLUB_IMAP_PORT 993 / 143 Depends on GOLUB_IMAP_TLS.
GOLUB_IMAP_TLS starttls implicit, starttls or none (private addresses only).
GOLUB_SMTP_HOST IMAP host
GOLUB_SMTP_PORT 465 / 587 Depends on GOLUB_SMTP_TLS.
GOLUB_SMTP_TLS starttls Same as IMAP.
GOLUB_TLS_CA Extra CA bundle for mail servers with private certificates.
GOLUB_SECRET_KEY Required. Encrypts sessions: openssl rand -base64 32.
GOLUB_SESSION_TTL 12h
GOLUB_TLS_CERT, GOLUB_TLS_KEY Serve HTTPS. Both or neither; reloaded when the files change and on SIGHUP.
GOLUB_TRUST_PROXY Comma-separated CIDRs allowed to set X-Forwarded-*.
GOLUB_SSO_SECRET Enables single sign-on. At least 32 characters.
GOLUB_MASTER_USER, GOLUB_MASTER_PASSWORD Dovecot master user, required with SSO.
GOLUB_DEFAULT_LOCALE en en, sr-Latn, ar or sv.
GOLUB_DEFAULT_THEME system system, light or dark.
GOLUB_BRAND_NAME Golub Shown in the tab title and on the login page.
GOLUB_BRAND_LOGO Path to a .png, .jpg, .svg or .webp logo, up to 512 KB.
GOLUB_BRAND_ACCENT Accent colour for buttons, like #2563eb.
GOLUB_LOG_LEVEL info debug, info, warn or error.

Single sign-on

A control panel can log its users straight into their mailbox. Set GOLUB_SSO_SECRET and a Dovecot master user (GOLUB_MASTER_USER, GOLUB_MASTER_PASSWORD; in docker-mailserver this is config/dovecot-masters.cf). The panel then signs a short-lived token and redirects the browser to /sso?token=....

The token is base64url(payload) + "." + base64url(HMAC-SHA256(secret, payload)), where the payload is:

email|expires|nonce|lang|theme
  • expires is a Unix timestamp at most 60 seconds ahead
  • nonce is random, at least 16 characters; each token works once
  • lang and theme are optional and set the user's language and theme

In PHP:

$payload = implode('|', [$email, time() + 60, bin2hex(random_bytes(16)), 'en', 'system']);
$b64 = fn ($s) => rtrim(strtr(base64_encode($s), '+/', '-_'), '=');
$token = $b64($payload) . '.' . $b64(hash_hmac('sha256', $payload, $secret, true));
header('Location: https://mail.example.com/sso?token=' . $token);

Updating

Golub keeps no state, so updating is pulling a newer image and recreating the container. Pin an exact version in production and check /healthz after the update.

Development

cd web && npm ci && npm run build && cd ..
go test -race ./...
go run ./cmd/golub

The frontend is Svelte and builds into internal/ui/dist, which the Go binary embeds. npm run build:demo builds the static demo into web/dist-demo: the same app, with the API answered by a service worker from browser storage (web/src/demo). It has to be served from the root of its own domain. The website lives in site/: plain HTML pages in a shared layout, built with node site/build.mjs, checked with node site/check.mjs and previewed with node site/serve.mjs. End-to-end tests run Playwright against docker-mailserver; see e2e/. The README screenshots are made by e2e/screenshots/shots.mjs from invented demo mail.

Golub follows semantic versioning. VERSION holds the next release; builds in between report X.Y.Z-dev.N.

Translations

Golub ships in English, Serbian (Latin), Arabic and Swedish. Arabic switches the whole interface to right to left; message text picks its own direction in every language.

Each language is one JSON file in web/src/locales, keyed by message id, with English (en.json) as the source:

"compose.send": "Send",
"folders.unread": { "one": "{count} unread message", "other": "{count} unread messages" }
  • Words in braces such as {count} or {folder} are filled in by Golub: keep them, but move them wherever the sentence needs them.
  • Messages that depend on a number list every plural form your language has, the ones Intl.PluralRules reports: English has one and other, Serbian adds few, Arabic uses zero, one, two, few, many and other.
  • Only the chosen language is downloaded, so every file has to have every key; the check below makes sure of that.

To fix or finish a translation, edit its file and run the check, which reports missing or unknown keys and missing plural forms:

cd web && npm ci && node scripts/check-locales.mjs

To add a language, copy en.json to the new language code (for example de.json), translate it, add it to loaders in web/src/lib/locale.svelte.ts and to Locales in internal/config/config.go, and add a language.<code> entry with the language's own name to every file. Right-to-left languages are listed in RTL in web/src/lib/i18n.ts; Hebrew, Persian and Urdu are already there.

Send the change as a pull request. The Arabic translation was made without a native speaker, so corrections there are especially welcome.

FAQ

What is Golub? A self-hosted webmail client: a web app that lets people use their email account in the browser. It connects to an existing IMAP and SMTP mail server; it is not a mail server itself.

Is Golub a Roundcube alternative? Yes. Golub covers the everyday Roundcube features (folders, search, threads, compose, contacts, identities, signatures, PGP) in a single Go binary instead of a PHP application with a database. It uses far less memory and one IMAP connection per user (see Benchmarks). Roundcube has a large plugin ecosystem for features beyond everyday mail. The full comparison is on the website.

Which mail servers does Golub work with? Any server that speaks IMAP and SMTP submission. It is built and tested against Dovecot and Postfix, including docker-mailserver. Single sign-on needs a Dovecot master user.

Does Golub need a database? No. Sessions live in an encrypted cookie, and settings, contacts and signatures are stored in the user's own mailbox in hidden IMAP folders.

How do I install Golub? Run the ghcr.io/stefanpejcic/golub Docker image with your IMAP host and a secret key, as in Quick start. Images are published for amd64 and arm64. Step-by-step guides are in the documentation.

Does Golub support PGP encryption? Yes. OpenPGP encryption, decryption and signatures run in the browser and work with Thunderbird, Mailvelope and other PGP/MIME clients.

Can a control panel or app log users in automatically? Yes, with single sign-on: the host app signs a short-lived token and redirects to /sso.

Does Golub work on phones? Yes. The interface adapts to small screens and supports swipe gestures. There is no separate app to install.

Which languages does Golub support? English, Serbian (Latin), Swedish, and Arabic with right-to-left layout. New languages are one JSON file each; see Translations.

Is Golub free? Yes. It is open source under GPL-3.0-or-later, with no paid edition and no telemetry.

Roadmap

Notifications and avatars
  • Unread count in the tab title, kept up to date while the tab is in the background
  • Favicon dot for new mail and optional desktop notifications
  • Avatars: initials in a stable colour by default, no network requests
  • BIMI logos for senders whose mail passed DMARC, loaded through the image proxy
  • Optional Gravatar, off by default and loaded through the proxy
AI assistant (optional, privacy first)

Off unless the admin points Golub at an OpenAI-compatible endpoint, so a local Ollama or vLLM works. Nothing leaves the server unless the user clicks an AI action: no background analysis, nothing stored, and users can turn it off.

  • Summarize a message or a long thread
  • Reply suggestions: two or three short drafts to edit in compose
  • Compose helpers: rewrite, shorten, fix grammar, change tone, translate
  • Translate an incoming message in place
  • Natural-language search turned into IMAP SEARCH ("invoices from Marko last month")
  • Pull out action items, dates and deadlines from a message
  • Explain why a message looks like phishing or spam
  • Admin limits: per-user rate limit, maximum input size, attachments and quoted history left out

License

GPL-3.0-or-later. See LICENSE.

Explore related projects

Loading…