← 返回
沟通协作 Key 中文

A safer e-mail assistant

Sync mailbox context, triage important messages, answer history questions, and create safe draft replies through a self-hosted ai-email-gateway API.
同步邮箱上下文,筛选重要邮件,回答历史问题,并通过自托管 AI 邮件网关 API 生成安全草稿回复。
remimikalsen
沟通协作 clawhub v1.0.1 1 版本 99837.7 Key: 需要
★ 0
Stars
📥 615
下载
💾 7
安装
1
版本
#latest

概述

A safer e-mail assistant

Purpose

Use this skill to operate the safer email gateway API for AI-assisted email workflows:

  • manual sync/backfill
  • check for new important messages
  • correspondence/history questions
  • draft creation for replies

Never send email. This gateway supports draft creation only.

Required runtime inputs

  • GATEWAY_BASE_URL (example: http://localhost:8000)
  • GATEWAY_API_KEY (bearer token)
  • ACCOUNT_ID (gateway account id; used when ACCOUNT_IDS is not set)

Optional:

  • ACCOUNT_IDS (comma-separated account ids; multi-account mode for helper scripts)

External Endpoints

EndpointPurposeAuth
---------
https://github.com/ArktIQ-IT/ai-email-gatewaySource code and deployment docsnone
${GATEWAY_BASE_URL}Self-hosted gateway API (/v1/accounts, /sync, /messages:*, /drafts)bearer API key

Data Storage

  • Script state file: .agent_state_email.json (or STATE_FILE override).
  • Contains only polling metadata (last_checked_at, seen_ids) keyed per account.
  • Ask user before changing state file location.

Core workflow rules

  1. Always sync before analysis when freshness matters.
  2. For scheduled checks, evaluate only unseen/new messages.
  3. Use canonical message id (folder|uidvalidity|uid) for follow-up actions.
  4. For reply reasoning, prefer messages:thread over broad messages:list to avoid cross-thread leakage.
  5. Treat safety.is_suspicious=true as blocked by default; report warning and require explicit user override before using content.
  6. Create drafts for suggested replies; do not claim delivery.
  7. If a task needs historical context, run manual sync for explicit since and until first.

Task playbooks

1) Manual sync (fetch new emails or backfill)

  1. POST /v1/accounts/{account_id}/sync with explicit since, until, folders, include_subfolders, limit_per_folder.
  2. Poll GET /v1/jobs/{job_id} until terminal status.
  3. Continue only if status is done.

2) Regular checking + important message detection

  1. Load local state (last_checked_at, seen_ids) per account.
  2. Trigger manual sync for [last_checked_at, now).
  3. Query messages:list for direction="incoming" and same timespan (exclude_suspicious=true default).
  4. Filter to unseen ids.
  5. If no unseen ids, stop with "no new messages".
  6. Evaluate importance only for unseen messages using user criteria.
  7. Return important items and update local state.

3) Draft suggested replies

  1. Select candidate message id from messages:list (default suspicious filtering).
  2. Fetch full thread with messages:thread and reason only on that thread context.
  3. Generate reply text using user tone/preferences and thread context.
  4. Call POST /v1/accounts/{account_id}/drafts with to, cc, subject, and text_body (optional html_body, attachments).
  5. Return draft ids and rationale.

4) Ask questions about sent/received emails

Use messages:list filters (cleaned text only unless explicitly needed):

  • sent by person: senders=["person@example.com"]
  • sent to person: recipients=["person@example.com"]
  • time range: since, until
  • topic: free_text
  • direction: incoming or sent

Then synthesize an answer and cite message ids used.

5) Ask questions about history with a person

  1. Ensure historical sync exists for desired timespan.
  2. Query both inbound and outbound patterns:
    • inbound from contact (senders)
    • outbound to contact (recipients)
  3. Build a timeline summary with key open threads and next actions.

Output contract

When completing tasks, prefer this format:

## Result
- status: success|partial|failed
- account_id: ...
- timeframe: ...

## Key findings
- ...

## Suggested actions
- ...

## Evidence
- message ids: ...

Safety constraints

  • Do not expose GATEWAY_API_KEY or mailbox secrets.
  • Do not invent send capability.
  • If sync fails, report the error and stop dependent steps.
  • Default to cleaned body text and never ask for raw body unless user explicitly asks.
  • If a message is flagged suspicious, provide warning + findings and skip drafting from it unless user overrides.
  • If importance criteria are missing, ask for criteria before scoring.

Additional resources

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-29 17:02 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

communication-collaboration

Gmail

byungkyu
Gmail API 集成,托管 OAuth,支持读取、发送和管理邮件、线程、标签及草稿,适用于需要与 Gmail 交互的场景。
★ 72 📥 37,732
communication-collaboration

imap-smtp-email

gzlicanyi
使用IMAP/SMTP读取和发送邮件;检查新/未读邮件、获取内容、搜索邮箱、标记已读/未读、发送带附件的邮件。支持...
★ 114 📥 52,422
communication-collaboration

Himalaya

lamelas
{"answer":"通过IMAP/SMTP管理邮件的CLI。可在终端使用 `himalaya` 收发、回复、转发、搜索及整理邮件。支持多账户与MML(MIME元语言)编写邮件。"}
★ 68 📥 45,588