Skip to content

feat(email): add attachment support for send and reply#59

Merged
napoleond merged 1 commit intomainfrom
claude/add-email-attachments-L2vPD
Mar 15, 2026
Merged

feat(email): add attachment support for send and reply#59
napoleond merged 1 commit intomainfrom
claude/add-email-attachments-L2vPD

Conversation

@napoleond
Copy link
Contributor

Add --attach flag (repeatable) to email send and reply commands. The CLI
reads local files, detects MIME type from extension, and base64-encodes
content before passing to the MCP tool. Inbox and search results now
display attachment metadata (filename, type, size) inline.

https://claude.ai/code/session_013ZfRLDGZ9mawSATTJ8ToQg

Add --attach flag (repeatable) to email send and reply commands. The CLI
reads local files, detects MIME type from extension, and base64-encodes
content before passing to the MCP tool. Inbox and search results now
display attachment metadata (filename, type, size) inline.

https://claude.ai/code/session_013ZfRLDGZ9mawSATTJ8ToQg
@napoleond napoleond merged commit d47e621 into main Mar 15, 2026
2 checks passed
@napoleond napoleond deleted the claude/add-email-attachments-L2vPD branch March 15, 2026 17:08
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Code Review

Recommendation: APPROVE (comment only — approval blocked by repo policy)

Summary

Adds a repeatable --attach flag to email send and email reply commands, reads local files with MIME-type detection and base64 encoding, and surfaces attachment metadata in inbox/search listings. Documentation in SKILL.md is thorough and accurate.

Actionable Feedback (2 items)

  • email.ts:loadAttachments - No pre-read file size check. A large file will be fully loaded into memory before the server rejects it. Consider fs.statSync(resolved).size and fail fast if it exceeds the documented 7.5 MB raw limit.
  • email.ts:checkInbox and searchEmails - The attachment display block is identical in both functions. Extracting it to a small helper would reduce duplication.

Code Quality

Clean implementation. loadAttachments correctly uses path.resolve and path.basename. The static MIME map covers common types with a sensible application/octet-stream fallback. getAllArgValues was already present in index.ts for similar repeated flags, so the wiring is consistent.

Security

No concerns. path.resolve normalises the user-supplied path before reading, preventing path-traversal issues. File content is base64-encoded before leaving the process.

Positive Notes

  • Error handling on readFileSync is correct: catches, formats the message, and exits with code 1.
  • SKILL.md documentation is complete: usage examples, MCP tool parameter table, and the 10 MB size-limit caveat are all present.
  • The attachment count indicator in inbox/search gives a nice at-a-glance signal without being noisy.

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.

2 participants