mail-gateway

mail-gateway is a skill for Claude Code, Codex from ithinkihaveacat/dotfiles. It costs 108 tokens per session (1,116 once invoked), scanned A, original, Apache-2.0.

A read-only gateway that copies older Gmail messages into a local SQLite database and exposes cleaned results through a command-line tool or MCP server. It removes hidden web content and sensitive login or password-reset links before messages are made available.

In plain words
What is it for?
Use it to search or process Gmail history for categories such as orders, invoices, shipping, travel, and conversation threads. It is not for sending, composing, editing, or deleting email.
Why use it?
It limits access to reading mail and avoids exposing very recent messages, hidden content, and authentication links. It also provides prepared message data for later classification without allowing mail changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to search or process Gmail history for categories such as orders, invoices, shipping, travel, and conversation threads. It is not for sending, composing, editing, or deleting email.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/ithinkihaveacat/dotfiles/mail-gateway
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ithinkihaveacat/dotfiles --skill mail-gateway
Clone the repo
git clone --depth 1 https://github.com/ithinkihaveacat/dotfiles

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for mail-gateway

README.md
[![agentmods](https://agentmods.dev/badge/skills/ithinkihaveacat/dotfiles/mail-gateway/github.svg)](https://agentmods.dev/skills/ithinkihaveacat/dotfiles/mail-gateway)
Your own site
<a href="https://agentmods.dev/skills/ithinkihaveacat/dotfiles/mail-gateway"><img src="https://agentmods.dev/badge/skills/ithinkihaveacat/dotfiles/mail-gateway/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for mail-gateway

Your own site · 80×15
<a href="https://agentmods.dev/skills/ithinkihaveacat/dotfiles/mail-gateway"><img src="https://agentmods.dev/badge/skills/ithinkihaveacat/dotfiles/mail-gateway.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 108 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,116 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00108 $0.01116
Opus 5.5 $0.00043 $0.00446
Sonnet 5.5 $0.00022 $0.00223
Haiku 4.5 $0.00011 $0.00112

Measured today against content hash 33bffd47945c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

mail-gateway scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mail-gateway/SKILL.md · 74 lines

How it starts

The opening of the file, as written. The whole thing — 74 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Prepared Mail Gateway

mail-gateway implements a read-only Category 5 Vaulted Gateway for Gmail. It holds gmail.readonly only on the trusted host and exposes a rate-limited, age-gated, sanitised Read Level 3 Streamable HTTP (/mcp) and stdio MCP interface (mail-gateway-mcp).

Key Boundaries

  • Read-only: Never requests or implements send, compose, modify, or delete.
  • Online-only: Fails fast when AGENT_OFFLINE=1 is set; Phase 2 categorisation and auth gating always use the Gemini Decisions API (gemini-decision-1, zero generated output tokens), followed by isolated zero-tool structured extraction (gemini-flash-lite-latest) only for non-auth structured categories (no heuristic fallback).
  • Age floor (>=30m): Enforced on provider internalDate (never the spoofable Date: header) across all CLI and MCP queries.
  • Sanitisation: Decodes RFC 2047 headers and strips scripts, styles, comments, CSS-hidden elements, invisible Unicode (including Tag block U+E0000–U+E007F and variation selectors), and magic-login, password-reset, redirect-wrapped, or token-bearing URLs across both subjects and bodies.
  • Withholding & deep links: auth_or_secret messages (detected deterministically and by the isolated zero-tool classifier) have their body and subject withheld and are never stored raw in SQLite; only message_id, sender metadata, a closed secret_kind label, gmail_url (respecting optional account_email in config.toml), and rfc822_message_id (when present) are exposed so the owner can open them directly in their mail client.
  • JSON category metadata & optional tags: Per-category structured fields (orders, invoices, shipping, travel, threads, auth_or_secret) live in messages.structured_json and are queried via SQLite JSON operators. action_needed is persisted on all non-auth messages. Existing Gmail labels are passed as an optional hint (maintaining Gmail filters is not required). An optional host-local TOML config (MAIL_GATEWAY_CONFIG or <data_dir>/config.toml) can declare account_email, gmail_query, extra bulk_labels, and custom [tags] (tag = "description"), which are evaluated as additional noul questions in the same Decisions API forward pass and filterable via list --tag.
  • Incremental sync & token telemetry: mail-gateway sync skips messages already stored in SQLite by default (pass --reclassify to re-run classification after changing [tags] or bulk_labels), excludes sent, drafts, spam, and trash, reports Gemini call/token usage in sync output and cumulative status.usage, and writes $AGENT_TELEMETRY_JSON when set.
  • Structured attachments: Attachment metadata (filename, mime_type, size_bytes, extracted) is stored separately from normalized_text in messages.attachments_json ([] for withheld messages). For non-bulk, tagged, or structured-category messages, small PDF/.ics/text/CSV attachments (<=2 MB, up to 3/message) have their text extracted, Phase 1 sanitised (failing closed on secrets), and stored in attachments_json. list/query expose metadata only; read returns full structured records; Stage 2b extraction and map render body and extracted attachments together for LLM prompts.
  • Diagnostics & decision scores: Stage 2a numeric probabilities (decision_scores, zero email content/secrets) are persisted in messages.decision_scores_json and returned on read and query auth_or_secret (never on <30m stubs). Run mail-gateway trace <file.eml> [--dir DIR] to replay a downloaded .eml through Phase 1, Stage 2a scores, attachment extraction, and Stage 2b without modifying SQLite.
  • Hard budgets: Hourly and daily message-read caps and lookback caps are persisted in SQLite per caller.

Read the full file on GitHub · 74 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today First seen · 74 lines · 108 tokens per session scan A 33bffd47945c

Subscribe to this mod's changes

mail-gateway is a skill published in the GitHub repository ithinkihaveacat/dotfiles (46 stars, last pushed today), licensed Apache-2.0. It adds 108 tokens to every session and 1,116 once invoked, about $0.0004 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-12-01.

Related

mail-gateway compared with skills from other repositories

mail-gateway next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
mail-gatewayithinkihaveacat/dotfilesSkill46todayApache-2.0A108Claude Code, Codex
herdrsfc-gh-eraigosa/dotfilesSkill57yesterdayApache-2.0A91Claude Code, Codex
rexfreekmurze/dotfilesSkill1.0k7d agononeA30Claude Code, Codex
master-buildfreekmurze/dotfilesSkill1.0k7d agononeC80Claude Code, Codex
completion-script-generatorcuriositech/windags-skillsSkill214d agononeB50Claude Code
diagnose_system_lagAI-Shell-Team/aishSkill5905d agoApache-2.0A78Claude Code
remote-fleet-opsAI-Shell-Team/aishSkill5905d agoApache-2.0A88Claude Code