Bundul
Internal
Browse docs
Waiting for review

archive

Executive Brief: Multi-Provider Email Integration

A frozen record of a decision at the time. Superseded by a new record rather than edited.

Written by the build · 2 September 2026

Executive Brief: Multi-Provider Email Integration

Question: Our subscription/utility-bill detection reads a user's inbox today via Gmail only. We want to support Gmail, Yahoo, and Outlook. Do we adopt a vendor (Unipile, Nango, Merge.dev, Composio, Pipedream Connect) or extend our own integration?

Date: 2026-08-10


1. What our system actually does today

Our email feature is read-only bill extraction, not a mailbox client:

  1. Connect a user's mailbox via OAuth (Gmail, read-only scope).
  2. Pull recent messages from a known sender (messages.list + get).
  3. LLM classifies "is this an invoice?" and extracts amount + due date.
  4. Write the result onto the user's subscription record.

We already abstract providers behind one interface (EmailProvider) with three implementations already in the codebase: Gmail, Microsoft/Outlook, and IMAP. So this is an extension decision, not a greenfield build.

Key technical fact that drives everything: Gmail and Outlook have modern APIs. Yahoo does not — Yahoo is only reachable over IMAP (app password or OAuth-over-IMAP). Any solution that covers Yahoo must speak IMAP.


2. The five vendors at a glance

Vendor Gmail Outlook Yahoo Fit for our use case Verdict
Unipile ✅ (via built-in IMAP) Purpose-built unified email API + webhooks Best fit
Nango ✅ (Yahoo/iCloud/IMAP) Managed auth + sync infra, you own the logic Strong, more build
Composio AI-agent email tools, no Yahoo/IMAP Partial — fails Yahoo
Pipedream Connect Workflow platform, no Yahoo/IMAP inbox path Partial — fails Yahoo
Merge.dev No email category exists (HR/CRM/Accounting only) Disqualified

Only Unipile and Nango cover all three providers in a single integration.

Vendor links: Unipile · Nango · Composio · Pipedream Connect · Merge.dev


3. Pros and cons

Unipile — recommended if we buy

What it is: A single normalized email API (GET /emails) across Gmail, Outlook, and IMAP, with a hosted "connect your inbox" flow and real-time webhooks. Docs: Email API for SaaS, Unified email API, Read email API.

  • Pros: Covers all 3 providers in one integration; Yahoo handled via built-in IMAP; normalized JSON means one adapter replaces our three; real-time new-mail webhooks (no polling); hosted OAuth so we handle less provider complexity; least engineering effort.
  • Cons: Ongoing per-connected-account cost; a third party sits in the email data path (privacy/compliance review needed); less control over raw provider fields.

Nango — recommended if we want to own the stack

What it is: Integration infrastructure — managed OAuth, token refresh, durable syncs, and a unified "new email" webhook — but code-first, giving full raw provider API access. Docs: Mail & calendar integrations, Trigger AI agents from email, Gmail integration.

  • Pros: Covers all 3 (plus iCloud/Exchange); removes the painful parts (OAuth, token refresh, Pub/Sub vs. Graph webhook differences); we keep full control of parsing/normalization; can self-host; good if email is one of several integrations we'll add.
  • Cons: More engineering than Unipile — we still write the sync/extraction logic; no turnkey normalized email schema out of the box; another platform dependency.

Composio — not a fit

Docs: Gmail toolkit, Outlook toolkit.

  • Pros: Clean managed auth; nice fit if our roadmap were AI-agent tool-calling.
  • Cons: No Yahoo/IMAP (fails a stated requirement); shaped for per-call agent actions, not a backend detection pipeline.

Pipedream Connect — not a fit

Docs: Gmail ↔ Outlook integration, Connect.

  • Pros: Fast embedded OAuth + proxy for Gmail/Outlook.
  • Cons: No Yahoo/IMAP inbox path; workflow-runtime dependency we don't need in our NestJS service.

Merge.dev — disqualified

Docs: Unified API.

  • Cons: Its unified API is HRIS/ATS/CRM/Accounting/Ticketing/File Storage/Knowledge Base. There is no inbox/email product. It physically cannot read user email.

4. What the user connection flow looks like

Today (Gmail only): User taps "Connect email" → Google OAuth consent (read-only) → we store an encrypted refresh token → detection runs.

With a vendor (Unipile / Nango):

  1. User taps "Connect your email."
  2. They pick a provider (Gmail / Outlook / Yahoo) — or the vendor auto-detects.
  3. Gmail / Outlook: standard OAuth consent screen (hosted by the vendor).
  4. Yahoo: OAuth-over-IMAP, or enter a Yahoo app password (Yahoo blocks normal-password IMAP).
  5. Vendor returns a connection ID; we store it (no raw mailbox tokens on our side with Unipile).
  6. New mail arrives → vendor webhook → our endpoint → classify/extract → write to subscription. No polling.

Net UX change: one extra "which provider?" step, and Yahoo users go through an app-password step (unavoidable — it's a Yahoo restriction, not a vendor one).


5. Build vs. buy

Because we already own an EmailProvider interface and an IMAP implementation, adding Yahoo ourselves is genuinely cheap:

Option Effort What we get What we carry
Extend our IMAP provider to Yahoo Low Yahoo support now, no new vendor, no new cost, data stays in-house We maintain OAuth/token/webhook plumbing ourselves; still polling, not real-time
Adopt Unipile Low–Med All 3 providers, one adapter, real-time webhooks, less code long-term Per-account cost; third party in the email path
Adopt Nango Med All 3 + managed auth/webhooks, we keep control We still write parsing; platform dependency

Recommendation: Don't rebuild what we have. The honest decision is between "add Yahoo to our existing IMAP provider for free" and "consolidate onto Unipile to also get real-time webhooks and delete our three-provider code."


6. Bottom line

  • Merge.dev is out — no email product. Composio and Pipedream are out — they can't do Yahoo, which is the whole reason we're expanding.
  • Only Unipile and Nango satisfy Gmail + Outlook + Yahoo in one integration.
  • Cheapest path: wire our existing IMAP provider to Yahoo — ships Yahoo with zero new vendor or cost, keeps email data in-house. Best if we just need coverage.
  • Cleanest long-term path: adopt Unipile — one normalized adapter replaces our three, adds real-time webhooks (kills polling), and covers Yahoo out of the box. Best if we value engineering leverage over keeping the data path fully in-house.
  • Nango is the middle path: pick it if email is the first of several integrations we plan to add and we want managed auth without giving up control.

Suggested next step: prototype Yahoo on our existing IMAP provider first (days, no procurement). If real-time webhooks and reduced maintenance prove worth it, run a paid Unipile pilot in parallel and compare.

This is a record of a decision at the time. It is not edited — write a new record that supersedes it.