@@ -114,9 +114,26 @@ mails send --to <email> --subject "Report" --body "See attached" --attach report
114114``` bash
115115mails inbox # List recent emails
116116mails inbox --mailbox agent@test.com # Specific mailbox
117- mails inbox --query " password reset" # Search emails
117+ mails inbox --query " password reset" # Full-text search (ranked by relevance)
118118mails inbox --query " invoice" --direction inbound --limit 10
119119mails inbox < id> # View email details + attachments
120+
121+ # Advanced filters (mails.dev hosted / db9)
122+ mails inbox --has-attachments # Only emails with attachments
123+ mails inbox --attachment-type pdf # Filter by attachment type
124+ mails inbox --from github.com # Filter by sender
125+ mails inbox --since 2026-03-01 --until 2026-03-20 # Time range
126+ mails inbox --header " X-Mailer:sendgrid" # Filter by email header
127+
128+ # Combine any filters
129+ mails inbox --from github.com --has-attachments --since 2026-03-13
130+ mails inbox --query " deploy" --attachment-type log --direction inbound
131+ ```
132+
133+ ### stats
134+
135+ ``` bash
136+ mails stats senders # Top senders by frequency
120137```
121138
122139### code
@@ -159,12 +176,19 @@ await send({
159176// List inbox
160177const emails = await getInbox (' agent@mails.dev' , { limit: 10 })
161178
162- // Search inbox
179+ // Search inbox (full-text search with relevance ranking)
163180const results = await searchInbox (' agent@mails.dev' , {
164181 query: ' password reset' ,
165182 direction: ' inbound' ,
166183})
167184
185+ // Advanced filters (mails.dev hosted / db9)
186+ const pdfs = await getInbox (' agent@mails.dev' , {
187+ has_attachments: true ,
188+ attachment_type: ' pdf' ,
189+ since: ' 2026-03-01' ,
190+ })
191+
168192// Wait for verification code
169193const code = await waitForCode (' agent@mails.dev' , { timeout: 30 })
170194if (code ) console .log (code .code ) // "123456"
@@ -218,14 +242,21 @@ Local database at `~/.mails/mails.db`. Zero config.
218242
219243### db9.ai
220244
221- Cloud PostgreSQL for AI agents. Full-text search with ranking.
245+ Cloud PostgreSQL for AI agents. Full-text search with relevance ranking, attachment content search, and advanced filtering .
222246
223247``` bash
224248mails config set storage_provider db9
225249mails config set db9_token YOUR_TOKEN
226250mails config set db9_database_id YOUR_DB_ID
227251```
228252
253+ With db9, you get:
254+ - ** Weighted FTS** — subject (highest) > sender > body > attachment text
255+ - ** Attachment filters** — by type, by name, with/without attachments
256+ - ** Sender & time filters** — ` --from ` , ` --since ` , ` --until `
257+ - ** Header queries** — search JSONB email headers
258+ - ** Sender stats** — frequency ranking of all senders
259+
229260### Remote (Worker API)
230261
231262Queries the Worker HTTP API directly. Auto-enabled when ` api_key ` or ` worker_url ` is configured.
@@ -245,12 +276,34 @@ Queries the Worker HTTP API directly. Auto-enabled when `api_key` or `worker_url
245276## Testing
246277
247278``` bash
248- bun test # Unit + mock E2E tests
279+ bun test # Unit + E2E tests (no external deps)
249280bun test:coverage # With coverage report
250281bun test:live # Live E2E with real Resend + Cloudflare (requires .env)
282+ bun test:all # All tests including live E2E
251283```
252284
253- 125 unit tests + 42 E2E tests across 6 test suites.
285+ 168 unit tests + 71 E2E tests = ** 239 tests** across all providers.
286+
287+ ### E2E Coverage by Provider
288+
289+ | | SQLite | db9 | Remote (OSS) | Remote (Hosted) |
290+ | ---------------------------| --------| -------| --------------| -----------------|
291+ | Save inbound email | ✅ | ✅ | N/A | N/A |
292+ | Save email + attachments | ✅ | ✅ | N/A | N/A |
293+ | Send → receive (real) | ✅ | — | ✅ | ✅ |
294+ | Inbox list | ✅ | ✅ | ✅ | ✅ |
295+ | has_attachments flag | ✅ | ✅ | ✅ | ✅ |
296+ | Direction filter | ✅ | ✅ | ✅ | ✅ |
297+ | Pagination | ✅ | ✅ | ✅ | ✅ |
298+ | Email detail | ✅ | ✅ | ✅ | ✅ |
299+ | Attachment metadata | ✅ | ✅ | ✅ | ✅ |
300+ | Search | ✅ | ✅ | ✅ | ✅ |
301+ | Attachment content search | ✅ | ✅ | — | — |
302+ | Verification code | ✅ | ✅ | ✅ | ✅ |
303+ | Download attachment | ✅ | ✅ | — | ✅ |
304+ | Save to disk (--save) | ✅ | — | — | ✅ |
305+ | Mailbox isolation | ✅ | ✅ | — | — |
306+ | Outbound recording | ✅ | — | N/A | N/A |
254307
255308## License
256309
0 commit comments