A comprehensive solution for archiving, searching, and exporting emails
π Website: mail-archiver.org
- Automated archiving from multiple accounts with scheduled sync
- Multilingual responsive UI with dark mode
- OpenID Connect (OIDC) authentication (OIDC Guide)
- Advanced search with filters
- Email preview with attachments
- Export accounts or selected emails as mbox / zipped EML
- Multi-user support with account-specific permissions
- Dashboard with statistics and storage monitoring
- Detailed access logging (Access Logging Guide)
- 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
- 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
- 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)
- 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
- The application logs various types of user activities such as Login, Opening, Searches, Exports and many more. (Logging)
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.
-
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.
- 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)
For a complete list of all configuration options, please refer to the Setup Guide.
- 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
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
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.
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.
|
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)


