194 lines
5.9 KiB
Markdown
Raw Normal View History

2025-02-06 15:02:18 +01:00
# Mailu Server Docker Role 🚀
2020-12-27 13:22:47 +01:00
2025-02-06 15:02:18 +01:00
This guide provides instructions for setting up, operating, and maintaining the [Mailu](https://mailu.io/) server Docker role.
2025-02-06 15:02:18 +01:00
## Table of Contents 📖
2023-06-29 14:41:16 +02:00
- [Setup](#setup)
- [Fetchmail Issues](#fetchmail-issues)
- [Data Deletion](#data-deletion)
- [Port Management](#port-management)
- [Admin Account Creation](#admin-account-creation)
- [CLI User Management](#cli-user-management)
- [Starting the Server](#starting-the-server)
- [Debugging](#debugging)
- [Testing](#testing)
- [Updates](#updates)
2024-11-07 18:46:58 -03:00
- [Queue Management](#queue-management)
- [Spam Issues](#spam-issues)
2025-02-06 15:02:18 +01:00
- [OIDC Support](#oidc-support)
2023-06-29 14:41:16 +02:00
- [To-Do](#to-do)
- [References](#references)
2025-02-06 15:02:18 +01:00
## Setup ⚙️
2025-02-06 15:02:18 +01:00
### Fetchmail Issues 📨
2024-11-07 18:46:58 -03:00
Fetchmail might not work properly with large amounts of data. For more information, refer to this [issue](https://github.com/Mailu/Mailu/issues/1719).
2020-12-27 21:30:44 +01:00
2025-02-06 15:02:18 +01:00
#### Deactivating Fetchmail ❌
2023-06-29 14:41:16 +02:00
2024-11-07 18:46:58 -03:00
Before uninstalling Fetchmail, ensure you remove all fetched accounts from the administration panel.
2023-06-29 14:41:16 +02:00
2025-02-06 15:02:18 +01:00
#### Fetchmail Security Concerns 🔐
2023-06-29 14:41:16 +02:00
There are known security concerns with Fetchmail as stated in the [German Wikipedia](https://de.wikipedia.org/wiki/Fetchmail). If you require Fetchmail functions in the future, consider creating a Docker container for [Getmail](https://en.wikipedia.org/wiki/Getmail) as it is considered more secure.
2025-02-06 15:02:18 +01:00
#### Fetchmail Workaround 🔄
2023-06-29 14:41:16 +02:00
If you need to receive emails from another account, follow these steps:
1. Redirect your emails to your new email account.
2. Export all data from your original account.
3. Import all data to your new account.
2025-02-06 15:02:18 +01:00
### Port Management 🌐
2023-06-29 14:41:16 +02:00
Check for any port conflicts and manually change the conflicting ports if necessary. Use the following command to verify:
2020-12-27 13:22:47 +01:00
```bash
2023-06-29 14:41:16 +02:00
netstat -tulpn
2020-12-27 13:22:47 +01:00
```
2020-12-27 16:16:12 +01:00
2025-02-06 15:02:18 +01:00
### Admin Account Creation 👤
2020-12-27 16:16:12 +01:00
2023-06-29 14:41:16 +02:00
To use Mailu, create the primary administrator user account, `admin@{{hostname}}`, using the command below. Replace `PASSWORD` with your preferred password:
2020-12-27 16:16:12 +01:00
```bash
2023-06-29 14:41:16 +02:00
docker-compose -p mailu exec admin flask mailu admin {{admin}} {{hostname}} PASSWORD
2020-12-27 16:16:12 +01:00
```
2025-02-06 15:02:18 +01:00
### CLI User Management 🛠️
2023-06-29 14:41:16 +02:00
For managing users, follow the instructions in the official [Mailu CLI documentation](https://mailu.io/master/cli.html).
2025-02-06 15:02:18 +01:00
### Starting the Server ▶️
2020-12-28 16:41:01 +01:00
2023-06-29 14:41:16 +02:00
To start the server, use the following command:
2020-12-27 19:41:35 +01:00
```bash
2023-06-29 14:41:16 +02:00
docker-compose -p mailu up -d
2020-12-27 19:41:35 +01:00
```
2023-04-15 13:24:21 +02:00
2025-02-06 15:02:18 +01:00
## Debugging 🕵️‍♂️
2023-06-29 14:41:16 +02:00
2025-02-06 15:02:18 +01:00
### Database Access 📂
2023-06-29 14:41:16 +02:00
To access the database, use the following command:
2023-04-15 13:24:21 +02:00
```bash
2023-06-29 14:41:16 +02:00
docker-compose exec -it database mysql -u root -D mailu -p
2023-04-15 13:24:21 +02:00
```
2025-02-06 15:02:18 +01:00
### Container Access 🖥️
2023-06-29 14:41:16 +02:00
To access the front container, use this command:
2021-04-05 15:42:10 +02:00
```bash
2023-06-29 14:41:16 +02:00
docker-compose exec -it front /bin/bash
2021-04-05 15:42:10 +02:00
```
2023-06-29 14:41:16 +02:00
2025-02-06 15:02:18 +01:00
### Restarting Services 🔄
2023-06-29 14:41:16 +02:00
To restart all services, use the following command:
2021-08-24 22:40:59 +02:00
```bash
2025-02-06 15:02:18 +01:00
docker-compose restart
2021-08-24 22:40:59 +02:00
```
2020-12-27 19:41:35 +01:00
2025-02-06 15:02:18 +01:00
### Resending Queued Mails ✉️
2023-06-29 14:41:16 +02:00
To resend queued mails, use this command:
2023-05-25 19:51:44 +02:00
```bash
docker-compose exec -it smtp postqueue -f
```
2025-02-06 15:02:18 +01:00
## Testing 🧪
2023-06-29 14:41:16 +02:00
Use the following tools for testing:
2025-02-06 15:02:18 +01:00
- [SSL-Tools Mailserver Test](https://de.ssl-tools.net/mailservers/)
- [TestEmail.de](http://testemail.de/)
2023-06-29 14:41:16 +02:00
2025-02-06 15:02:18 +01:00
## Updates 🔄
2023-06-29 14:41:16 +02:00
For instructions on updating your Mailu setup, follow the official [Mailu maintenance guide](https://mailu.io/master/maintain.html).
2025-02-06 15:02:18 +01:00
## Queue Management 📬
2024-11-07 18:46:58 -03:00
To manage the Postfix email queue in Mailu, you can use the following commands:
2025-02-06 15:02:18 +01:00
- **Display the email queue**:
2024-11-07 18:46:58 -03:00
```bash
docker compose exec -it smtp postqueue -p
```
2025-02-06 15:02:18 +01:00
- **Delete all emails in the queue**:
2024-11-07 18:46:58 -03:00
```bash
docker compose exec -it smtp postsuper -d ALL
```
2025-02-06 15:02:18 +01:00
## Spam Issues 🚨
2025-02-06 15:02:18 +01:00
### Inspect 🔎
2024-11-07 18:46:58 -03:00
Use the following tools to monitor your domain and email deliverability:
- [Google Postmaster](https://postmaster.google.com/) - Analyzes deliverability and spam issues for Gmail.
- [Yahoo Postmaster](https://postmaster.yahooinc.com) - Provides insights and delivery reports for Yahoo.
- [mxtoolbox.com](https://mxtoolbox.com)
2024-11-07 18:46:58 -03:00
2025-02-06 15:02:18 +01:00
### Blacklist Check 🚫
2024-11-07 18:46:58 -03:00
If your domain is blacklisted, you can check the status with these services and take steps to remove your domain if necessary:
2025-02-06 15:02:18 +01:00
- [Spamhaus](https://check.spamhaus.org/)
- [Barracuda](https://www.barracudacentral.org/lookups)
2025-02-06 15:02:18 +01:00
### Cloudmark Reset Request 🔄
2025-02-06 15:02:18 +01:00
If your IP or domain is flagged by Cloudmark, you can submit a **reset request**:
2024-11-07 18:46:58 -03:00
- [Cloudmark Reset](https://csi.cloudmark.com/en/reset/)
2025-02-06 15:02:18 +01:00
## OIDC Support 🔐
This role now supports OpenID Connect (OIDC) authentication with [Mailu-OIDC](https://github.com/heviat/Mailu-OIDC)! 🎉
To enable OIDC authentication, simply set the following variable:
2023-06-29 14:41:16 +02:00
2025-02-06 15:02:18 +01:00
```yaml
oidc:
enabled: true
```
2023-06-29 14:41:16 +02:00
2025-02-06 15:02:18 +01:00
For more details, check out the [Mailu-OIDC repository](https://github.com/heviat/Mailu-OIDC/tree/2024.06).
2023-06-29 14:41:16 +02:00
2025-02-06 15:02:18 +01:00
## References 🔗
2023-06-29 14:41:16 +02:00
- [Mailu compose setup guide](https://mailu.io/1.7/compose/setup.html)
- [SysPass issue #1299](https://github.com/nuxsmin/sysPass/issues/1299)
- [Mailu issue #1719](https://github.com/Mailu/Mailu/issues/1719)
- [Mailu issue #1171](https://github.com/Mailu/Mailu/issues/1171)
- [Mailu issue #2135](https://github.com/Mailu/Mailu/issues/2135)
- [Mailu issue #2827](https://github.com/Mailu/Mailu/issues/2827)
- [Mailu GitHub repository](https://github.com/Mailu/Mailu)
- [Plesk support article on RoundCube connection issue](https://support.plesk.com/hc/en-us/articles/115001264814-Unable-to-log-into-RoundCube-Connection-to-storage-server-failed)
- [Gist by marienfressinaud](https://gist.github.com/marienfressinaud/f284a59b18aad395eb0de2d22836ae6b)
2025-02-06 15:02:18 +01:00
---
For more information about this role, visit the GitHub repositories:
- [Mailu](https://github.com/kevinveenbirkenbach/cymais/tree/master/roles/docker-mailu)
- [Mailu-OIDC](https://github.com/heviat/Mailu-OIDC)
### About this Role ✨
This Mailu Docker role was developed by **[Kevin Veen-Birkenbach](https://veen.world)**.
This `README.md` was optimized with the help of [ChatGPT](https://chat.openai.com)🚀 and this conversations:
2023-06-29 14:41:16 +02:00
2025-02-06 15:02:18 +01:00
- https://chat.openai.com/share/d1ad5ce7-3aa1-4a14-a959-63393b39374a
- https://chatgpt.com/share/67a4bffb-9330-800f-aed5-715c6a8ced2f