Skip to content
README.md 1.98 KiB
Newer Older
andryyy's avatar
andryyy committed
# mailcow-dockerized
andryyy's avatar
andryyy committed

andryyy's avatar
andryyy committed

1. Open mailcow.conf and change stuff, do not use special chars in passwords. This will be fixed soon.
andryyy's avatar
andryyy committed

2. Run ./build-all.sh

3. Set a rspamd controller password (see section "rspamd")
andryyy's avatar
andryyy committed

Done.

The default username for mailcow is `admin` with password `moohoo`.

## Usage
### build-*.files

(Re)build a container:
```
./build-$name.sh 
```

andryyy's avatar
andryyy committed
**:exclamation:** Any previous container with the same name will be stopped and removed.
andryyy's avatar
andryyy committed
No persistent data is deleted at any time.
If an image exists, you will be asked wether or not to repull/rebuild it.

### 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.

andryyy's avatar
andryyy committed
### MariaDB
andryyy's avatar
andryyy committed

andryyy's avatar
andryyy committed
Connect to MariaDB database:
andryyy's avatar
andryyy committed
```
andryyy's avatar
andryyy committed
./build-sql.sh --client
andryyy's avatar
andryyy committed
```

andryyy's avatar
andryyy committed
Init schema (will also be installed when running `./build-sql.sh` without parameters):
andryyy's avatar
andryyy committed
```
andryyy's avatar
andryyy committed
./build-sql.sh --init-schema
andryyy's avatar
andryyy committed
```

Reset mailcow admin to `admin:moohoo`:
```
andryyy's avatar
andryyy committed
./build-sql.sh --reset-admin
```

Dump database to file backup_${DBNAME}_${DATE}.sql:
```
./build-sql.sh --dump
andryyy's avatar
andryyy committed
```

### Redis

Connect to redis database:
```
andryyy's avatar
andryyy committed
./build-sql.sh --client
andryyy's avatar
andryyy committed
```

### rspamd

Use rspamadm:
```
docker exec -it rspamd-mailcow rspamadm --help
andryyy's avatar
andryyy committed
```

Use rspamc:
```
docker exec -it rspamd-mailcow rspamc --help
andryyy's avatar
andryyy committed
```

Set rspamd controller password:
```
# Generate hash
docker exec -it rspamd-mailcow rspamadm pw
andryyy's avatar
andryyy committed
```

Replace given hash in data/conf/rspamd/override.d/worker-controller.inc:
andryyy's avatar
andryyy committed
```
enable_password = "myhash";
```

Restart rspamd:
```
docker restart rspamd-mailcow
andryyy's avatar
andryyy committed
```

### Remove persistent data

andryyy's avatar
andryyy committed
MariaDB:
andryyy's avatar
andryyy committed

```
andryyy's avatar
andryyy committed
docker stop mariadb-mailcow
docker rm mariadb-mailcow
andryyy's avatar
andryyy committed
rm -rf data/db/mysql/*
andryyy's avatar
andryyy committed
./build-sql.sh
andryyy's avatar
andryyy committed
```

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]
```