All apps · 0 apps
mail-archiver
Docker app from Emphyrio's Repository
Overview
Readme
View on GitHub📧 Mail-Archiver - Email Archiving System
A comprehensive solution for archiving, searching, and exporting emails
🌐 Website: mail-archiver.org
✨ 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

Archive

Email Details

🚀 Quick Start
Prerequisites
🛠️ Installation
Install the prerequisites on your system
Create a
docker-compose.ymlfile
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:
Edit the database configuration in the
docker-compose.ymland set a secure password in thePOSTGRES_PASSWORDvariable and theConnectionString.Definie a
Authentication__UsernameandAuthentication__Passwordwhich is used for the admin user.Adjust the
TimeZone__DisplayTimeZoneIdenvironment variable to match your preferred timezone (default is "Etc/UCT"). You can use any IANA timezone identifier (e.g., "Europe/Berlin", "Asia/Tokyo").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!
- Initial start of the containers:
docker compose up -d
- Restart containers:
docker compose restart
Access the application in your prefered browser.
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.
🌟 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.
|
|
💝 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)
Install mail-archiver on Unraid in a few clicks.
Find mail-archiver in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.
Requirements
Categories
Download Statistics
Total Downloads Over Time
Related apps
Explore more like this
Explore allLinks
Details
s1t5/mailarchiverRuntime arguments
- Web UI
http://[IP]:[PORT:5000]- Network
bridge- Shell
sh- Privileged
- false
Template configuration
Web interface port
- Target
- 5000
- Default
- 5000
- Value
- 5000
Folder for storing data protection keys
- Target
- /app/DataProtection-Keys
- Default
- /mnt/user/appdata/mailarchiver/data-protection-keys
- Value
- /mnt/user/appdata/mailarchiver/data-protection-keys
PostgreSQL connection string. Format: Host=postgres-ip-address;Port=5432;Database=dbname;Username=user;Password=pass; Replace 'postgres' with your PostgreSQL IP address (on bridge network) or container name (on custom network) and update credentials as needed.
- Target
- ConnectionStrings__DefaultConnection
- Default
- Host=postgres-ip-address;Port=5432;Database=MailArchiver;Username=mailuser;Password=masterkey;
- Value
- Host=postgres;Port=5432;Database=MailArchiver;Username=mailuser;Password=masterkey;
The username for the admin account.
- Target
- Authentication__Username
- Default
- admin
- Value
- admin
The password for the admin account.
- Target
- Authentication__Password
- Default
- secure123!
- Value
- secure123!
The time zone used for displaying email timestamps in the UI. Use any TZ identifier from: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
- Target
- TimeZone__DisplayTimeZoneId
- Default
- Etc/UTC
- Value
- Etc/UTC
Set to true to enable OIDC authentication.
- Target
- OAuth__Enabled
- Default
- false
- Value
- false
The OIDC authority/issuer URL of your identity provider (e.g. for Authelia: https://auth.example.com/). Note the trailing slash at the end.
- Target
- OAuth__Authority
- Default
- https://auth.example.com/
- Value
- https://auth.example.com/
OIDC client ID configured in your identity provider (e.g. Authelia) for Mail Archiver.
- Target
- OAuth__ClientId
- Default
- mail-archiver
- Value
- mail-archiver
Client secret for the OIDC client.
- Target
- OAuth__ClientSecret
Set to true to disable traditional username/password login and enforce OAuth-only authentication.
- Target
- OAuth__DisablePasswordLogin
- Default
- false
- Value
- false
If set to true, new OIDC users are automatically approved. Enable if you manage your users exclusively in your OIDC provider.
- Target
- OAuth__AutoApproveUsers
- Default
- false
- Value
- false
Scope #1 as requested from the identity provider.
- Target
- OAuth__ClientScopes__0
- Default
- openid
- Value
- openid
Scope #2 as requested from the identity provider.
- Target
- OAuth__ClientScopes__1
- Default
- profile
- Value
- profile
Scope #3 as requested from the identity provider.
- Target
- OAuth__ClientScopes__2
- Default
- Value
The session timeout in minutes.
- Target
- Authentication__SessionTimeoutMinutes
- Default
- 60
- Value
- 60
The name of the authentication cookie.
- Target
- Authentication__CookieName
- Default
- MailArchiverAuth
- Value
- MailArchiverAuth
The interval in minutes between email synchronization.
- Target
- MailSync__IntervalMinutes
- Default
- 15
- Value
- 15
The timeout for the sync operation in minutes.
- Target
- MailSync__TimeoutMinutes
- Default
- 60
- Value
- 60
The connection timeout for IMAP connections in seconds.
- Target
- MailSync__ConnectionTimeoutSeconds
- Default
- 180
- Value
- 180
The command timeout for IMAP commands in seconds.
- Target
- MailSync__CommandTimeoutSeconds
- Default
- 300
- Value
- 300
Whether to always force a full sync (true/false).
- Target
- MailSync__AlwaysForceFullSync
- Default
- false
- Value
- false
Whether to ignore self-signed certificates (true/false).
- Target
- MailSync__IgnoreSelfSignedCert
- Default
- false
- Value
- false
The number of emails that triggers async processing.
- Target
- BatchRestore__AsyncThreshold
- Default
- 50
- Value
- 50
The maximum number of emails for sync processing.
- Target
- BatchRestore__MaxSyncEmails
- Default
- 150
- Value
- 150
The maximum number of emails for async processing.
- Target
- BatchRestore__MaxAsyncEmails
- Default
- 50000
- Value
- 50000
The session timeout for batch restore in minutes.
- Target
- BatchRestore__SessionTimeoutMinutes
- Default
- 30
- Value
- 30
The default batch size for email operations.
- Target
- BatchRestore__DefaultBatchSize
- Default
- 50
- Value
- 50
The batch size for email operations.
- Target
- BatchOperation__BatchSize
- Default
- 50
- Value
- 50
The pause between individual emails in milliseconds.
- Target
- BatchOperation__PauseBetweenEmailsMs
- Default
- 50
- Value
- 50
The pause between batches in milliseconds.
- Target
- BatchOperation__PauseBetweenBatchesMs
- Default
- 250
- Value
- 250
The maximum number of emails that can be selected at once.
- Target
- Selection__MaxSelectableEmails
- Default
- 250
- Value
- 250
The timeout for database commands in seconds.
- Target
- Npgsql__CommandTimeout
- Default
- 900
- Value
- 900
The maximum file size for uploads in GB.
- Target
- Upload__MaxFileSizeGB
- Default
- 10
- Value
- 10
The keep alive timeout for uploads in hours.
- Target
- Upload__KeepAliveTimeoutHours
- Default
- 4
- Value
- 4
The timeout for request headers in hours.
- Target
- Upload__RequestHeadersTimeoutHours
- Default
- 2
- Value
- 2