Overview
Discover what makes SnappyMail powerful
SnappyMail is a lightweight, high‑performance webmail front‑end written in PHP and JavaScript that replaces the legacy RainLoop codebase. From a developer’s perspective it is designed to run in any PHP 7.4+ environment without the need for a relational database, relying instead on IMAP/SMTP servers for persistence. The application is bundled as a single `index.php` entry point with all assets inlined (CSS/JS), which dramatically reduces the attack surface and simplifies deployment. The core engine exposes a REST‑style API under `/api/` that allows programmatic access to mail folders, messages, and account settings. All API calls are authenticated via session cookies and support CSRF protection out of the box.
Language & Runtime
Frameworks & Libraries
Database
Storage
Overview
SnappyMail is a lightweight, high‑performance webmail front‑end written in PHP and JavaScript that replaces the legacy RainLoop codebase. From a developer’s perspective it is designed to run in any PHP 7.4+ environment without the need for a relational database, relying instead on IMAP/SMTP servers for persistence. The application is bundled as a single index.php entry point with all assets inlined (CSS/JS), which dramatically reduces the attack surface and simplifies deployment. The core engine exposes a REST‑style API under /api/ that allows programmatic access to mail folders, messages, and account settings. All API calls are authenticated via session cookies and support CSRF protection out of the box.
Architecture
- Language & Runtime: PHP 7.4+ (strict typing, ES2020 JS)
- Frameworks & Libraries:
- RainLoop core (forked and heavily refactored)
- Sabre/VObject for iCalendar/VCF handling
- Squire (a lightweight HTML editor) replacing CKEditor
- PharData & ZipArchive for ZIP handling instead of pclZip
- Database: None required; configuration and user state are stored in the IMAP server or a lightweight JSON file.
- Storage: Optional MySQL/MariaDB for address book and plugin data; supports
utf8mb4. - Containerization: Official Docker image (
djmaze/snappymail) is available; the CI pipeline publishes a small Alpine‑based image (~60 MB).
The application follows a modular MVC pattern where the front‑end communicates with the back‑end via JSON. The UI is built with vanilla JavaScript and modern CSS, leveraging Service Workers for push notifications and offline support.
Core Capabilities
- Mail Operations: Full IMAP/SMTP integration, Sieve script editing, attachment handling (ZIP), and fetch‑metadata support.
- API Exposure: CRUD operations for messages, folders, contacts, and settings; authentication via
password_hash/password_verify. - Plugin System: Plugins can be dropped as
.pharfiles or installed via Composer; the core provides hooks for UI injection and server‑side extensions. - Sieve Support: Advanced editor with syntax highlighting; can load and edit Sieve scripts directly on the server.
- Dark Mode & Accessibility: CSS theming with optional removal of background colors for true dark mode, responsive design without user‑agent sniffing.
Deployment & Infrastructure
- Self‑Hosting: Requires a web server (Apache, Nginx) with PHP 7.4+,
mbstring, andzipextensions. No database is mandatory, making it ideal for lightweight VPS or Docker deployments. - Scalability: Stateless PHP pages allow horizontal scaling behind a load balancer; session data can be stored in Redis or Memcached if required.
- Containerization: Docker images are Alpine‑based, support multi‑stage builds, and expose a single port (
80). The CI pipeline ensures the image is kept up‑to‑date with security patches. - Performance: Mobile booting ~138 KB (Brotli), Lighthouse scores >99% on mobile, thanks to inlined assets and minimal JS.
Integration & Extensibility
- Webhooks: Supports outgoing webhooks for new mail notifications and Sieve rule triggers.
- API Clients: The JSON API can be consumed by any HTTP client; authentication tokens are cookie‑based but can be adapted for token auth.
- Custom Plugins: Developers can write plugins that add menu items, modify message rendering, or integrate third‑party services (e.g., OAuth).
- Theme & Language Packs: Themes are pure CSS; language packs are JSON files that can be extended or replaced.
Developer Experience
- Configuration: All settings are stored in
config.inc.phpand can be edited via the admin UI or directly as PHP arrays. - Documentation: Comprehensive Wiki covers installation, API usage, plugin development, and troubleshooting. The source is well‑commented and follows PSR standards.
- Community & Support: Active GitHub repository, issue tracker, and Discord channel provide quick feedback loops. The AGPL license ensures that improvements remain open source.
Use Cases
- Enterprise Self‑Hosted Mail – Deploy on a private intranet to provide employees with a modern webmail client without a database overhead.
- DevOps & CI Pipelines – Use the Docker image in Kubernetes or Docker‑Compose for rapid testing of mail clients.
- Educational Platforms – Embed SnappyMail in learning management systems where students need secure email access.
- Open‑Source Projects – Fork and customize the UI or plugin set for niche workflows (e.g., integrating with custom Sieve filters).
Advantages
- Zero‑DB Footprint: Eliminates the need for a separate database, reducing complexity and attack surface.
- Performance & Size: Tiny footprint, fast mobile load times, and modern JS make it competitive with commercial clients.
- Extensibility: Plugin system, API surface, and theme support give developers full control over the user experience.
- Security: Uses PHP’s native password hashing, logs failed attempts to syslog, and offers Fail2ban integration.
- Open Source Licensing:
Open SourceReady to get started?
Join the community and start self-hosting SnappyMail today
Related Apps in apis-services
Mastodon
Decentralized, real‑time social networking
Discourse
Open‑source community forum platform with real‑time chat and AI
Rocket.Chat
Secure, open‑source team communication platform
Novu
Unified notification platform for multi‑channel delivery
Mattermost
Secure, self‑hosted team collaboration with chat, voice, and AI
Jitsi Meet
Free, encrypted video conferencing for everyone
Weekly Views
Repository Health
Information
Explore More Apps
Kanboard
Simple self‑hosted Kanban for focused project management
Asterisk
Open‑source PBX for voice, video and messaging
HOMER 10
Carrier‑grade VoIP & RTC observability platform
CollectiveAccess - Providence
Open-source collections cataloguing for museums and archives
Etherpad
Real‑time collaborative web editor
Black Candy
Self-hosted music streaming for your personal library