Creating your first filter rule
Filters are rules that automatically take action on incoming emails based on conditions you define. Instead of manually sorting, blocking, or forwarding messages, you set up a filter once and Cleanbox handles it for every future email that matches.
When to use filters
Filters are useful whenever you want to automate a recurring action:
- Block all emails from a specific domain
- Allow emails from a sender that keeps getting quarantined
- Forward matching emails to a specific IMAP folder
- Automatically mark certain messages as read or flagged
Creating your first filter
- Navigate to Filters in the sidebar
- Click "Add filter"
- Give your filter a name (e.g., "Block marketing from example.com")
- Add one or more conditions
- Choose an action and optional options
- Click "Save"
Conditions
Conditions define which emails the filter applies to. Each condition has three parts: a component (field), an operator, and a value.
Available components
| Component | What it checks | Example |
|---|---|---|
| from | The sender email address | ends_with "@spam.com" |
| from_name | The sender display name | contains "Marketing" |
| sender | The Sender header (if different from From) | contains "bulk" |
| subject | The email subject line | contains "invoice" |
| body | The email body text | contains "unsubscribe" |
| header | Raw email headers | contains "X-Mailer: PHPMailer" |
| property | Message properties (multipart, has attachments, etc.) | is "has_attachments" |
| category | Contact category (Shopping, Social Networks, etc.) | equals "Shopping" |
| spam_score | Numerical spam score | greater_than 5 |
| spam_symbol | Specific spam detection rules that triggered | contains "DKIM_FAIL" |
Operators
| Operator | Description |
|---|---|
contains / not_contains | Field includes (or doesn't include) the value |
equals / not_equals | Field matches (or doesn't match) exactly |
starts_with / ends_with | Field begins or ends with the value |
matches | Regex pattern matching |
exists / not_exists | Header or property is present (or absent) |
is / is_not | Property check (boolean) |
greater_than / less_than | Numerical comparison (for spam_score) |
Actions
Each filter has a primary action and optional additional options:
Primary action
| Action | What it does |
|---|---|
| Allow | Deliver the message, bypassing further filter evaluation and spam checks. |
| Deny | Reject the message. It is not delivered to your inbox. |
Note: For relay-protected addresses, the only available action is deny. Relay filters are specifically designed to block unwanted mail.
Additional options
When the action is allow, you can add these options to control how the message is delivered:
| Option | What it does |
|---|---|
| Store in folder | Deliver to a specific IMAP folder instead of the default |
| Mark as read | Automatically mark the message as read upon delivery |
| Mark as flagged | Flag the message as important upon delivery |
| Forward to | Forward a copy of the message to another email address |
Example: Deny all emails from a domain
- Click "Add filter"
- Name:
Block spam-company.com - Condition: from ends_with
@spam-company.com - Action: Deny
- Save
Example: Move invoices to a folder
- Click "Add filter"
- Name:
Invoices to folder - Condition: subject contains
invoice - Action: Allow
- Option: Store in folder →
Invoices - Save
Filter limits per plan
| Plan | Filters |
|---|---|
| Free | 3 |
| Personal | 10 |
| Premium / Advanced / Enterprise | Unlimited |