Skip to content

v2.17.0

Choose a tag to compare

@kiki830621 kiki830621 released this 24 Jun 07:00

Fixed

  • compose_email / create_draft no longer wrap the body in <blockquote type="cite"> (#175). Mail.app applies its Apple-Mail-URLShareWrapperClass / blockquote type="cite" "inserted content" wrapper to any AppleScript-injected outgoing-message body (content: / set content / set html content) at MIME-serialization time. Desktop hides it with an inline border-left-style:none, so the sender saw nothing wrong — but many mobile clients honor the cite semantics and rendered the user's own new text as quoted content. Runtime testing disproved every "strip the wrapper after injection" fix (reading the live outgoing message's html content → AppleScript -1723; re-setting clean HTML → re-wraps; editing the saved .emlx → overwritten on send). The wrapper-free fix routes compose/draft through Mail's native compose pipeline via a mailto: hand-off (which does not wrap), then drives save/send and attachments with locale-independent keyboard shortcuts (⇧⌘A attach, ⇧⌘G go-to-folder, ⌘S save, ⇧⌘D send — no hardcoded localized menu names, avoiding the #174-class trap). A window-count delta guards dispatch so a keystroke never fires into the wrong window.

Added

  • check_accessibility MCP tool (#175). Reports whether Accessibility (GUI-scripting) is granted via AXIsProcessTrusted() — the permission the wrapper-free compose path needs (separate grant from Full Disk Access / check_fda). The --setup window gains an Accessibility row alongside Full Disk Access / Automation.
  • CHE_MAIL_DISABLE_MAILTO_COMPOSE env escape hatch — set to 1/true/yes to force the legacy AppleScript injection path (e.g. heavy/unattended automation where a briefly-visible compose window is unacceptable). CHE_MAIL_MAILTO_WINDOW_DELAY / CHE_MAIL_MAILTO_STEP_DELAY tune the GUI-chain timing (0–10s, like the #64 attachment delays).

Notes

  • The mailto path is used only when: format is plain, a subject is present, Accessibility is granted, no custom from_address, and the env hatch is off. markdown/html bodies, custom sender, empty subject, no Accessibility, or any GUI-step failure gracefully fall back to the legacy path (which works but wraps the body) with a one-line stderr warning — never a silent failure or refused send. Clean-body compose for reply_email / forward_email and for a custom sender are tracked as follow-ups (#218, #219).
  • GUI-robustness hardening (6-AI verify — Devil's-Advocate + Codex cross-model): dispatch locates the compose window by title (= subject) and raises it before ⌘S/⇧⌘D so the keystroke can't land on a window the user opened during the delay (and hard-errors → fallback if our window never opened — activate could otherwise inflate a bare window count); attachments add a drain delay + a target-window "no open sheet" check so ⇧⌘D can't fire before the File▸Attach panel closed; the GUI section is wrapped so a failure closes the abandoned compose window before the legacy fallback runs (no orphaned compose / duplicate); the user's clipboard is preserved at full fidelity via NSPasteboard (not a text-only AppleScript round-trip); the URL builder uses an explicit ASCII unreserved set; an over-long body (> ~8000 char URL) falls back rather than risk truncation; and the gated live test now reads the saved .emlx to assert the body is wrapper-free. Residual limitations (inherent to GUI automation, documented not hidden): attachment binding is gated by a drain + panel-closed signal rather than per-file completion polling, and a successful ⇧⌘D send cannot be programmatically confirmed — both degrade to the legacy fallback on detectable failure.