Engineering

How inbox sync keeps every email on the right record

Two-way inbox sync sounds simple until you meet forwarded threads, shared mailboxes and rate limits. Here is how K3X keeps every email on the right record, once.

K3X Team

Share

Inbox sync is the part of K3X nobody should have to think about. A rep sends an email, and a minute later it is on the right person, company and deal. When that works, the CRM stays complete without anyone typing. When it fails, a rep opens a deal, the most important email is missing, and they stop trusting the CRM. This post walks through the parts that turned out to be harder than they look.

Push first, poll as a safety net

Google Workspace and Microsoft 365 can both notify us when a mailbox changes, and we use those notifications so new mail shows up fast. Notifications are not guaranteed, though. Subscriptions expire, deliveries get dropped during provider incidents, and a mailbox can quietly stop sending them.

So every connected mailbox is also checked on a schedule using the provider’s incremental history API. If a notification was missed, the next check picks the message up. Push keeps sync fast, and polling keeps it complete.

One email, many copies

The same email often reaches K3X several times. If three people on your team are on a thread with a customer, the message lives in three mailboxes, each with its own ID. Forwards and BCCs add more copies.

We deduplicate on the Message-ID header, which the sending server sets once and every copy shares. When it is missing or malformed, we fall back to a fingerprint of the sender, the sent time and the content. Each email is stored once, with a list of the mailboxes it appeared in. That list is also what powers relationship strength.

Matching emails to records

An email address on its own tells you very little. Matching happens in three steps:

  1. People. Every address on the message is matched to a person record, or a new one is created when the domain belongs to a company you work with.

  2. Companies. People are linked to companies by domain. Personal and shared domains like gmail.com or outlook.com never create a company.

  3. Deals. The email is attached to open deals where those people are contacts. If there is more than one, it goes on each, and a rep can move it with one click.

Shared inboxes like sales@ or billing@ are synced as their own mailbox, so they never inflate any one teammate’s relationships.

Backfill never slows down live sync

When someone connects a mailbox, K3X imports their recent history so the CRM is useful on day one. Providers limit how fast that history can be read, so backfill runs in its own queue at a lower priority, newest messages first. A new user sees last week’s emails within minutes, even if older mail takes longer. If a provider starts rate limiting, backfill pauses and live sync keeps going.

Privacy is decided before storage

Sync is opt-in for each person. Users choose which mailboxes to connect and can exclude domains, labels or folders. Excluded mail is filtered out before it is stored, not hidden afterwards. Admins can add workspace-wide exclusions that individual users cannot override.

What we are working on next

The hardest remaining cases are mailing lists and tools that rewrite headers, which can make one conversation look like several. That is next on our list.

#inbox-sync

#infrastructure

Set up your workspace with us

Start a 7-day free trial, or book a 20-minute demo and we'll set up your workspace with you.

Set up your workspace with us

Start a 7-day free trial, or book a 20-minute demo and we'll set up your workspace with you.

Written by

K3X Team

K3X

Keep reading

K3X

The K3X letter

Product updates, pipeline ideas and what the best revenue teams are trying. Once a month.

© 2026 K3X Inc. All rights reserved.