[Intum Help](https://intum.com/help.md) / [Mail](https://intum.com/help/mail.md)

# [Anti-Spam Filters](https://intum.com/help/mail/anti-spam-filters.md)

## What Are Anti-Spam Filters?

Anti-spam filters automatically mark unwanted [emails](emails) as spam based on the sender's address, domain, or subject. They work independently from [filters](filters) — they are simpler and dedicated exclusively to spam protection.

## Filter Types

An anti-spam filter can block emails based on:

- **Sender email** — a specific address (e.g., `spam@company.com`)
- **Domain** — all addresses from a given domain (e.g., `spam-company.com`)
- **Subject** — messages containing a specific phrase in the subject

You can combine conditions — e.g., an email from a specific domain **and** with a specific subject.

## Per-User and Per-Account Filters

Anti-spam filters can operate at two levels:

- **Per account** — blocks spam for all [users](../organization/user) in the account
- **Per user** — blocks spam only for a specific user

Per-user filters have **higher priority** than per-account filters.

## Creating an Anti-Spam Filter

1. Go to **Mail** → **Anti-Spam Filters**
2. Click **+** (New Filter)
3. Fill in:
   - **Sender email** — address to block
   - **Domain** — domain to block (alternative to email)
   - **Subject** — phrase in the subject
   - **User** — optionally, per-user filter
4. Save

An anti-spam filter can also be created directly from the email view — the **Mark as Spam** button automatically creates a filter.

## Filter Priority

The system automatically calculates priority based on specificity:

1. Email + subject (highest)
2. Email
3. Domain + subject
4. Subject
5. Domain (lowest)

## Spam Counter

Each filter has a counter showing how many emails it has blocked (`spam_count`).

## Important Information

- Provide either **email** or **domain** — not both at the same time
- The sender email must be **unique** within the account/user scope
- Per-user filters take priority over per-account filters