# sync-email-into-crm

Log emails from a mailbox export as activities on the matching CRM contacts (idempotent, unknown senders ignored)

- **Space:** crm-public (https://github.com/Tech-Realm/space-crm-public/tree/main/sync-email-into-crm)
- **Level:** L2 (as the registry reports it)
- **Keys it needs (names only):** none
- **Tools:** python3
- **Routes:** mbox; checks: 1
- **Uses:** new (no recorded use yet)
- **Install:** `logicpacks pack use crm-public/sync-email-into-crm` or MCP `get_pack crm-public/sync-email-into-crm`
- **Files:** CHANGELOG.md, code/crm.py, outcome/EVIDENCE.md, outcome/checks.yaml, outcome/fixtures/contacts.csv, outcome/fixtures/inbox.mbox, outcome/results.json, pack.yaml, refs/refs.yaml, spec/SPEC.md, spec/source.md

## Purpose (spec/SPEC.md)

Log emails from a mailbox export as activities on the matching CRM contacts (idempotent, unknown senders ignored)

## Goal
Each contact's timeline shows the emails exchanged with them, without duplicates and without creating junk contacts.

## Steps
1. Export the mailbox to mbox (Thunderbird ImportExportTools, `getmail`, or Gmail Takeout) or fetch with imaplib.
2. `crm.py sync-mbox inbox.mbox` (re-run safe: Message-ID dedupe).
3. Review unknown senders by hand before adding them as contacts.

## Edge cases
- Forwarded threads: only From/To/Cc headers are matched.
- Missing Message-ID: date+subject used as the key.

## Don'ts
- Don't store email bodies in the CRM by default (subject + date only).
- Don't sync personal mailboxes without the owner's OK.



---

Canonical URL: https://logicpacks.io/packs/crm-public/sync-email-into-crm

Developed by TechRealm (techrealm.online), the software team. Operated by Al Jash Trading (Establishment), Abu Dhabi, since 1994, the legal entity that hosts and is responsible for the service. Economic licence CN-1030597, Abu Dhabi Registration Authority. Address: Office 5, Bani Yas West 4, Bani Yas, Abu Dhabi, UAE. Website: https://aljashtrading.com. Contact: hello@logicpacks.io, security@logicpacks.io, WhatsApp +1 713 632 2262 (https://wa.me/17136322262).

Machine-readable index: [/llms.txt](/llms.txt). Plain facts: [/about.md](/about.md). Safety: [/safety.md](/safety.md).
