# Spam Scanner > A spam filter for Node.js, the command line and mail servers. Catches spam, phishing, scams and malware in any language, explains every decision, and can ask a local or hosted language model about close calls. Spam Scanner is an npm package (`spamscanner`) and command-line tool. It scores a raw email message with a classifier, phishing, attachment, authentication, blocklist and rule checks, and optionally a language model, and runs as a library, a Postfix or Sendmail milter, a Postfix content filter, a SpamAssassin-compatible spamd server, an HTTP API or a TCP server. Each link below is the Markdown source of a page. ## Documentation - [Spam Scanner documentation](https://spamscanner.net/docs/index.md): Spam Scanner is a spam filter for Node.js and the command line, with its source code on GitHub. It reads a raw email message and decides whether it is spam… - [Getting started](https://spamscanner.net/docs/getting-started/index.md): Spam Scanner needs Node.js 18 or later, or nothing at all with the standalone binary. - [Command line](https://spamscanner.net/docs/cli/index.md): Exit codes: 0 ham, 1 spam, 2 error. - [Postfix and Sendmail](https://spamscanner.net/docs/postfix/index.md): Spam Scanner connects to Postfix in two ways: - [Other mail servers](https://spamscanner.net/docs/mail-servers/index.md): Spam Scanner speaks four protocols, so most mail software can use it without a plugin of its own: - [HTTP API, TCP server and spamd](https://spamscanner.net/docs/http-api/index.md): It listens on 127.0.0.1 unless --host says otherwise. With a token, every request except /health needs Authorization: Bearer . Put it behind a reverse… - [How it works](https://spamscanner.net/docs/how-it-works/index.md): A scan parses the message, extracts features, runs the checks below in parallel, adds up their points and compares the total with two thresholds: 5 for spam… - [Tests and scores](https://spamscanner.net/docs/scoring/index.md): A message is spam at 5 points and rejected at 15. Each test below adds or removes points; the result lists the ones that fired. - [Languages](https://spamscanner.net/docs/languages/index.md): Spam arrives in every language, and so does ordinary mail. Spam Scanner reads both, and it is careful about languages it knows little about: a spam filter… - [Language models](https://spamscanner.net/docs/llm/index.md): A language model reads a message the way a person does. It notices that a "delivery notice" asks for a card number, or that a polite note from "the CEO"… - [Training](https://spamscanner.net/docs/training/index.md): The bundled model works out of the box. A model trained on your own mail works better, because it learns what your ham looks like: your newsletters, your… - [API reference](https://spamscanner.net/docs/api/index.md): const scanner = new SpamScanner(options); const result = await scanner.scan(rawMessage, scanOptions); ` - [Forward Email](https://spamscanner.net/docs/forward-email/index.md): Spam Scanner was built by Forward Email, the open-source, privacy-focused email service, for its own mail servers. Forward Email keeps no logs of message… - [Security and privacy](https://spamscanner.net/docs/security/index.md): Spam Scanner reads mail, which is private, from senders, who may be hostile. This page lists what it sends anywhere, and how it treats what it reads. ## Guides - [Postfix spam filter](https://spamscanner.net/postfix-spam-filter/index.md): Filter spam on a Postfix server with Spam Scanner's milter or content filter: setup, systemd unit, rejecting with 4xx or 5xx, and a Junk folder. - [A SpamAssassin alternative that speaks spamd](https://spamscanner.net/spamassassin-alternative/index.md): Replace SpamAssassin's spamd with Spam Scanner. spamc, Exim and Haraka keep working, the X-Spam headers keep their names, and every language is supported. - [AI spam filter with local language models and decision models](https://spamscanner.net/ai-spam-filter/index.md): Catch spam and phishing that rules miss with a language model: Ollama on your own server, Cloudflare Clef, or Claude and ChatGPT, asked only about close calls. - [Multilingual spam filter](https://spamscanner.net/multilingual-spam-filter/index.md): How Spam Scanner filters spam in every language: Unicode word segmentation, undoing disguises, and never flagging a language the model knows little about. - [Phishing detection for email](https://spamscanner.net/phishing-detection/index.md): How Spam Scanner detects phishing email: Unicode lookalike domains, links that show one address and go to another, brand display names, Cloudflare's malware resolver and DMARC. - [Node.js spam filter library](https://spamscanner.net/nodejs-spam-filter/index.md): Scan email for spam, phishing and malware from Node.js: one npm package with a trainable classifier, ESM and CommonJS, smtp-server integration and typed results. - [Frequently asked questions](https://spamscanner.net/faq/index.md): Answers about Spam Scanner: how accurate it is, which languages it supports, what it sends over the network, language models, SpamAssassin and Forward Email. ## Optional - [All documentation in one file](https://spamscanner.net/llms-full.txt): every page above, concatenated - Translations: [العربية](https://spamscanner.net/ar/), [Čeština](https://spamscanner.net/cs/), [Dansk](https://spamscanner.net/da/), [Deutsch](https://spamscanner.net/de/), [Español](https://spamscanner.net/es/), [Suomi](https://spamscanner.net/fi/), [Français](https://spamscanner.net/fr/), [עברית](https://spamscanner.net/he/), [Magyar](https://spamscanner.net/hu/), [Bahasa Indonesia](https://spamscanner.net/id/), [Italiano](https://spamscanner.net/it/), [日本語](https://spamscanner.net/ja/), [한국어](https://spamscanner.net/ko/), [Nederlands](https://spamscanner.net/nl/), [Norsk](https://spamscanner.net/no/), [Polski](https://spamscanner.net/pl/), [Português](https://spamscanner.net/pt/), [Русский](https://spamscanner.net/ru/), [Svenska](https://spamscanner.net/sv/), [ไทย](https://spamscanner.net/th/), [Türkçe](https://spamscanner.net/tr/), [Українська](https://spamscanner.net/uk/), [Tiếng Việt](https://spamscanner.net/vi/), [中文](https://spamscanner.net/zh/); each page has a Markdown copy at the same address followed by index.md - [Source code](https://github.com/spamscanner/spamscanner): the library, command line, tests and training script - [npm package](https://www.npmjs.com/package/spamscanner)