Project overview¶
Purpose¶
Mail Safehouse is a self-hosted web application that backs up a Microsoft 365 tenant and restores from those backups. It replaces Veeam Backup for Microsoft 365, with three priorities:
Simple to run: one compose file, few moving parts, sensible defaults.
Modular: each workload is a self-contained module that can be enabled, disabled, versioned and tested on its own.
Documented: every public interface is documented in code, and the docs site is generated from the same repository.
Scope¶
Modules in scope (v1)¶
Module |
Protects |
|---|---|
|
User, shared and resource mailboxes: mail, calendar, contacts, tasks |
|
OneDrive for Business drives, files, versions (optional), sharing info |
|
Sites, document libraries, lists, pages, site permissions |
|
Users, groups, apps, service principals, Conditional Access, roles, etc. |
Modules planned for later¶
Module |
Protects |
|---|---|
|
Teams, channels, settings, membership, tabs, channel messages |
Teams is not used in the initial tenant, so it is not part of v1. The module
contract is designed with it in mind (see Module system). Files in
Teams channels live in SharePoint and are already covered by the sharepoint
module.
Exports¶
EML (mail), ICS (calendar), VCF (contacts) and original files are in scope from the start. PST export is wanted and planned as a follow-up within the Exchange work; see Module system (Exchange) for why it is a separate step.
Out of scope for v1¶
Multi-tenant / MSP mode (the data model keeps a
tenant_ideverywhere so this can be added later without a migration of the backup format).Intune, Planner, Power Platform, Exchange Online transport configuration (candidates for later modules).
Agents installed on Windows hosts. Everything goes through Microsoft Graph.
Initial deployment profile¶
The first production target is deliberately small, which shapes the defaults:
Aspect |
Initial target |
|---|---|
Tenants |
One (the owner’s own tenant) |
Users |
About 10 |
Data |
Under 50 GB total |
Storage |
Local disk on the Docker host ( |
Workers |
One worker container is enough |
The design still allows more users, S3 storage and more workers later; those paths are built but not tuned or load-tested until they are needed.
Functional requirements¶
FR-1 Enable or disable each module from the UI or config; a disabled module does no discovery and no jobs, but its existing backups stay browsable until retention removes them.
FR-2 Auto-discover protectable objects (mailboxes, drives, sites, …) and protect them by include/exclude rules (all users, group membership, explicit lists).
FR-3 Incremental backups using Graph delta queries; a full pass only on first run or when a delta token expires.
FR-4 Schedules per backup job, with per-job retention.
FR-5 Point-in-time browse and search of backed-up items.
FR-6 Restore to original location, to an alternate location (another mailbox/site), or export as a download (EML, later PST, for mail).
FR-7 Entra ID: show differences between two snapshots, and restore individual objects or properties.
FR-8 Job history, per-item error reporting, and email notifications to backup admins via Graph or SMTP (Notifications).
FR-9 Audit log of every browse, restore, export and setting change.
Non-functional requirements¶
NFR-1 All components run as containers; the host needs only Docker Engine with the Compose plugin (Ubuntu 26.04 LTS; RHEL 9/10 with Docker CE). Podman is not supported. See Deployment.
NFR-2 Backup data encrypted at rest; optional immutable storage.
NFR-3 Respects Graph throttling (429/503
Retry-After) and scales by adding worker containers.NFR-4 100% of public Python APIs have docstrings (enforced in CI).
NFR-5 Open source under the Apache License 2.0 (ADR 0005: Apache License 2.0).