# Mailu

## Spamd Training

In the `mailu-dovecot` container run e.g.
```bash
JUNKFOLDERS="/mail/mail@redimp.de/.Junk/cur/ /mail/rebecca@hillenkoetter.de/.Junk/cur/ /mail/christian@hillenkoetter.de/.Junk/cur/"
# fuzzy add
rspamc -h mailu-rspamd:11334 -P mailu -f 11 fuzzy_add $JUNKFOLDERS
# learn spam
rspamc -h mailu-rspamd:11334 -P mailu learn_spam $JUNKFOLDERS
```

Note: `learn error: all learn conditions denied learning ham in default classifier` is miss worded, with debug log on it reads:
`rspamd_stat_classifier_is_skipped: learn condition for classifier bayes returned: already in class spam; probability 100.00%; skip classifier`.

### fuzzy flags `-f`

Defined in `mailu-rspamd:/etc/rspamd/local.d/fuzzy_check.conf`

```cpp
...
fuzzy_map = {
        LOCAL_FUZZY_DENIED {
            # Local threshold
            max_score = 20.0;
            # Flag to match
            flag = 11;
        }
        LOCAL_FUZZY_PROB {
            max_score = 10.0;
            flag = 12;
        }
        LOCAL_FUZZY_WHITE {
            max_score = 2.0;
            flag = 13;
        }
    }
```

### Fulltext Search indices

```bash
# check the cache sizes
find /mail -type d -name xapian-indexes -exec du -sh {} \; | sort -h
```

<https://doc.dovecot.org/main/core/man/doveadm-fts.1.html>

```bash
# Removes mails from the index that have already been expunged
doveadm fts rescan -u mail@nachtling.com
```
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9