Voltar ao ranking

s1t5/mail-archiver

C#

Mail-Archiver is a web application for archiving, searching, and exporting emails from multiple accounts. Featuring folder sync, attachment support, mailbox migration and a dashboard.

archivearchiverdocker-composeimapmailbackupmigration
Crescimento de estrelas
Estrelas
2k
Forks
72
Crescimento semanal
Issues
15
5001k1.5k2k
set. de 25dez. de 25abr. de 26jul. de 26
README

📧 Mail-Archiver - Email Archiving System

A comprehensive solution for archiving, searching, and exporting emails

🌐 Website: mail-archiver.org

Website Docker .NET PostgreSQL Bootstrap Buy Me a Coffee Ko-fi

✨ Key Features

📌 Core Features

  • Automated archiving from multiple accounts with scheduled sync
  • Multilingual responsive UI with dark mode
  • OpenID Connect (OIDC) authentication (OIDC Guide)

🔍 Search & Access

  • Advanced search with filters
  • Email preview with attachments
  • Export accounts or selected emails as mbox / zipped EML
  • Read-only REST API (v1) for programmatic access to the archive via scoped per-user API keys — lets scripts and AI agents read archived mail without ever exposing mailbox credentials (REST API Guide)

👥 User Management

  • Multi-user support with account-specific permissions
  • Dashboard with statistics and storage monitoring
  • Detailed access logging (Access Logging Guide)

🧩 Email Provider Support

  • IMAP: Traditional IMAP accounts with full synchronization capabilities
  • M365: Microsoft 365 mail accounts via Microsoft Graph API (Setup Guide)
  • Microsoft Personal: Personal Microsoft accounts (Outlook.com, Hotmail, live.com, M365 Family) via OAuth2 Device Code Flow — ships with a pre-registered shared Client ID so no Azure App Registration is required (Setup Guide)
  • IMPORT: Import-only accounts for migrating existing email archives

🏢 M365 Tenant Import

  • Bulk-import all Microsoft 365 mailboxes of a tenant from one form
  • Import all mailboxes or select specific ones; skips existing and disabled accounts
  • See the M365 Tenant Import Guide for details

📥 Import & Restore Functions

  • MBox and EML (ZIP) import with folder structure support
  • Restore emails or entire mailboxes
  • 📤 Mailbox Migrations: Copy emails between mailboxes while preserving folder structure (Migration Guide)

🗑️ Retention Policies

  • Automatic deletion from mailserver after a configurable period (Retention Policies)
  • Per-account retention (e.g., 30, 90, or 365 days)
  • Separate retention for the local archive

🔒 Deletion Lock (Compliance)

  • Disable manual deletion of archived emails via DeletionPolicy__DeletionAllowed=false
  • Local retention deletion remains exempt and still runs
  • See Setup Guide for details

📋 Access Log

  • The application logs various types of user activities such as Login, Opening, Searches, Exports and many more. (Logging)

📚 Documentation

For detailed documentation on installation, configuration, and usage, please refer to the Documentation Index. Please note that the documentation is still fresh and is continuously being expanded.

🖼️ Screenshots

Dashboard

Mail-Archiver Dashboard

Archive

Mail-Archiver Archive

Email Details

Mail-Archiver Mail

🚀 Quick Start

Prerequisites

🛠️ Installation

  1. Install the prerequisites on your system

  2. Create a docker-compose.yml file

services:
  mailarchive-app:
    image: s1t5/mailarchiver:latest
    restart: always
    environment:
      # Database Connection
      - ConnectionStrings__DefaultConnection=Host=postgres;Database=MailArchiver;Username=mailuser;Password=masterkey;

      # Authentication Settings
      - Authentication__Username=admin
      - Authentication__Password=secure123!

      # TimeZone Settings
      - TimeZone__DisplayTimeZoneId=Etc/UCT
    ports:
      - "5000:5000"
    networks:
      - postgres
    volumes:
      - ./data-protection-keys:/app/DataProtection-Keys
    depends_on:
      postgres:
        condition: service_healthy


  postgres:
    image: postgres:17-alpine
    restart: always
    environment:
      POSTGRES_DB: MailArchiver
      POSTGRES_USER: mailuser
      POSTGRES_PASSWORD: masterkey
    volumes:
      - ./postgres-data:/var/lib/postgresql/data
    networks:
      - postgres
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U mailuser -d MailArchiver"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 10s

networks:
  postgres:
  1. Edit the database configuration in the docker-compose.yml and set a secure password in the POSTGRES_PASSWORD variable and the ConnectionString.

  2. Definie a Authentication__Username and Authentication__Password which is used for the admin user.

  3. Adjust the TimeZone__DisplayTimeZoneId environment variable to match your preferred timezone (default is "Etc/UCT"). You can use any IANA timezone identifier (e.g., "Europe/Berlin", "Asia/Tokyo").

  4. Configure a reverse proxy of your choice with https to secure access to the application.

⚠️ Attention The application itself does not provide encrypted access via https! It must be set up via a reverse proxy!

  1. Initial start of the containers:
docker compose up -d
  1. Restart containers:
docker compose restart
  1. Access the application in your prefered browser.

  2. Login with your defined credentials and add your first email account:

  • Navigate to "Email Accounts" section
  • Click "New Account"
  • Enter your server details and credentials
  • Save and start archiving!
  • If you want, create other users and assign accounts.

🔐 Security Notes

  • Use strong passwords and change default credentials
  • Consider implementing HTTPS with a reverse proxy in production
  • Regular backups of the PostgreSQL database recommended (see Backup & Restore Guide for detailed instructions)

⚙️ Advanced Setup

For a complete list of all configuration options, please refer to the Setup Guide.

📋 Technical Details

Architecture

  • ASP.NET Core 10 MVC application
  • PostgreSQL database for email storage
  • MailKit library for IMAP communication
  • Microsoft Graph API for M365 email access
  • Background service for email synchronization
  • Bootstrap 5 and Chart.js for frontend

🤝 Contributing

We welcome contributions from the community! Please read our Contributing Guide for detailed information about how to contribute to Mail Archiver.

For code changes by third parties, please coordinate with us via email at mail@s1t5.dev before making any changes.

You can also:

  • Open an Issue for bug reports or feature requests
  • Submit a Pull Request for improvements
  • Help improve documentation

💖 Support the Project

If you find this project useful and would like to support its continued development, you can buy me a coffee! Your support helps me dedicate more time and resources to improving the application and adding new features. While financial support is not required, it is greatly appreciated and helps ensure the project's ongoing maintenance and enhancement.

Buy Me a Coffee Ko-fi GitHub Sponsors

🌟 Project Sponsors

With the generous support of our sponsors, Mail Archiver continues to evolve. Thank you for making it possible!

Disclaimer: The services listed above are third-party offerings and are neither affiliated with, endorsed by, nor tested by the Mail Archiver project.

Admin Intelligence

💝 Individual Sponsors

A special thanks to all individual sponsors who support this project through GitHub Sponsors, Ko-fi, and Buy Me a Coffee. Your contributions make a real difference!


📄 License: GNU GENERAL PUBLIC LICENSE Version 3 (see LICENSE file)

Repositórios relacionados
gildas-lormeau/SingleFile

Web Extension for saving a faithful copy of a complete web page in a single HTML file

JavaScriptnpmGNU Affero General Public License v3.0browserarchive
getsinglefile.com
21.9k1.4k
hoochanlon/hamuleite

🏔️国立台湾大学、新加坡国立大学、早稻田大学、东京大学,中央研究院(台湾)以及中国重点高校及科研机构,社科、经济、数学、博弈论、哲学、系统工程类学术论文等知识库。

PythonPyPImirrorssocial
hoochanlon.github.io/hamuleite
9.5k1.9k
tubearchivist/tubearchivist

Your self hosted YouTube media server

PythonPyPIGNU General Public License v3.0youtubeyoutube-dl
tubearchivist.com
8.3k411
kalcaddle/KodExplorer

A web based file manager,web IDE / browser based code editor

PHPPackagistfilemanagerfile-sharing
kodcloud.com
6.4k1.8k
papra-hq/papra

The minimalistic document archiving platform.

TypeScriptnpmGNU Affero General Public License v3.0apparchive
demo.papra.app
5k258
UltimaHoarder/UltimaScraper

Scrape all the media from an OnlyFans account - Updated regularly

PythonPyPIGNU General Public License v3.0onlyfansdatascraping
4.3k613
RipMeApp/ripme

Downloads albums from the web in bulk for archive purposes

JavaMavenMIT Licenseripmejava
4.1k672
DO-SAY-GO/dn

💾 dn - offline full-text search and archiving for your Chromium-based browser.

JavaScriptnpmarchiveweb-archive
dosaygo.com/downloadnet
3.9k147
dosyago/dn

💾 dn - offline full-text search and archiving for your Chromium-based browser.

JavaScriptnpmOtherarchiveweb-archive
localhost
3.8k146
Kovah/LinkAce

LinkAce is a self-hosted archive to collect links of your favorite websites.

PHPPackagistGNU General Public License v3.0bookmarksbookmark-manager
linkace.org
3.3k204
rusq/slackdump

Save or export your private and public Slack messages, threads, files, and users locally without admin privileges.

GoGo ModulesGNU Affero General Public License v3.0slackarchive
2.7k144
Serene-Arc/bulk-downloader-for-reddit

Downloads and archives content from reddit

PythonPyPIGNU General Public License v3.0redditimgur
pypi.org/project/bdfr
2.6k240