Quarantine with full message history
Every inbound message is written to MariaDB and the
on-disk spool at /var/spool/spamgate/quarantine/.
Review-grade items are never auto-purged. HTML body
preview in the admin UI renders inside a sandboxed
iframe.
Three account roles
Superadmin manages all domains and
settings. Domain admin manages
quarantine and per-domain lists for one domain.
Mailbox user can release messages
addressed to their own mailbox.
Per-domain hold-all-mail
Superadmin-only switch to pause downstream delivery for
a single domain (useful during mailbox migrations).
Clean mail to that domain stays in quarantine; a
one-click "release all held" drains the queue when
the migration completes.
Global and per-domain lists
Blacklist and whitelist with four entry kinds:
email, domain, ip,
cidr. Domain admins manage their own
domain's lists independently of the global rules.
Layered network defences
Five kernel ipsets matched by iptables DROP rules on
ports 25/80/443:
spamgate-scanners - ShadowWhisperer list
spamgate-stretchoid - upstream feed + /var/log/mail.log harvest
spamgate-internet-census - internet-census.org ranges
spamgate-blocked-clients - mirror of the Postfix CIDR table (Censys, Shadowserver)
spamgate-spameri - harvested from /var/log/mail.log to block a recurring joe-job spam botnet
Plus seven fail2ban jails covering SMTP auth, EHLO
floods, DNSBL violators, no-PTR retriers, and web-UI
exploit probes.
Phishing intelligence
Daily download of the phishing.mailscanner.info
bad-sites list, merged with a local-override file that
is preserved across updates. Listed URLs in a message
body fire a hard score that cannot be cancelled by
other URLs in the same mail.
AbuseIPDB integration (optional)
Daily download of the AbuseIPDB worst-offender blacklist
into a static radix map - no per-message API calls, so
a free-tier token is sufficient. A listed sender IP
pushes the score above the review threshold so the
message is held rather than rejected.
Cluster-shared Bayes
Rspamd's Bayes classifier is shared across cluster
nodes via Redis replication from the main. Train once,
every node benefits. Bulk training and retraining via
the train_bayes.py helper.
Audit log and reports
Every state-changing action - account creation, list
edit, release, domain hold, password reset - lands in
audit_log. The reports page renders
quarantine stats with Chart.js.
Drift-safe updater
update.sh uses a three-way diff (baseline
vs deployed vs new template) on every config file and
only prompts when both the operator and the template
have diverged. Pending schema migrations are offered
one at a time.
Config backup / restore
backup_restore.py archives the
configuration surface - users, lists, settings,
domains, cluster nodes, Bayes dump.rdb,
system configs, iptables and ipset rules.
Operator-friendly tooling
A root-run reset_password.py rescues
lockouts without needing the web UI. A
test_dkim_dmarc.py diagnostic prints SPF,
DKIM and DMARC results for any domain in one shot.
OCR scanning of callback-scam PDFs (optional)
Telephone-oriented scams send a PDF that's really just a
picture - no text to scan, often arriving through a
genuinely-authenticated account. An opt-in, heavily
sandboxed OCR sidecar reads the brand and the phone
number out of the image so the rules can see it. Fails
open: if the sidecar is stopped or disabled, mail is
scored exactly as it would have been.
Outbound relay (main node only)
An IP-allow-listed, sender-locked smarthost for
customer servers with no direct external access.
Outbound mail is scored through the same Rspamd
pipeline as inbound - a compromised customer server
sending a sudden burst of spam gets held in quarantine
instead of relayed.
Outbound DKIM signing
Per-domain opt-in: SpamGate generates an RSA-2048
keypair, shows the DNS TXT record to publish, and only
starts signing once a live DNS lookup confirms the
record matches. An optional disclaimer can also be
appended to relayed mail, top or bottom, per domain.
Recipient verification at RCPT TO
Before accepting a message, SpamGate asks the
downstream mail server whether the recipient actually
exists. Unknown addresses are rejected with a plain
550 at the front door - no database row or quarantine
file is ever written for them.
Multi-language admin UI
Per-user language selection for the whole admin UI.
English and German ship today; adding another language
is a content-only change - new translation files, no
code changes - with a regression suite that checks
every key resolves before you deploy it.
Mailbox aliases
A mailbox user can be given extra addresses in their
own domain - the typical case is a shared fan-out
address like sales@example.com - so mail
addressed to any of them shows up in their quarantine
view alongside their primary mailbox.