---
name: zimba-email
description: Search, read, send, reply, and forward Zimbra emails with attachment support. Use when the user asks about email, inbox, sending messages, or attachments.
allowed-tools: Bash(zimba *), Read, Write
---

# Zimbra Email

Use the `zimba` CLI to manage emails. All commands output JSON.

## Commands

```bash
# Search emails (Zimbra query syntax)
zimba email search "in:inbox is:unread"
zimba email search "from:user@example.com" 50  # with limit
zimba email search "subject:report after:03/01/2026"

# Read an email (just metadata + body)
zimba email read <msg_id>

# Read an email and download attachments to a directory
zimba email read <msg_id> /tmp/attachments

# Send an email
zimba email send "to@example.com" "Subject" "Body text"

# Send with attachments (file paths, NOT base64)
zimba email send "to@example.com" "Subject" "Body" /path/to/file1.pdf /path/to/file2.png

# Send with full options (pipe JSON to stdin)
echo '{"to":"a@b.com","subject":"Hi","body":"Hello","cc":"c@d.com","attachments":["/path/to/file.pdf"]}' | zimba email send

# Reply
zimba email reply <msg_id> "Reply body"
zimba email reply <msg_id> "Reply body" --all  # reply all
zimba email reply <msg_id> "See attached" /path/to/file.pdf

# Forward (includes original attachments automatically)
zimba email forward <msg_id> "to@example.com" "FYI"
zimba email forward <msg_id> "to@example.com" "See extra file" /path/to/extra.pdf

# List folders
zimba email folders

# Move, delete, flag, mark-read
zimba email move <folder_id> <msg_id> [msg_id...]
zimba email delete <msg_id> [--hard]
zimba email mark-read <msg_id> [--unread]
zimba email flag <msg_id> [--unflag]
```

## Important notes

- **Attachments are file paths**, not base64. The CLI uploads/downloads files automatically.
- When reading an email with attachments, pass a download directory to save them locally.
- Search uses Zimbra query syntax: `in:inbox`, `from:`, `to:`, `subject:`, `has:attachment`, `is:unread`, `after:MM/DD/YYYY`.
- Dates must be in US format: `MM/DD/YYYY`, NOT ISO format.
