Gmail Label Routing
Overview
Estandarizar cambios de etiquetas por remitente en Gmail con un flujo único y consistente.
Priorizar el script local para evitar inconsistencias manuales entre filtro, retroaplicación y estado de INBOX.
Workflow
- 1. Confirmar intención del usuario:
- - Etiqueta destino
- Uno o varios remitentes
- Si debe salir de INBOX (default: sí)
- Si debe reemplazar filtros existentes del remitente (solo cuando lo pida o haya conflictos)
- 2. Ejecutar el workflow:
CODEBLOCK0
INLINECODE0 es ruta relativa al directorio de esta skill.
- 3. Variantes comunes:
- - Mantener en INBOX: INLINECODE1
- Reemplazar filtros del remitente: INLINECODE2
- Simular sin cambios: INLINECODE3
- 4. Confirmar resultado con el JSON final del script:
- - INLINECODE4
- INLINECODE5
- INLINECODE6
- INLINECODE7
Rules
- - Repetir
--sender por cada remitente. - Mantener comillas en etiqueta y remitentes para evitar errores de parsing.
- Usar
--replace-sender-filters cuando haya mezcla por reglas duplicadas para el mismo remitente. - Si el usuario dice “haz lo mismo”, repetir el mismo patrón usado: etiqueta + filtro + retroactivo + manejo de INBOX.
- Si hay fallo de scopes en
gws para filtros, usar el fallback ya implementado dentro del workflow (credenciales OAuth locales).
Reference
- - Ver ejemplos listos en
references/commands.md.
Gmail 标签路由
概述
通过统一且一致的流程,标准化 Gmail 中按发件人进行的标签更改操作。
优先使用本地脚本,以避免过滤器、回溯应用和收件箱状态之间出现手动不一致的情况。
工作流程
- 1. 确认用户意图:
- 目标标签
- 一个或多个发件人
- 是否应从收件箱中移除(默认:是)
- 是否应替换发件人的现有过滤器(仅在用户要求或存在冲突时)
- 2. 执行工作流程:
bash
python3 scripts/gwsgmaillabel_workflow.py \
--label <标签名称> \
--sender correo1@dominio.com \
--sender correo2@dominio.com
scripts/gwsgmaillabel_workflow.py 是相对于本技能目录的路径。
- 3. 常见变体:
- 保留在收件箱中:--keep-inbox
- 替换发件人过滤器:--replace-sender-filters
- 模拟运行(不实际更改):--dry-run
- 4. 通过脚本输出的最终 JSON 确认结果:
- createdFilterId
- retroApplied
- withLabelCount
- inboxCount
规则
- - 每个发件人重复使用 --sender 参数。
- 标签和发件人需保持引号,以避免解析错误。
- 当同一发件人存在重复规则导致混乱时,使用 --replace-sender-filters。
- 如果用户说做同样的事,则重复使用相同的模式:标签 + 过滤器 + 回溯应用 + 收件箱处理。
- 如果在 gws 中过滤器出现作用域失败,使用工作流程中已实现的后备方案(本地 OAuth 凭据)。
参考
- - 请参阅 references/commands.md 中的示例。