Repolode
s1t5

s1t5/mail-archiver

A self-hosted web app that archives, searches, and exports emails from multiple IMAP and Microsoft 365 accounts.

Stars
2,242
Forks
97
Open issues
30
Last commit
1 hour ago

What is it?

Mail-Archiver is a self-hosted web application for keeping copies of emails from multiple accounts. It syncs folders on a schedule and stores messages with their attachments in a PostgreSQL database, where they can be searched with filters, previewed, and exported as mbox or zipped EML files.

Accounts can be connected over plain IMAP, through Microsoft Graph for Microsoft 365 tenants, or through OAuth2 device code flow for personal Outlook.com and Hotmail accounts. Archived mail can be restored or copied to another mailbox while keeping its folder structure, and retention rules can delete old messages from the mail server after a set period. A read-only REST API and an optional MCP endpoint give scripts and AI agents access to the archive without exposing mailbox credentials.

The app supports multiple users with per-account permissions, a dashboard with storage statistics, an access log of user activity, and OIDC sign-in. It is deployed with Docker Compose and runs behind a reverse proxy that provides HTTPS.

Key features

  • 01Scheduled folder sync from multiple IMAP, Microsoft 365, and personal Microsoft accounts.
  • 02Advanced search with filters, plus email preview with attachments.
  • 03Export accounts or selected emails as mbox or zipped EML.
  • 04Mailbox migration that copies emails while preserving folder structure.
  • 05Retention policies that delete mail from the server after a configurable period.
  • 06Read-only REST API and MCP endpoint for scripts and AI agents.
  • 07Multi-user access with per-account permissions and OIDC sign-in.

Use cases

  • Keeping a long-term copy of company or personal mailboxes on your own server.
  • Migrating or consolidating email archives from old accounts into a new mailbox.
  • Meeting compliance needs by locking manual deletion of archived mail.
  • Letting scripts or AI assistants query an email archive through a read-only API.

In collections

Topics

FAQ

What is mail-archiver?
A self-hosted web app that archives, searches, and exports emails from multiple IMAP and Microsoft 365 accounts. Mail-Archiver is a self-hosted web application for keeping copies of emails from multiple accounts. It syncs folders on a schedule and stores messages with their attachments in a PostgreSQL database, where they can be searched with filters, previewed, and exported as mbox or zipped EML files.
Is mail-archiver free to use? What license does it have?
mail-archiver is open source under the GPL-3.0 license. Check the license terms before using it in commercial products.
Is mail-archiver still maintained?
Actively maintained. The last commit to mail-archiver was on Nov 7, 2026.
What can I use mail-archiver for?
Keeping a long-term copy of company or personal mailboxes on your own server. Migrating or consolidating email archives from old accounts into a new mailbox. Meeting compliance needs by locking manual deletion of archived mail. Letting scripts or AI assistants query an email archive through a read-only API.
Where can I get mail-archiver?
The source code and installation instructions are on GitHub: https://github.com/s1t5/mail-archiver

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects