> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://docs.postnuvia.com/llms.txt.

# Spam & Virus Detection

> How PostNuvia automatically scans incoming emails for spam and viruses.

PostNuvia automatically scans every inbound message for spam and viruses before it reaches your inbox. This happens transparently — there is nothing you need to configure.

## Virus Detection

Emails that contain viruses or malware are **rejected at the gateway** and are never stored. Your inboxes will never contain a message flagged as infected. This protects your agents from processing potentially dangerous content.

## Spam Detection

Emails identified as spam are still **stored** in your inbox so you never lose a message that might be a false positive. However, they are **excluded from API results by default** to keep your agent's workflow clean.

When you call the [List Threads](/api-reference/inboxes/threads/list) or [List Messages](/api-reference/inboxes/messages/list) endpoint, spam messages are filtered out unless you explicitly request them.

## Accessing Spam Threads

To include spam in your results, pass the `include_spam` (`includeSpam` in TypeScript) parameter when listing threads.

**`TypeScript`**

```typescript title="TypeScript"
const threads = await client.threads.list({
    includeSpam: true,
});
```

```python
threads = client.threads.list(
    include_spam=True,
)
```

**`CLI`**

```bash title="CLI"
# list threads including spam
postnuvia inboxes threads list \
  --inbox-id <id> \
  --include-spam true
```

Each thread object includes a `spam` label indicating whether it was flagged as spam, so you can handle flagged threads differently in your application logic.

**`Example spam thread`**

```json title="Example spam thread"
{
  "thread_id": "thread_abc123",
  "subject": "You have won a prize!",
  "labels": ["spam"],
  "from": "suspicious@example.com",
  "to": ["your-agent@your-domain.com"]
}
```