Conversation
Competing with #56581 for the same issue (#56569). This PR uses a regex to extract the last RFC5321 address from a raw session key (handles the deeper |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused defensive normalization.
Problems
- The diff fixes only
_send_email()and_standalone_send(). The two attachment SMTP builders still copy rawto_addrintoToon current main:plugins/platforms/email/adapter.py:1045andplugins/platforms/email/adapter.py:1125. - The new regression calls
EmailAdapter.send()directly with a synthetic session key. Current explicit email delivery parsesemail:user@example.comto a bare address intools/send_message_tool.py:586-589; cron delivery uses the same parser atcron/scheduler.py:1132-1159. The PR does not establish a supported current route that forwards the compound key to SMTP.
Suggested changes
- Normalize at all SMTP construction paths and add coverage for the two attachment builders.
- Add a test through a verified compound-key routing path, if one exists; otherwise frame this as defensive low-level normalization.
Automated hermes-sweeper review.
| @@ -925,12 +935,15 @@ def _send_email( | |||
| reply_to_msg_id: Optional[str] = None, | |||
There was a problem hiding this comment.
This normalizes only the plain-body SMTP path. The separate attachment builders still assign raw to_addr to msg["To"] on current main (plugins/platforms/email/adapter.py:1045 and :1125); please centralize or apply the same normalization there and add coverage.
b5bc09d to
7b3e8bc
Compare
7b3e8bc to
b1cf48a
Compare
Summary
To:header.Explicit email delivery currently strips supported
email:user@example.comidentifiers before reaching SMTP. This change intentionally hardens the low-level builders as well, rather than claiming a currently supported high-level route always forwards a compound key.Tests
.venv/bin/python -m pytest tests/gateway/test_email.py -q(91 passed).venv/bin/python -m ruff check plugins/platforms/email/adapter.py tests/gateway/test_email.pygit diff --check