docs: Improve cron tasks and fix link in documentation (#2708)

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
This commit is contained in:
JiLleON 2022-08-02 15:38:22 +04:00 committed by GitHub
parent 4438e3e16e
commit e99bba2ef5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 47 additions and 7 deletions

View file

@ -103,6 +103,42 @@ While indexing is memory intensive, you can configure the plugin to limit the am
```
docker-compose exec mailserver doveadm fts optimize -A
```
Or like the [Spamassassin example][docs-faq-sa-learn-cron] shows, you can instead use `cron` from within `docker-mailserver` to avoid potential errors if the mail-server is not running:
??? example
Create a _system_ cron file:
```sh
# in the docker-compose.yml root directory
mkdir -p ./docker-data/dms/cron # if you didn't have this folder before
touch ./docker-data/dms/cron/fts_xapian
chown root:root ./docker-data/dms/cron/fts_xapian
chmod 0644 ./docker-data/dms/cron/fts_xapian
```
Edit the system cron file `nano ./docker-data/dms/cron/fts_xapian`, and set an appropriate configuration:
```conf
# Adding `MAILTO=""` prevents cron emailing notifications of the task outcome each run
MAILTO=""
#
# m h dom mon dow user command
#
# Everyday 4:00AM, optimize index files
0 4 * * * root doveadm fts optimize -A
```
Then with `docker-compose.yml`:
```yaml
services:
mailserver:
image: docker.io/mailserver/docker-mailserver:latest
volumes:
- ./docker-data/dms/cron/fts_xapian:/etc/cron.d/fts_xapian
```
### Solr
@ -153,3 +189,5 @@ However, Solr also requires a fair bit of RAM. While Solr is [highly tuneable](h
#### Further Discussion
See [#905](https://github.com/docker-mailserver/docker-mailserver/issues/905)
[docs-faq-sa-learn-cron]: ../../faq.md#how-can-i-make-spamassassin-better-recognize-spam