A comprehensive solution for archiving, searching, and exporting emails
- 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
- 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
- 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
- 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
- MBox Import and EML Import (ZIP files with folder structure support)
- Restore selected emails or entire mailboxes to destination mailboxes
- Configure automatic deletion of archived emails from mailserver after specified days
- Set retention period per email account (e.g., 30, 90, or 365 days)
- Local Archive Retention: Configure separate retention period for local archive
For detailed information about retention policies, see Retention Policies 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.
-
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! Moreover the application is not build for public internet access!
- 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 8 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
Contributions welcome! Please open an Issue or Pull Request. Also feel free to contact me by mail.
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.
π License: GNU GENERAL PUBLIC LICENSE Version 3 (see LICENSE file)


