2016-12-10 03:40:57 +08:00
|
|
|
# mailcow-dockerized
|
2016-12-10 03:39:02 +08:00
|
|
|
|
2016-12-11 04:49:41 +08:00
|
|
|
## Installation
|
2016-12-10 03:39:02 +08:00
|
|
|
|
2016-12-11 04:49:41 +08:00
|
|
|
1. Open mailcow.conf and change stuff, do not use special chars in passwords. This will be fixed soon.
|
2016-12-10 03:39:02 +08:00
|
|
|
|
2016-12-11 04:49:41 +08:00
|
|
|
2. Run ./build-all.sh
|
|
|
|
|
|
|
|
3. Set a rspamd controller password (see section "rspamd")
|
2016-12-10 03:39:02 +08:00
|
|
|
|
|
|
|
Done.
|
|
|
|
|
|
|
|
The default username for mailcow is `admin` with password `moohoo`.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
### build-*.files
|
|
|
|
|
|
|
|
(Re)build a container:
|
|
|
|
```
|
|
|
|
./build-$name.sh
|
|
|
|
```
|
|
|
|
|
2016-12-10 03:40:57 +08:00
|
|
|
**:exclamation:** Any previous container with the same name will be stopped and removed.
|
2016-12-10 03:39:02 +08:00
|
|
|
No persistent data is deleted at any time.
|
|
|
|
If an image exists, you will be asked wether or not to repull/rebuild it.
|
|
|
|
|
2016-12-11 04:49:41 +08:00
|
|
|
### Logs
|
|
|
|
|
|
|
|
You can use docker logs $name for almost all containers. Only rmilter does not log to stdout. You can check rspamd logs for rmilter reponses.
|
|
|
|
|
|
|
|
When a process dies, the container dies, too. Except for Postfix' container.
|
|
|
|
|
2016-12-11 21:13:17 +08:00
|
|
|
### MariaDB
|
2016-12-10 03:39:02 +08:00
|
|
|
|
2016-12-11 21:13:17 +08:00
|
|
|
Connect to MariaDB database:
|
2016-12-10 03:39:02 +08:00
|
|
|
```
|
2016-12-11 21:13:17 +08:00
|
|
|
./build-sql.sh --client
|
2016-12-10 03:39:02 +08:00
|
|
|
```
|
|
|
|
|
2016-12-11 21:13:17 +08:00
|
|
|
Init schema (will also be installed when running `./build-sql.sh` without parameters):
|
2016-12-10 03:39:02 +08:00
|
|
|
```
|
2016-12-11 21:13:17 +08:00
|
|
|
./build-sql.sh --init-schema
|
2016-12-10 03:39:02 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
Reset mailcow admin to `admin:moohoo`:
|
|
|
|
```
|
2016-12-11 21:13:17 +08:00
|
|
|
./build-sql.sh --reset-admin
|
|
|
|
```
|
|
|
|
|
|
|
|
Dump database to file backup_${DBNAME}_${DATE}.sql:
|
|
|
|
```
|
|
|
|
./build-sql.sh --dump
|
2016-12-10 03:39:02 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
### Redis
|
|
|
|
|
|
|
|
Connect to redis database:
|
|
|
|
```
|
2016-12-11 21:13:17 +08:00
|
|
|
./build-sql.sh --client
|
2016-12-10 03:39:02 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
### rspamd
|
|
|
|
|
|
|
|
Use rspamadm:
|
|
|
|
```
|
2016-12-11 04:49:41 +08:00
|
|
|
docker exec -it rspamd-mailcow rspamadm --help
|
2016-12-10 03:39:02 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
Use rspamc:
|
|
|
|
```
|
2016-12-11 04:49:41 +08:00
|
|
|
docker exec -it rspamd-mailcow rspamc --help
|
2016-12-10 03:39:02 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
Set rspamd controller password:
|
|
|
|
```
|
2016-12-11 04:49:41 +08:00
|
|
|
# Generate hash
|
|
|
|
docker exec -it rspamd-mailcow rspamadm pw
|
2016-12-10 03:39:02 +08:00
|
|
|
```
|
2016-12-11 04:49:41 +08:00
|
|
|
|
|
|
|
Replace given hash in data/conf/rspamd/override.d/worker-controller.inc:
|
2016-12-10 03:39:02 +08:00
|
|
|
```
|
|
|
|
enable_password = "myhash";
|
2016-12-11 04:49:41 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
Restart rspamd:
|
|
|
|
```
|
|
|
|
docker restart rspamd-mailcow
|
2016-12-10 03:39:02 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
### Remove persistent data
|
|
|
|
|
2016-12-11 21:13:17 +08:00
|
|
|
MariaDB:
|
2016-12-10 03:39:02 +08:00
|
|
|
|
|
|
|
```
|
2016-12-11 21:13:17 +08:00
|
|
|
docker stop mariadb-mailcow
|
|
|
|
docker rm mariadb-mailcow
|
2016-12-10 03:39:02 +08:00
|
|
|
rm -rf data/db/mysql/*
|
2016-12-11 21:13:17 +08:00
|
|
|
./build-sql.sh
|
2016-12-10 03:39:02 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
Redis:
|
|
|
|
|
|
|
|
```
|
|
|
|
# If you feel hardcore:
|
|
|
|
docker stop redis-mailcow
|
|
|
|
docker rm redus-mailcow
|
|
|
|
rm -rf data/db/redis/*
|
|
|
|
./build-redis.sh
|
|
|
|
|
|
|
|
## It is almost always enough to just flush all keys:
|
|
|
|
./build-redis client
|
|
|
|
# FLUSHALL [ENTER]
|
|
|
|
```
|