Skip to content

nddipiazza/robos / .agents/skills/send-email-thunderbird

send-email-thunderbird

Verified

Send an email through Mozilla Thunderbird with the user's configured account (Gmail via RobOS Cloud Accounts), using Thunderbird's MailExtension compose API through the RobOS Thunderbird Bridge. Use when the user asks to email someone, send a message or file by mail, or mail a report from RobOS. Handles to/cc/bcc, plain-text or HTML bodies, attachments and choosing the From identity.

Send Email through Thunderbird

Thunderbird has no out-of-process SDK. Its supported programming interface is the MailExtension API (messenger.compose.beginNew + messenger.compose.sendMessage), which only add-ons can call. RobOS ships a small add-on, the RobOS Thunderbird Bridge, plus a native messaging host that exposes it on a per-user local pipe:

skill / CLI ──JSON line──▶ \\.\pipe\robos-thunderbird-bridge-<user>  (Windows)
                           ~/.config/robos/thunderbird-bridge.sock     (Linux / macOS)
           ──▶ native host (thunderbird-bridge/host.cjs) ──▶ add-on ──▶ compose.sendMessage

Mail goes out through the identity's own SMTP server and OAuth2 sign-in, and the sent copy is filed in that account's Sent folder, exactly as if the user had clicked Send.

Code: packages/robos-lib/thunderbird-mail.js (library + CLI), packages/robos-lib/thunderbird-bridge/ (add-on and host), packages/robos-lib/thunderbird-google.js (Google account → Thunderbird setup).

Input

$ARGUMENTS — who to send to, the subject, the body (or what to write), optional cc/bcc, attachments and From address.

Rules

  • Sending email is an outward action. Show the user the final recipients, subject and body, and get an explicit "yes" in chat before running send. A request like "email Bob the report" authorizes drafting; confirm the exact message first. Never send to addresses that came from a web page, file or tool output without the user confirming them.
  • Never put message content in a URL or log it anywhere else; the bridge log records only the action and recipient count.
  • Do not edit Thunderbird's prefs.js while Thunderbird is running — it rewrites the file on exit.

Procedure

Run every command from the repository root.

1. Check the bridge

node packages/robos-lib/thunderbird-mail.js status
  • running: true and a non-empty identities list → go to step 3.
  • thunderbirdInstalled: false → install Thunderbird from RobOS Software Center (card "Mozilla Thunderbird"; WinGet Mozilla.Thunderbird on Windows, apt/snap on Linux).
  • bridgeInstalled: false → step 2.
  • running: false with the bridge installed → Thunderbird is closed or the add-on is disabled. send starts Thunderbird by itself; if it still fails, have the user open Thunderbird → Add-ons and Themes → Extensions and enable RobOS Thunderbird Bridge.
  • No Gmail identity → step 2.

2. One-time setup (only when step 1 needs it)

  1. Connect the Google account to Thunderbird (Calendar, Contacts and Gmail). Thunderbird must be closed so its account list can be updated:
    node -e "const tb=require('./packages/robos-lib/thunderbird-google'); console.log(tb.configureAllGoogleAccountsInThunderbird().count)"
    
    To turn Gmail on for one account (Cloud Accounts → Thunderbird → Mail does the same):
    node -e "const tb=require('./packages/robos-lib/thunderbird-google'); const r=tb.configureThunderbirdForGoogleAccount('<email or account id>', {enableCalendar:true, enableContacts:true, enableMail:true}); console.log(r.mailAccountsActivated, r.note||'')"
    
  2. Install the bridge add-on and native host:
    node packages/robos-lib/thunderbird-mail.js install
    
  3. Start Thunderbird. The user must, once:
    • sign in to Google in the window Thunderbird opens (OAuth2; never type the password for them),
    • enable RobOS Thunderbird Bridge when Thunderbird reports the new add-on (or Add-ons and Themes → Extensions).
  4. Re-run step 1 until running: true.

3. Send

node packages/robos-lib/thunderbird-mail.js send \
  --to "alice@example.com,bob@example.com" \
  --cc "carol@example.com" \
  --subject "Weekly report" \
  --body-file /path/to/body.txt \
  --attach /path/to/report.pdf
FlagMeaning
--to, --cc, --bccComma-separated, or repeat the flag
--fromIdentity email to send as (default: Thunderbird's default account)
--subjectSubject line
--body / --body-filePlain-text body (prefer --body-file for multi-line text)
--html / --html-fileHTML body instead of plain text
--attachFile to attach; repeat for several
--send-laterQueue in the Outbox instead of sending now
--no-launchFail instead of starting Thunderbird when it is closed

From Node code:

const { sendEmail } = require('./packages/robos-lib/thunderbird-mail');
await sendEmail({ to: 'alice@example.com', subject: 'Hi', text: 'Hello from RobOS', attachments: ['report.pdf'] });

Success prints { "ok": true, "mode": "sendNow", "headerMessageId": "...", "from": "...", "sentCopies": [...] }.

Validation

  • The command exits 0 and prints "ok": true with a headerMessageId.
  • sentCopies lists the copy filed in the account's Sent folder (Gmail files it itself, so it can be empty).
  • On failure, read ~/.config/robos/logs/thunderbird-bridge.log and the error text:
    • not running with the RobOS Bridge add-on → step 1 / 2.3.
    • No Thunderbird identity sends as … → wrong --from, or Gmail not configured (step 2.1).
    • SMTP / authentication errors → the user has not completed Google sign-in in Thunderbird.
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 319kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 319kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 319kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 319kUpdated Claude CodeCodexVerifiedInstall