| name | gmail-extract-and-clean |
| description | DEPRECATED — superseded by gmail-extract-and-act. Extract emails from Gmail to /mnt/ace/<repo>/, archive to repos, commit, then delete. Uses archive-everything model. |
| version | 2.0.0 |
| status | deprecated |
| superseded_by | gmail-extract-and-act |
| deprecation_reason | Archives raw email bodies to repos. Per #2017, the new model extracts only structured data and deletes emails when topics complete (queue model, not archive model). See #2019 for consolidation plan. |
| author | vamsee |
| tags | ["email","gmail","extraction","cleanup","archive","routing","DEPRECATED"] |
| related_skills | ["gmail-multi-account","contact-manager","gmail-extract-and-act"] |
| metadata | {"hermes":{"tags":["email","gmail","extraction","cleanup"]}} |
Gmail Extract and Clean
Extract emails from Gmail into the correct /mnt/ace/<repo>/doc/email/ location, commit to the workspace-hub external repo, then optionally delete from Gmail inbox.
Architecture
Gmail Inbox (3 accounts: ace, personal, skestates)
↓ extract + classify + route
/mnt/ace/<repo>/docs/email/ ← data lands here
↓ (samba share — no git here)
/mnt/local-analysis/workspace-hub/<repo>/ ← git lives here
↓ commit + push
Gmail message deleted from inbox
Key Finding: /mnt/ace/ Has No Git
The /mnt/ace/ directory contains samba share copies of external_dir repos. These have NO .git directories. The actual git repos live at /mnt/local-analysis/workspace-hub/<repo>/ (which includes <repo> as a subdirectory).
Critical: Always commit via the workspace-hub path, not /mnt/ace/ path.
Routing Rules
Email routing is defined in scripts/email/email-routing.yaml (workspace-hub repo):
rules:
"familydollar.com" → "sabithaandkrishnaestates/docs/email/tenant"
"sandsig.com" → "assethold/data/sandsig-cre-listings/email"
"github.com" → "achantas-data/docs/email/dev-notifications"
"collide.io" → DELETE
"indianstarllc.ccsend.com" → REVIEW
"default" → "achantas-data/docs/email/other"
Actions: <repo/path> = archive to that repo, DELETE = remove without archiving, REVIEW = flag for manual review.
Usage
Batch extraction with delete
cd /mnt/local-analysis/workspace-hub
uv run scripts/email/gmail-archive-extract.py --account ace --query --max 500 --delete --no-sheets