spamassassin training data gone after container update

Issue #214 closed
Alexander created an issue

I periodically train spamassassin using:

# learn spam
sa-learn --showdots --no-sync --spam /data/domains/[mydomain]/[user]/Maildir/.Junk/{cur,new}

# learn ham
sa-learn --showdots --no-sync --ham /data/domains/[mydomain/[user]/Maildir/{cur,new}

# sync db
sa-learn --showdots --sync

# see learning results
sa-learn --dump magic

After the container update, this data is lost. Where is this data stored and how can this be setup to be persistent (like other settings).

Comments (5)

  1. Henrik Tilly

    +1!

    I have similar solution in place, but in order to keep the functionality when deploying new container I have the following crontab on the host running docker:

    • 2 * * * docker exec -it poste /usr/bin/sa-learn --no-sync --spam /data/domains/[domain]/[user]/Maildir/.Junk/cur
    • 3 * * * docker exec -it poste /usr/bin/sa-learn --no-sync --ham /data/domains/[domain]/[user]/Maildir/cur
    • 4 * * * docker exec -it poste /usr/bin/sa-learn --sync

    For an implementation in Poste.io I would suggest a checkbox for each account that says: "Use this account for teaching spamassassin" and then this account + domain will be using the syntax above.

    I guess that access to this checkbox needs to be for administrators only =)

    BR Tilly

  2. Henrik Tilly

    Awesome. How does it learn? From users inbox / spam folders? Plugin to the webmail to learn when moving to spam?

    BR Tilly

  3. Log in to comment