fix(gateway): add IMAP ID extension and SMTP port 465 support - #13564
fix(gateway): add IMAP ID extension and SMTP port 465 support#13564BarryLee wants to merge 1 commit into
Conversation
- Add RFC 2971 IMAP ID extension for providers requiring client identification - Fix SMTP connection to handle implicit TLS on port 465 per RFC 8314 - Improve error logging with logger.exception() for better debugging
|
Looks good — clean separation between Two small things worth tightening before merge:
Otherwise — ship it. Happy to ❤️/approve once those land. |
|
Hey @BarryLee — heads up, the landscape shifted on this one yesterday. Wanted to flag it so your work doesn't get lost. IMAP ID half (lines 32–105 of this PR)#22796 landed on Worth noting your version is technically more careful than the merged one in two ways:
Not arguing for a revert — SMTP port 465 half (lines 100–113 + 4 call sites) — this is the part worth keepingThis is genuinely still broken on
For 163.com's SMTP on 465, that breaks per RFC 8314 — port 465 is implicit TLS, so the right move is Your Suggested path forwardTwo options, your call:
Either works. I'd lean toward (1) since the test scaffolding and call-site changes are already done — less churn for maintainers to review. Happy to help rebase or pull out the SMTP commit if useful — just ping. Thanks for digging in on this one. 🍰 |
|
Thank you for the original RFC 2971/RFC 8314 investigation. Current Problems
Suggested changes
Automated hermes-sweeper review. |
What does this PR do?
Platforms Tested
Notes
Related Issue
#13558
Fixes #
Type of Change
Changes Made
IMAP ID Extension (RFC 2971)
Some mail servers (notably 163.com) reject connections as "Unsafe Login" if the client doesn't identify itself via the IMAP ID command after login. This PR adds
_send_imap_id()which:SMTP Connection Fix (RFC 8314)
Previously, the code always used STARTTLS regardless of port. Per RFC 8314:
This fixes connection issues with providers like 163.com that use port 465 for SMTP.
How to Test
hermes setup gatewayEMAIL_SMTP_PORT=465to~/.hermes/.envtests/gateway/test_email.pyChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
hermes --toolsets skills -q "Use the X skill to do Y"Screenshots / Logs