mailrules
ghcr.io/turtlebyte-in/mailrules:latest
https://github.com/TurtleByte-IN/mailrules/pkgs/container/mailrules
bridge
false
--user 99:100 --read-only --tmpfs /tmp --cap-drop=ALL --security-opt=no-new-privileges:true
https://raw.githubusercontent.com/TurtleByte-IN/mailrules/main/web/public/icon-512.png
http://[IP]:[PORT:8080]/
Sorts incoming email over IMAP, in real time, using rules you write in
plain English or as structured conditions - a self-hosted mail filter
with an AI model deciding which rule an email matches.
Works with any IMAP mailbox that signs in with a password or app password
(iCloud, Gmail, Fastmail, Yahoo, Zoho, your own server). Outlook.com and
Microsoft 365 are not supported by the self-hosted build.
Choose the model that decides: a local Ollama server on your LAN (nothing
leaves your network), any OpenAI-compatible endpoint, Anthropic, or the
hosted Jev/Clef models. Rules made only of conditions, and sender rules,
need no model at all.
It starts safe: dry-run is on, so it records what it would do and changes
no mailbox until you switch dry-run off. It never deletes mail, and every
action can be undone for 30 days.
Runs as nobody:users (99:100), like other Unraid appdata, with a
read-only root filesystem and all capabilities dropped. Back up the
whole appdata folder: it holds master.key, without which every stored
mailbox password and API key is unrecoverable.
https://github.com/simonlehmann/unraid-templates/issues
https://mailrules.app/
https://raw.githubusercontent.com/simonlehmann/unraid-templates/main/mailrules/mailrules.xml
https://raw.githubusercontent.com/simonlehmann/unraid-templates/main/mailrules/README.md
Productivity: Tools:Utilities AI:
email mail imap filter sort rules inbox ai llm ollama gmail icloud fastmail
The container runs as nobody:users (99:100), not root, and cannot fix folder ownership itself. If it stops on first start with a permission error in the log, open the Unraid terminal and run: chown -R 99:100 /mnt/user/appdata/mailrules (adjust the path if you changed Appdata), then start it again.
2026-11-19
Initial template (MailRules 0.3.0)
AGPL-3.0