Email integration

From fritzprix/libr-agent · View interactive version

Email integration is an AI agent skill from the GitHub repository fritzprix/libr-agent. Integrates with any IMAP/SMTP mail server (Gmail, Outlook, Naver, Kakao, custom servers, etc.). Use when the user wants to read, send, search, reply to, or manage emails. Primary path: validate_config + email_client.py (password stored with storeAs, setup via setup_account.py). If Python/config/IMAP

How to use this skill

Skill file

Email Integration

Interact with mail on behalf of the user. Prefer IMAP/SMTP scripts when they work; use sticky agent browser webmail only as fallback.

Path conventions

Paths are relative to this skill's Base Directory. Replace <skill-base-dir> with its absolute path in commands.

Security (mandatory)

Decision tree

  1. Try IMAP script path (steps 1–4 below).
  2. On failure that blocks scripts, offer browser fallback (do not loop forever on setup):
  1. If user agrees → follow references/browser-fallback.md.
  2. If not logged in inside the agent browser → ask the user to sign in once in a browser session, then retry.
  3. If user declines all paths → explain IMAP setup vs agent browser sign-in and stop.

Workflow (IMAP primary)

1. Detect config

python "<skill-base-dir>/scripts/validate_config.py"

2. Setup (first time or reset)

See references/setup-flow.md for the single storeAs tool call and the preset/custom domain commands.

3. Dispatch action

Classify the request and call email_client.py:

| Action | When | Command |

|---|---|---|

| read_inbox | Browse inbox | --action read_inbox [--limit N] [--filter unread\|today\|all] |

| read_email | Full content by UID | --action read_email --uid <UID> |

| send_email | Compose/send/reply | --action send_email --to ... --subject ... --body ... [--reply-to-uid <UID>] |

| search_email | Keyword/sender/date | --action search_email --query "<IMAP search>" |

| manage_email | Mark/move/delete | --action manage_email --uid <UID> --op <mark_read\|mark_unread\|move\|delete> |

Search query examples: see references/request-patterns.md.

Server presets: see references/server-profiles.md.

Draft vague compose requests yourself; confirm with the user before sending.

For bulk delete/move, confirm count first.

4. Present results

See references/output-format.md. Errors: references/error-handling.md.

Browser fallback

See references/browser-fallback.md.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.