From 2bc3e821fac5fb41767a5cc0fdf0795fab1183da Mon Sep 17 00:00:00 2001 From: Brennan Kinney <5098581+polarathene@users.noreply.github.com> Date: Mon, 13 Sep 2021 21:26:56 +1200 Subject: [PATCH] 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 Co-authored-by: Georg Lauterbach <44545919+georglauterbach@users.noreply.github.com> --- docs/content/config/environment.md | 6 ++++-- docs/content/faq.md | 10 +++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/docs/content/config/environment.md b/docs/content/config/environment.md index 923d3dd2..de3b9959 100644 --- a/docs/content/config/environment.md +++ b/docs/content/config/environment.md @@ -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 diff --git a/docs/content/faq.md b/docs/content/faq.md index 3a054387..2aac0d63 100644 --- a/docs/content/faq.md +++ b/docs/content/faq.md @@ -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