MCPSERV.CLUB
b1gMail

b1gMail

Self-Hosted

Self-hosted PHP email platform with calendar, tasks and cloud drive

Stale(40)
0stars
0views

Overview

Discover what makes b1gMail powerful

b1gMail is a PHP‑based, feature‑rich mail server designed for self‑hosting on conventional shared hosting environments. From a technical standpoint it functions as an all‑in‑one webmail solution that encapsulates SMTP, IMAP/POP3 handling, and a comprehensive web UI. The core engine parses incoming mail via the `mail()` wrapper or custom SMTP listeners, stores messages in a MySQL/PostgreSQL database and the filesystem, and serves them through an AJAX‑driven interface. Its performance layer is built around caching (opcache, memcached) and efficient SQL queries that keep latency low even with thousands of concurrent users.

Language

Frameworks

Database

Mail Transport

Overview

b1gMail is a PHP‑based, feature‑rich mail server designed for self‑hosting on conventional shared hosting environments. From a technical standpoint it functions as an all‑in‑one webmail solution that encapsulates SMTP, IMAP/POP3 handling, and a comprehensive web UI. The core engine parses incoming mail via the mail() wrapper or custom SMTP listeners, stores messages in a MySQL/PostgreSQL database and the filesystem, and serves them through an AJAX‑driven interface. Its performance layer is built around caching (opcache, memcached) and efficient SQL queries that keep latency low even with thousands of concurrent users.

Architecture & Technical Stack

  • Language: PHP 7.x/8.x, heavily object‑oriented with a lightweight MVC pattern.
  • Frameworks: Custom framework inspired by Laravel conventions; uses Composer for dependency management.
  • Database: MySQL/MariaDB (primary) with optional PostgreSQL support; schema normalised for users, mailboxes, attachments, and shared resources.
  • Mail Transport: Built‑in SMTP server (via swiftmailer), optional external relay, and IMAP/POP3 listeners.
  • Caching: Opcache for PHP bytecode, optional Redis/Memcached for session and query caching.
  • Frontend: HTML5/Bootstrap 4+ with Vue.js components for drag‑and‑drop, real‑time updates, and responsive design.

Core Capabilities & APIs

  • RESTful API: Exposes endpoints for user authentication, mailbox operations, contact CRUD, calendar events, and file storage. All routes are token‑based (JWT) and can be sandboxed per tenant.
  • Webhooks: Configurable callbacks for new mail, message deletion, or user lifecycle events.
  • Plugin Architecture: Developers can add extensions via a simple hook system; plugins register callbacks for events such as onMessageReceived or beforeUserDelete.
  • SMTP/IMAP Integration: External clients can connect using standard protocols; the server supports DKIM, SPF checks, and optional TLS termination.
  • Multitenancy: Each domain or sub‑domain can be isolated with its own configuration, quotas, and branding.

Deployment & Infrastructure

b1gMail runs on any LAMP/LEMP stack with PHP ≥ 7.2 and a relational database. It is lightweight enough for shared hosting yet scalable to dedicated servers or cloud VMs. Docker images are available, simplifying CI/CD pipelines: a single docker-compose.yml can spin up the web app and MySQL in minutes. For high‑availability, multiple instances behind a load balancer can share the same database and file storage (via NFS or S3‑compatible object stores).

Integration & Extensibility

  • SMTP Relay: Hook into external SMTP services (SendGrid, Postfix) for outbound delivery.
  • OAuth2 Support: Allow users to authenticate via Google or Microsoft accounts for single sign‑on.
  • Custom Domains: Add DNS records programmatically; the system validates MX, SPF, and DKIM automatically.
  • SDK: A PHP SDK mirrors the REST API, easing integration into existing PHP applications.
  • CLI Tools: Administrative scripts for bulk user creation, quota enforcement, and log rotation.

Developer Experience

The configuration is driven by a single config.php file, with environment variables for secrets. Documentation covers installation, API reference, and plugin development in roughly 50 pages of Markdown. Community support is active on GitHub issues and a dedicated Discord channel; contributors regularly submit security patches and performance improvements. The codebase follows PSR‑4 autoloading, making IDE navigation straightforward.

Use Cases

  • Non‑profits & Associations: Deploy a free, self‑hosted email service for members without costly hosting plans.
  • Enterprise Intranet: Provide a unified communication platform (mail, calendar, cloud drive) behind corporate firewalls.
  • Educational Institutions: Offer students a customizable email domain with built‑in task and note features.
  • Developer Portfolios: Showcase a personal mail server with API access, demonstrating PHP and web‑mail expertise.

Advantages Over Alternatives

  • Zero Hosting Costs: Runs on shared hosting; no root access required.
  • Full Control & Privacy: All data stays on your servers; no third‑party telemetry.
  • Rich Feature Set: Combines mail, calendar, tasks, and cloud storage in one codebase.
  • Extensible Architecture: Plugin hooks and REST API allow rapid feature additions without core modifications.
  • Performance Optimised: Caching layers and efficient SQL keep response times low, even under load.

For developers seeking a turnkey yet highly customizable email platform that can be deployed in minutes on standard hosting, b1gMail offers a compelling blend of power, flexibility, and maintainability.

Open SourceReady to get started?

Join the community and start self-hosting b1gMail today