A self-hosted, encrypted web email client written entirely in Go. Supports Gmail and Outlook via OAuth2, plus any standard IMAP/SMTP provider.
- work still in progress ( gmail and hotmail email not tested yet, just prepared the app for it)
- AI is involved in making this work, as I do not have the skill and time to do it on my own
- looking for any advice and suggestions to improve it!
- Unified inbox — view emails from all connected accounts in one stream
- Gmail & Outlook OAuth2 — modern, token-based auth (no storing raw passwords for these providers)
- IMAP/SMTP — connect any provider (ProtonMail Bridge, Fastmail, iCloud, etc.)
- AES-256-GCM encryption — all email content encrypted at rest in SQLite
- bcrypt password hashing — GoWebMail account passwords hashed with cost=12
- Send / Reply / Forward — full compose workflow
- Folder navigation — per-account folder/label browsing
- Full-text search — across all accounts locally
- Dark-themed web UI — clean, keyboard-shortcut-friendly interface
# 1. Clone / copy the project
git clone https://github.com/ghostersk/gowebmail && cd gowebmail
go build -o gowebmail ./cmd/server
# if you want smaller exe ( strip down debuginformation):
go build -ldflags="-s -w" -o gowebmail ./cmd/server
./gowebmailVisit http://localhost:8080, default login admin/admin, register an account, then connect your email.
git clone https://github.com/ghostersk/gowebmail && cd gowebmail
go run ./cmd/server/main.go
# check ./data/gowebmail.conf what gets generated on first run if not exists, update as needed.
# then restart the app# List all admins with MFA status
./gowebmail --list-admin
# USERNAME EMAIL MFA
# -------- ----- ---
# admin admin@example.com ON
# Reset an admin's password (min 8 chars)
./gowebmail --pw admin "NewSecurePass123"
# Disable MFA so a locked-out admin can log in again
./gowebmail --mfa-off admin- Go to Google Cloud Console → New project
- Enable Gmail API
- Create OAuth 2.0 Client ID (Web application)
- Add Authorized redirect URI:
http://localhost:8080/auth/gmail/callback - Set env vars:
GOOGLE_CLIENT_ID,GOOGLE_CLIENT_SECRET
Important: In the Google Cloud Console, add the scope
https://mail.google.com/to allow IMAP access. You'll also need to add test users while in "Testing" mode.
- Go to Azure portal → App registrations → New registration
- Set redirect URI:
http://localhost:8080/auth/outlook/callback - Under API permissions, add:
https://outlook.office.com/IMAP.AccessAsUser.Allhttps://outlook.office.com/SMTP.Sendoffline_access,openid,profile,email
- Create a Client secret
- Set env vars:
MICROSOFT_CLIENT_ID,MICROSOFT_CLIENT_SECRET,MICROSOFT_TENANT_ID
- ENCRYPTION_KEY is critical — back it up. Without it, the encrypted SQLite database is unreadable.
- Email content (subject, from, to, body) is encrypted at rest using AES-256-GCM.
- OAuth2 tokens are stored encrypted in the database.
- Passwords for GoWebMail accounts are bcrypt hashed (cost=12).
- All HTTP responses include security headers (CSP, X-Frame-Options, etc.).
- In production, run behind HTTPS (nginx/Caddy) and set
SECURE_COOKIE=true.
github.com/emersion/go-imap IMAP client
github.com/emersion/go-smtp SMTP client
github.com/emersion/go-message MIME parsing
github.com/gorilla/mux HTTP routing
github.com/mattn/go-sqlite3 SQLite driver (CGO)
golang.org/x/crypto bcrypt
golang.org/x/oauth2 OAuth2 + Google/Microsoft endpoints
CGO_ENABLED=1 GOOS=linux go build -ldflags="-s -w" -o gowebmail ./cmd/serverCGO is required by go-sqlite3. Cross-compilation requires a C cross-compiler.
This project is licensed under the GPL-3.0 license.