Selfhosted setup to filter an IMAP inbox using common rspamd rules and smart bayesian learning using isbg
Github: https://github.com/JustinGuese/k8s-docker-spamprotection-rspamd-isbgβ Dockerhub: https://hub.docker.com/repository/docker/guestros/k8s-docker-spamprotection-rspamd-isbg/generalβ
manually create the secret
kubectl create secret generic isbg-credentials \
--namespace=spamprotect \
--from-literal=IMAP_HOST="your-imap-host" \
--from-literal=IMAP_USER="your-imap-user" \
--from-literal=IMAP_PASSWD="your-imap-password" \
--from-literal=LEARN_SPAMBOX="your-spam-box" \
--from-literal=LEARN_HAMBOX="your-ham-box"
after that
kubectl apply -f kubernetes/
This Kubernetes setup automates spam filter training using Rspamd and ISBG (IMAP Spam Begone). It connects to a remote IMAP mailbox (e.g. from Outlook), reads user-classified emails (Spam / Good), and teaches Rspamd to improve future spam detection.
π¦ What It Does β’ β Connects to your IMAP account securely (e.g. Hostinger) β’ β Trains Rspamd using: β’ Emails in the Spam folder β learn as spam β’ Emails in the Good (or Inbox/Good) folder β learn as ham β’ β Runs as a Kubernetes CronJob (default: every 30 minutes) β’ β Stores persistent config and logs at: /mnt/hdd/spamprotect/ (via hostPath)
π§ Components
Component Description rspamd Deployment Optional internal Rspamd instance rspamd Service Exposes Rspamd at rspamd.spamprotect.svc.cluster.local isbg-train CronJob Connects to IMAP and teaches Rspamd every X minutes hostPath Volume Mounted persistent storage at /mnt/hdd/spamprotect/
π¨ Folder Actions (How Training Works)
Folder (in Outlook or IMAP) Meaning Action Spam You marked spam Learn as spam -> e.g. Junk Good You rescued mail Learn as ham -> e.g. Inbox
Simply move emails to these folders to βteachβ your spam filter.
π File Structure on Host
Make sure this exists:
/mnt/hdd/spamprotect/ βββ config/ # Optional rspamd config βββ logs/ # Logs from ISBG training
Content type
Image
Digest
sha256:517c01f02β¦
Size
46.8 MB
Last updated
about 1 year ago
docker pull guestros/k8s-docker-spamprotection-rspamd-isbg