# Spamfilter

Spamfilter is a Docker-based Internet Message Access Protocol (IMAP) spam filter for self-hosted mailboxes, scoring each account's mail with a companion Rspamd container, moving spam to Junk, and learning from your own. It is open source and self-hosted, installable on Unraid.

Canonical page: https://ourlocalhost.com/app/3328/spamfilter

## Description

Spamfilter is a Docker-based Internet Message Access Protocol (IMAP) spam filter for self-hosted mailboxes, scoring each account's mail with a companion Rspamd container, moving spam to Junk, and learning from your own Inbox-to-Junk moves without deleting messages.

## Platform availability

Available on 1 of 10 platforms: Unraid.

## Health score

41/100 (Fair), based on 4 of 4 factors.
- Maintained: 69 (last commit 160 days ago)
- Popular: 21 (10 GitHub stars)
- Easy to install: 35 (1 install platform, install notes, Docker image)
- Light to run: 10 (8 GB minimum RAM)

## Links

- GitHub: https://github.com/marcelverdult/imap-spamfilter
- Unraid: https://ca.unraid.net/apps/spamfilter-0qxy2xm1f1f9ry?q=spamfilter

## Common questions

### Do I need to run more than the main spamfilter container?

Yes, run four containers on a shared Docker network named spamnet: spamfilter-redis, spamfilter-unbound, spamfilter-rspamd, and spamfilter. Redis persists rspamd data, unbound provides local recursive DNS, and rspamd scores messages.

### How do I change account modes, thresholds, or credentials?

Per-account settings go in /mnt/user/appdata/spamfilter/accounts.yml. Edit the file by hand and restart the container to apply changes.

### Where is the Bayes training data kept?

The spamfilter-redis container stores rspamd Bayes tokens, fuzzy hashes, and neural weights using AOF and RDB. Backing up that Redis data preserves the learned state.

### How does it learn spam and ham?

It learns from explicit user moves: Inbox to Junk as spam and Junk to Inbox as ham after the grace window. It can also learn from Junk/Train-Spam and Junk/Train-Ham, and it does not autolearn.

### What happens if rspamd is down or a folder is missing?

It fails closed, so the message stays put. It never deletes mail and only uses IMAP MOVE operations.

---
Source: Our Local Host (https://ourlocalhost.com/app/3328/spamfilter), the self-hosted and open-source app directory.
