# 📧 Mail-Archiver - Email Archiving System **A comprehensive solution for archiving, searching, and exporting emails** 🌐 **Website:** [mail-archiver.org](https://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](doc/OIDC_Implementation.md)) ### 🔍 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](doc/API.md)) ### 👥 User Management - Multi-user support with account-specific permissions - Dashboard with statistics and storage monitoring - Detailed access logging ([Access Logging Guide](doc/Logs.md)) ### 🧩 Email Provider Support - **IMAP**: Traditional IMAP accounts with full synchronization capabilities - **M365**: Microsoft 365 mail accounts via Microsoft Graph API ([Setup Guide](doc/AZURE_APP_REGISTRATION_M365.md)) - **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](doc/MSA_Outlook_Setup.md)) - **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](doc/M365TenantImport.md) 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](doc/MailboxMigration.md)) ### 🗑️ Retention Policies - Automatic deletion from mailserver after a configurable period ([Retention Policies](doc/RetentionPolicies.md)) - 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](doc/Setup.md#-deletion-policy-settings) for details ### 📋 Access Log - The application logs various types of user activities such as Login, Opening, Searches, Exports and many more. ([Logging](doc/Logs.md)) ## 📚 Documentation For detailed documentation on installation, configuration, and usage, please refer to the [Documentation Index](doc/Index.md). Please note that the documentation is still fresh and is continuously being expanded. ## 🖼️ Screenshots ### Dashboard  ### Archive  ### Email Details  ## 🚀 Quick Start ### Prerequisites - [Docker](https://www.docker.com/products/docker-desktop) - [Docker Compose](https://docs.docker.com/compose/install/) ### 🛠️ Installation 1. Install the prerequisites on your system 2. Create a `docker-compose.yml` file ```yaml 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 ``` 8. Restart containers: ```bash docker compose restart ``` 9. Access the application in your prefered browser. 10. 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](doc/BackupRestore.md) for detailed instructions) ## ⚙️ Advanced Setup For a complete list of all configuration options, please refer to the [Setup Guide](doc/Setup.md). ## 📋 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](CONTRIBUTING.md) 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.|
|