Skip to content
Back to skills

Email Reader

ASecurity

Read/search Gmail via gog CLI (preferred) or Python scripts (fallback). Inbox check, email search, content retrieval, IMAP support.

  • 33 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 5, 2026
developmentpythongobashapibackend

Works with

  • cli
  • api

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro scans all 20 files and shows the line behind each finding

Scanned September 5, 2026

npx -y skills add dvcrn/openclaw-skills-marketplace --skill email-reader --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Email Reader?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Email Reader
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/dvcrn-email-reader-71250b2c/badge)](https://www.skillsdirectory.com/skills/dvcrn-email-reader-71250b2c)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: email-reader
description: "Read/search Gmail via gog CLI (preferred) or Python scripts (fallback). Inbox check, email search, content retrieval, IMAP support."
---

# email-reader

## Cuándo usar
Usuario pide revisar inbox, buscar correos, leer mensajes, listar carpetas, o ver emails recientes.

## Backend A — gog CLI (preferido)

### Setup (una vez)
```bash
brew install steipete/tap/gogcli
gog auth credentials /ruta/credentials.json
gog auth add $GOG_ACCOUNT --services gmail
```

### Comandos
```bash
# No leídos (acción por defecto)
gog gmail search 'in:inbox is:unread' --max 5 --format minimal --json --no-input

# Búsqueda por criterio
gog gmail search '<query>' --max 10 --format minimal --json --no-input

# Correo completo
gog gmail get <ID> --format full --json --no-input

# Hilo completo
gog gmail thread <THREAD_ID> --format minimal --json --no-input
```

### Queries útiles
```bash
# Carpetas sistema
'in:inbox newer_than:1d'   'in:spam newer_than:30d'
'in:sent newer_than:7d'    'is:starred'

# Etiquetas personalizadas
'label:Clientes'  'label:Facturas newer_than:90d'

# Filtros
'from:juan@empresa.com is:unread'
'subject:propuesta newer_than:7d'
'has:attachment in:inbox newer_than:7d'
```

### Operadores Gmail
`from:` `to:` `subject:` `label:` `is:unread` `is:starred` `has:attachment`
`newer_than:Nd` `older_than:Nd` `in:inbox` `in:sent` `after:YYYY/MM/DD`

## Backend B — Python (fallback)

### Setup (una vez)
```bash
pip install google-api-python-client google-auth-oauthlib beautifulsoup4 cryptography
python3 scripts/auth.py   # OAuth → genera token.json cifrado
```

### Comandos
```bash
python3 scripts/fetch_emails.py --label INBOX --max 50
python3 scripts/fetch_emails.py --label INBOX --unread-only --max 20
python3 scripts/fetch_emails.py --label INBOX --since 2026-01-01
python3 scripts/fetch_emails.py --label INBOX --from juan@empresa.com
python3 scripts/fetch_emails.py --label SPAM  --max 100
python3 scripts/fetch_emails.py --label Clientes --max 30
python3 scripts/list_folders.py                     # listar etiquetas
python3 scripts/fetch_thread.py --thread-id <ID>   # hilo completo
python3 scripts/imap_fetch.py --host imap.outlook.com --folder INBOX  # no-Gmail
```

## Flujo
1. Detectar backend: `command -v gog &>/dev/null && BACKEND=gog || BACKEND=python`
2. Construir query desde intent del usuario — preguntar si ambiguo
3. Ejecutar con `--max N` conservador (default 5-10)
4. Parsear JSON → presentar: remitente, asunto, fecha, preview + ID
5. Ofrecer: leer completo, refinar búsqueda, actuar

## Reglas
- SIEMPRE `--json` + `--no-input`; nunca mostrar JSON crudo
- Default `--max 5`; subir solo si usuario pide más
- Preservar IDs para acciones posteriores
- Sin resultados → sugerir query más amplio
- Solo lectura; enviar/responder → **email-responder**

## Errores
- `gog` missing → `brew install steipete/tap/gogcli`
- `GOG_ACCOUNT` unset → pedir Gmail al usuario
- Token expired → `gog auth add <email>` / `python3 scripts/auth.py`

Files in this skill

  • README.md3.1 KB
  • SKILL.md3 KB
  • analyzer.py3.4 KB
  • auth.py2.3 KB
  • fetch_emails.py4.9 KB
  • fetch_thread.py1.3 KB
  • imap_fetch.py1.9 KB
  • list_folders.py637 B
  • manage_labels.py1.6 KB
  • mnt/user-data/outputs/email-manager-v3/email-analyzer/SKILL.md3.2 KB
  • mnt/user-data/outputs/email-manager-v3/email-organizer/SKILL.md3.7 KB
  • mnt/user-data/outputs/email-manager-v3/email-reporter/SKILL.md3.6 KB
  • mnt/user-data/outputs/email-manager-v3/email-responder/SKILL.md3.3 KB
  • mnt/user-data/outputs/email-manager-v3/email-scheduler/SKILL.md3.7 KB
  • organizer.py3.3 KB
  • phishing_check.py2.3 KB
  • reporter.py5.2 KB
  • responder.py7.9 KB
  • rules_engine.py2.9 KB
  • scheduler.py4.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…