Sync your IMAP email into Supabase.

Why I built this

Your application needs email data.

Your inbox already provides it through IMAP.

Getting the first messages into a database is the easy part.

Keeping an IMAP mirror correct means surviving UIDVALIDITY resets, folder drift, UID-less FETCHes, malformed Message-IDs, disconnects, move/delete and live-backfill races, oversized MIME, non-idempotent retries, stale tombstones, partial Postgres/Storage/search commits, and worker crashes.

My work email is on Rackspace.

I wanted to use that email in AI tools and other applications.

So I built SupaMail.

SupaMail connects the inbox and syncs its data into your own Supabase project.

Then you can use the email in your applications, automations, and AI workflows.

SupaMail works with most standard IMAP providers.

If your provider needs a different setup, give me a ping at hi@supamail.dev. We will figure it out.

What you need

You need:

  • An email inbox with IMAP access.
  • Your full email address.
  • Your mailbox password or app password.
  • A Supabase project.

Most providers publish their IMAP settings.

SupaMail also includes presets for common setups.

Connect IMAP email to Supabase

  1. Choose your email provider

    Sign in to SupaMail and add an inbox.

    Choose your provider. Use Generic IMAP if you do not see a preset.

  2. Choose your Supabase project

    Select Use my own Supabase.

    Connect your Supabase account and choose the project for the email data.

  3. Let SupaMail prepare the project

    SupaMail installs the email mirror, private body storage, and a dedicated runtime role.

    Your Supabase project stays under your control.

  4. Connect the mailbox

    Enter your email address and mailbox password or app password.

    SupaMail checks the connection and starts the first sync.

  5. Use the data

    Messages appear as the sync progresses.

    Inspect them in the Supabase SQL Editor, or use them through the SupaMail API and MCP tools.

What gets synced?

SupaMail syncs:

  • Mailbox folders.
  • Messages.
  • Senders and recipients.
  • Subject lines and dates.
  • Message flags.
  • Thread relationships.
  • Attachment metadata.
  • Sync progress.

Complete message bodies use private Supabase Storage.

SupaMail encrypts them before storage.

Your original email stays with your email provider.

Supabase receives a synchronized mirror.

Query your email data

Start with the latest synchronized messages.

select
  subject,
  from_email,
  internal_date,
  folder_path
from public.imap_messages
where deleted_in_provider = false
order by internal_date desc
limit 20;

You can filter the results by sender, folder, date, or subject.

Find messages from one sender

select
  subject,
  from_email,
  internal_date
from public.imap_messages
where deleted_in_provider = false
  and lower(from_email) = lower('maya@example.com')
order by internal_date desc;

Use the SupaMail API or MCP tools when you need complete message bodies or threads.

Add access rules that match your application before you expose email data to users.

What can you build?

  • Customer email timelines.
  • Internal search tools.
  • Support dashboards.
  • Follow-up queues.
  • Sales workflows.
  • Email automations.
  • AI assistants with email context.

Start with one useful task.

Show the latest emails from customers with unresolved questions.

Find every message about the Northstar renewal from the last 30 days.

How the sync stays current

SupaMail continues to check the mailbox.

New messages enter the mirror. Message changes update.

The mirror also records when a message is no longer present in the provider.

You do not need to rebuild the connection for each application.

Security

Your Supabase project remains under your control.

SupaMail uses a dedicated database role for sync work.

It encrypts the mailbox password before storing it.

It encrypts complete message bodies before private storage.

You decide how your applications access the synchronized data.

Read the current details on the Trust, Security, and Deletion pages.

Frequently asked questions

Which email providers work?

SupaMail works with most standard IMAP providers.

The provider needs an encrypted IMAP connection and a supported login method.

Rackspace Email is verified.

If your setup is different, give me a ping at hi@supamail.dev. We will figure it out.

Can I use an existing Supabase project?

Yes.

SupaMail can install the email mirror in an existing project.

You can also use a separate project for your email data.

Does SupaMail need my Supabase database password?

No.

You connect your Supabase account through OAuth.

SupaMail creates a dedicated runtime role for the sync.

Does this move my email?

No.

Your email stays with your current provider.

SupaMail creates a synchronized copy in Supabase.

Can my application use the data?

Yes.

You control the Supabase project.

You can query the email tables from your backend, automation, or internal tool.

Can I connect the email to an AI agent?

Yes.

SupaMail provides API and remote MCP access to synchronized email.

You can also build your own AI workflow on top of the Supabase data.