Home
Softono
mail-archiver

mail-archiver

Open source Docker
1.9K
Stars
66
Forks
15
Issues
16
Watchers
6 days
Last Commit

About mail-archiver

# πŸ“§ Mail-Archiver - Email Archiving System **A comprehensive solution for archiving, searching, and exporting emails** 🌐 **Website:** [mail-archiver.org](https://mail-archiver.org) <div style="display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px;"> <a href="https://mail-archiver.org" target="_blank"><img src="https://img.shields.io/badge/Website-mail--archiver.org-4A90D9?style=for-the-badge&logo=globe&logoColor=white" alt="Website"></a> <a href="#"><img src="https://img.shields.io/badge/Docker-2CA5E0?style=for-the-badge&logo=docker&logoColor=white" alt="Docker"></a> <a href="#"><img src="https://img.shields.io/badge/.NET-512BD4?style=for-the-badge&logo=dotnet&logoColor=white" alt=".NET"></a> <a href="#"><img src="https://img.shields.io/badge/PostgreSQL-316192?style=for-the-badge&logo=postgresql&logoColor=white" alt="PostgreSQL"></a> <a href="#"><img src="https://img.shields.io/badge/Bootstrap-563D7C?style=for-the-badge&logo=bootstrap&logoColor=white" alt="Bootstrap"></a> <a href="ht ...

Platforms

Web Self-hosted Docker

Languages

Docker

πŸ“§ Mail-Archiver - Email Archiving System

A comprehensive solution for archiving, searching, and exporting emails

🌐 Website: mail-archiver.org

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

✨ Key Features

πŸ“Œ Core Features

  • Automated archiving of incoming and outgoing emails from multiple accounts
  • Storage of email content and attachments with scheduled synchronization
  • Mobile and desktop optimized, multilingual responsive UI with dark mode
  • OpenID Connect (OIDC) for integration of external authentication services (OIDC Implementation Guide)

πŸ” Search & Access

  • Advanced search across all archived emails with filtering options
  • Preview emails with attachment list
  • Export entire mail accounts as mbox files or zipped EML archives
  • Export selected individual emails or email batches

πŸ‘₯ User Management

  • Multi-user support with account-specific permissions
  • Dashboard with statistics, storage monitoring, and sender analysis
  • Comprehensive access logging with detailed activity tracking of user activities (Access, Export, Deletion, Restore and many more) - see Access Logging Guide for details

🧩 Email Provider Support

  • IMAP: Traditional IMAP accounts with full synchronization capabilities
  • M365: Microsoft 365 mail accounts via Microsoft Graph API (Setup Guide)
  • IMPORT: Import-only accounts for migrating existing email archives

πŸ“₯ Import & Restore Functions

  • MBox Import and EML Import (ZIP files with folder structure support)
  • Restore selected emails or entire mailboxes to destination mailboxes

πŸ—‘οΈ Retention Policies

  • Configure automatic deletion of archived emails from mailserver after specified days (Retention Policies Documentation)
  • Set retention period per email account (e.g., 30, 90, or 365 days)
  • Local Archive Retention: Configure separate retention period for local archive

πŸ“š 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:


3. Edit the database configuration in the `docker-compose.yml` and set a secure password in the `POSTGRES_PASSWORD` variable and the `ConnectionString`.

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

5. 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").

6. 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!

7. Initial start of the containers:
```bash
docker compose up -d
  1. Restart containers:

    docker compose restart
  2. Access the application in your prefered browser.

  3. 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 [email protected] 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)