docs: Improve FAQ entry for mail-state folder (#2187)

* docs: Improve FAQ entry for `mail-state` folder

- Links to relevant script logic.
- Better list of services data moved to `mail-state`.

* Update docs/content/faq.md

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>

* docs(fix): ONE_DIR env default is now `1`

This was missed during the `ONE_DIR` default change in https://github.com/docker-mailserver/docker-mailserver/pull/2148

* fix relative filepath

* fix: use new URI anchor

Co-authored-by: Casper <casperklein@users.noreply.github.com>
Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com>
This commit is contained in:
Brennan Kinney 2021-09-13 21:26:56 +12:00 committed by GitHub
parent be35d9bef1
commit 2bc3e821fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 5 deletions

View file

@ -33,8 +33,8 @@ The log-level will show everything in its class and above.
##### ONE_DIR
- **0** => state in default directories.
- 1 => consolidate all states into a single directory (`/var/mail-state`) to allow persistence using docker volumes.
- 0 => state in default directories.
- **1** => consolidate all states into a single directory (`/var/mail-state`) to allow persistence using docker volumes. See the [related FAQ entry][docs-faq-onedir] for more information.
##### PERMIT_DOCKER
@ -715,3 +715,5 @@ you to replace both instead of just the envelope sender.
- **empty** => no default
- password for default relay user
[docs-faq-onedir]: ../faq.md#what-is-the-mail-state-folder-for

View file

@ -85,10 +85,13 @@ docker run --rm -it \
find /backup/mail -type f -mtime +30 -delete
```
### What about `mail-state` folder?
### What is the `mail-state` folder for?
This folder consolidates all data generated by the server itself to persist when you upgrade.
Example of data folder persisted: lib-amavis, lib-clamav, lib-fail2ban, lib-postfix, lib-postgrey, lib-spamassasin, lib-spamassassin, spool-postfix, ...
When you run `docker-mailserver` with the ENV var `ONE_DIR=1` (_default since v10.2_), this folder will store the data from internal services so that you can more easily persist state to disk (via `volumes`).
This has the advantage of fail2ban blocks, ClamAV anti-virus updates and the like being kept across restarts for example.
Service data is [relocated to the `mail-state` folder][mail-state-folders] for services: Postfix, Dovecot, Fail2Ban, Amavis, PostGrey, ClamAV, SpamAssassin.
### How can I configure my email client?
@ -429,3 +432,4 @@ supervisorctl update
[github-issue-1639]: https://github.com/docker-mailserver/docker-mailserver/issues/1639
[github-issue-1792]: https://github.com/docker-mailserver/docker-mailserver/pull/1792
[hanscees-userpatches]: https://github.com/hanscees/dockerscripts/blob/master/scripts/tomav-user-patches.sh
[mail-state-folders]: https://github.com/docker-mailserver/docker-mailserver/blob/c7e498194546416fb7231cb03254e77e085d18df/target/scripts/startup/misc-stack.sh#L24-L33