Skip to content

Fix emoji in account names and add INBOX support#1

Open
ezcoder wants to merge 1 commit intointelligrit:mainfrom
ezcoder:fix/emoji-and-inbox-support
Open

Fix emoji in account names and add INBOX support#1
ezcoder wants to merge 1 commit intointelligrit:mainfrom
ezcoder:fix/emoji-and-inbox-support

Conversation

@ezcoder
Copy link
Copy Markdown

@ezcoder ezcoder commented Apr 6, 2026

Summary

  • Emoji/Unicode in account names: escapeJSString() now encodes all non-ASCII characters as \uXXXX escape sequences (with surrogate pair support for emoji above U+FFFF), preventing breakage when passing account names through osascript.
  • Missing INBOX: Mail.app exposes INBOX via acc.inbox(), which is separate from acc.mailboxes(). Added a findMailbox() JXA helper that handles this, and updated all functions that resolve mailboxes by name (message listing, details, search, mark/flag/delete, archive, move, attachments).

Test plan

  • Run mail-app-cli mailboxes list and verify INBOX appears for each account
  • Run mail-app-cli messages list -a "<account-with-emoji>" -m "INBOX" to verify both fixes work together
  • Run mail-app-cli messages list -a "<account>" -m "INBOX" to verify message listing from INBOX
  • Run mail-app-cli search "test" to verify search now finds INBOX messages
  • Verify existing non-INBOX mailbox operations still work

🤖 Generated with Claude Code

Two bugs fixed:

1. Emoji/Unicode in account names broke JXA scripts because
   escapeJSString() passed raw multi-byte characters through
   osascript. Now encodes all non-ASCII as \uXXXX sequences
   (with surrogate pairs for characters above U+FFFF).

2. INBOX was missing from mailbox listings and inaccessible
   for message operations. Mail.app exposes INBOX via
   acc.inbox(), separate from acc.mailboxes(). Added a
   findMailbox() JXA helper and updated all functions that
   resolve mailboxes by name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant