🌱 Orchard is an early preview — connector details below are illustrative while we iterate.
📬

Email

IMAP

Point the connector at any IMAP server and read folders, message headers, and bodies as SQL tables — perfect for support inboxes, receipts, and alerts.

Stable Subscription By Query.Farm Python worker

Pricing

From $29/mo

Subscription plan

Subscribe ← Back to the Orchard

Overview

What IMAP does

The IMAP connector exposes an email account as a queryable catalog. Folders become a table, messages become rows, and headers, flags, and parsed bodies become columns you can filter and aggregate.

It handles the awkward parts of IMAP for you: MIME decoding, attachment metadata, threading, and incremental sync by UID so repeated queries stay fast. Combine it with other connectors to, say, reconcile receipts in an inbox against transactions in your warehouse.

Highlights

  • Folders, messages, and flags as SQL tables
  • MIME-decoded subject, body, and attachment metadata
  • Full-text search pushed down to the IMAP server
  • Incremental sync by UID for fast repeat queries
  • Read-only by default; OAuth or app-password auth

Attach & query

imap.sql
-- Attach an IMAP mailbox from the Orchard
ATTACH 'imap' AS mail (
  TYPE vgi,
  LOCATION 'https://orchard.query.farm/imap',
  TOKEN getenv('ORCHARD_TOKEN')
);

-- Unanswered support email in the last week, by sender
SELECT from_address, count(*) AS messages
FROM mail.messages
WHERE mailbox = 'Support'
  AND NOT answered
  AND received > now() - INTERVAL 7 DAY
GROUP BY from_address
ORDER BY messages DESC;

Requires the VGI extension. Set ORCHARD_TOKEN after subscribing.

What you get

Tables & functions it exposes

Once attached, the connector adds these objects to your SQL session.

Table
imap.mailboxes

One row per folder with message counts.

Table
imap.messages

Headers, flags, and decoded bodies per message.

Function
search(query)

Server-side IMAP search returning matching messages.

Secret
imap_credentials

Host, username, and OAuth/app-password secret.

Use cases

What teams build with IMAP

Triage a shared support inbox with SQL instead of filters.

Extract receipts or invoices and join them to accounting data.

Audit which alerting emails actually arrived, and when.

Ready to attach IMAP?

Subscribe in minutes, or talk to us about a custom connector for your stack.