change ham folder to Archives

This commit is contained in:
Sebastian Wiesendahl 2019-03-12 14:44:44 +01:00
parent d5ba2f8e42
commit 8f6249cc3f
1 changed files with 9 additions and 4 deletions

View File

@ -70,7 +70,7 @@ Put received spams in `.Junk/` imap folder and add a _user_ cron like the follow
If you run the server with docker-compose, you can leverage on docker configs and the mailserver's own cron. This is less problematic than the simple solution shown above, because it decouples the learning from the host on which the mailserver is running and avoids errors if the server is not running.
The following config works nicely:
The following configuration works nicely:
create a _system_ cron file:
```sh
@ -81,18 +81,23 @@ chown root:root cron/sa-learn
chmod 0644 cron/sa-learn
```
edit the system cron file `nano cron/sa-learn`:
edit the system cron file `nano cron/sa-learn`, and set an appropriate configuration:
```
# This assumes you're having `environment: ONE_DIR=1` in the docker-compose.yml,
# with a consolidated config in `/var/mail-state`
#
# m h dom mon dow user command
#
# Everyday 2:00AM, learn spam from a specific user
0 2 * * * root sa-learn --spam /var/mail/domain.com/username/.Junk --dbpath /var/mail-state/lib-amavis/.spamassassin
15 2 * * * root sa-learn --ham /var/mail/domain.com/username/.Archive --dbpath /var/mail-state/lib-amavis/.spamassassin
15 2 * * * root sa-learn --ham /var/mail/domain.com/username/.Archives* --dbpath /var/mail-state/lib-amavis
30 2 * * * root sa-learn --ham /var/mail/domain.com/username/.INBOX.* --dbpath /var/mail-state/lib-amavis/.spamassassin
#
# Everyday 3:00AM, learn spam from all users of a domain
0 3 * * * root sa-learn --spam /var/mail/otherdomain.com/*/.Junk --dbpath /var/mail-state/lib-amavis/.spamassassin
15 3 * * * root sa-learn --ham /var/mail/otherdomain.com/*/.Archive --dbpath /var/mail-state/lib-amavis/.spamassassin
15 3 * * * root sa-learn --ham /var/mail/otherdomain.com/*/.Archives* --dbpath /var/mail-state/lib-amavis/.spamassassin
# ham: inbox subdirectories
30 3 * * * root sa-learn --ham /var/mail/otherdomain.com/*/.INBOX.* --dbpath /var/mail-state/lib-amavis/.spamassassin
```
with plain docker-compose: