Skip to content

fix(cli,email): quoted-relative file-drop paths + Date header on tool email path#19646

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-8c54fd4a
May 4, 2026
Merged

fix(cli,email): quoted-relative file-drop paths + Date header on tool email path#19646
teknium1 merged 2 commits into
mainfrom
hermes/hermes-8c54fd4a

Conversation

@teknium1
Copy link
Copy Markdown
Contributor

@teknium1 teknium1 commented May 4, 2026

Salvage of #15235 by @ms-alan onto current main.

Summary

Two related fixes in one PR:

1. fix(cli): detect quoted relative paths in _detect_file_drop — The starts_like_path prefilter in _detect_file_drop() previously only recognized unquoted ./, ../, /, ~ prefixes and quoted-absolute prefixes. Quoted relative-path prefixes ("./, "../, './, '../) were rejected even though the underlying path resolution supports them. Inputs like "./rel image.png" describe this were treated as plain text instead of parsed as an image attachment. Closes #15197.

2. fix(email): add RFC 5322 Date header to send_message_tool._send_email — PR #15207 added the Date header to gateway/platforms/email.py but missed the parallel path in tools/send_message_tool._send_email. Mail filters reject messages without a Date header. Closes #15160.

Note on authorship

The original commits were authored as pander <> with an empty email (a git-config quirk on the contributor's machine). Commits preserved in this salvage, with author set to ms-alan <chenb19870707@gmail.com> (the PR opener's public email on GitHub) so they pass the AUTHOR_MAP guard in scripts/release.py.

Changes

  • cli.py: extend starts_like_path prefilter with 4 quoted-relative prefixes (+4/-0)
  • tools/send_message_tool.py: add msg["Date"] = formatdate(localtime=True) (+2/-1)

Validation

Manual review; both changes are surgical and mirror fixes already applied elsewhere in the codebase.

Original PR: #15235

ms-alan added 2 commits May 4, 2026 02:47
Adds RFC 5322 Date header to the _send_email tool path in tools/send_message_tool.py.

Issue #15160 noted that both gateway/platforms/email.py and tools/send_message_tool.py
construct MIMEMultipart/MIMEText messages without setting a Date header. RFC 5322
requires the Date header; mail filters reject messages that lack it.

PR #15207 fixed the gateway/platforms/email.py path but did not cover
tools/send_message_tool._send_email, which is used by the send_message tool
for cross-channel messaging.

This change adds msg["Date"] = formatdate(localtime=True) to _send_email,
mirroring the fix applied to the gateway email adapter.

Closes #15160
@teknium1 teknium1 merged commit c659a16 into main May 4, 2026
7 of 10 checks passed
@teknium1 teknium1 deleted the hermes/hermes-8c54fd4a branch May 4, 2026 09:48
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard platform/email Email (IMAP/SMTP) adapter P2 Medium — degraded but workaround exists labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists platform/email Email (IMAP/SMTP) adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI file-drop misses quoted relative image paths [Bug]: Outbound Hermes emails missing Date header — bounced by mail filter

3 participants