AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Mail Accounts

skill-aashari-ai-agent-skills-mail-accounts · by aashari

List all Apple Mail synced accounts with email addresses, message counts, folder structure, and account types. Use when user asks what email accounts are synced, how many emails they have, or wants an overview of their mail setup.

No reviews yet
0 installs
32 views
0.0% view→install

Install

$ agentstack add skill-aashari-ai-agent-skills-mail-accounts

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-aashari-ai-agent-skills-mail-accounts)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
6mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Mail Accounts? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Mail Accounts — Discover All Synced Accounts

List every account synced in Apple Mail with identity, type, and stats.

Steps

1. Get all account UUIDs

ls ~/Library/Mail/V10/ | grep -v MailData | grep -v "^$"

2. For each UUID, identify the email address and account type

Query the most frequent recipient address (most reliable identity signal):

DB="$HOME/Library/Mail/V10/MailData/Envelope Index"

for UUID in $(ls ~/Library/Mail/V10/ | grep -v MailData); do
  # Account type from mailbox URL prefix
  TYPE=$(sqlite3 "$DB" "SELECT url FROM mailboxes WHERE url LIKE '%${UUID}%' LIMIT 1;" 2>/dev/null | grep -oE '^[a-z]+')

  # Sender of Sent mail = this account's address (reliable; avoids mailing list CC pollution)
  EMAIL=$(sqlite3 "$DB" "
    SELECT a.address
    FROM messages m
    JOIN mailboxes mb ON m.mailbox=mb.ROWID
    JOIN addresses a ON m.sender=a.ROWID
    WHERE mb.url LIKE '%${UUID}%'
      AND (mb.url LIKE '%Sent%' OR mb.url LIKE '%sent%')
      AND a.address LIKE '%@%'
    GROUP BY a.address ORDER BY COUNT(*) DESC LIMIT 1;" 2>/dev/null)

  # Fallback if no Sent mail: most frequent To: recipient in INBOX
  if [ -z "$EMAIL" ]; then
    EMAIL=$(sqlite3 "$DB" "
      SELECT a.address
      FROM messages m
      JOIN mailboxes mb ON m.mailbox=mb.ROWID
      JOIN recipients r ON r.message=m.ROWID
      JOIN addresses a ON r.address=a.ROWID
      WHERE mb.url LIKE '%${UUID}%/INBOX%' AND r.type = 0
      GROUP BY a.address ORDER BY COUNT(*) DESC LIMIT 1;" 2>/dev/null)
  fi

  # Total message count
  TOTAL=$(sqlite3 "$DB" "
    SELECT COUNT(*) FROM messages m
    JOIN mailboxes mb ON m.mailbox=mb.ROWID
    WHERE mb.url LIKE '%${UUID}%' AND m.deleted=0;" 2>/dev/null)

  # Unread count
  UNREAD=$(sqlite3 "$DB" "
    SELECT COUNT(*) FROM messages m
    JOIN mailboxes mb ON m.mailbox=mb.ROWID
    WHERE mb.url LIKE '%${UUID}%' AND m.deleted=0 AND m.read=0;" 2>/dev/null)

  echo "${UUID}|${TYPE}|${EMAIL}|${TOTAL}|${UNREAD}"
done

3. List mailbox folders for each account

sqlite3 "$DB" "
  SELECT DISTINCT url FROM mailboxes
  WHERE url LIKE '%UUID_HERE%'
  ORDER BY url;" 2>/dev/null

4. Get per-account message volume over time

sqlite3 "$DB" "
  SELECT mb.url,
    strftime('%Y-%m', datetime(m.date_received,'unixepoch','localtime')) as month,
    COUNT(*) as cnt
  FROM messages m
  JOIN mailboxes mb ON m.mailbox=mb.ROWID
  WHERE mb.url LIKE '%UUID_HERE%' AND m.deleted=0
  GROUP BY month ORDER BY month DESC LIMIT 24;" 2>/dev/null

Output Format

Present as a table:

| Account | Type | Total | Unread | |---|---|---|---| | user@gmail.com | Gmail/IMAP | 58,996 | 42 | | user@company.com | Exchange | 68,466 | 7 |

Then list folder structure per account if helpful. Note accounts that have high unread counts as potentially needing attention.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.