fix(email): support send-only gateway mode - #57605
petrakersten wants to merge 2 commits into
Conversation
b3c3ef5 to
9f5bb8f
Compare
9f5bb8f to
e4cd8db
Compare
e4cd8db to
df0b610
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for splitting the SMTP-only work from #53264. The current main path still requires IMAP and starts polling, so the feature addresses a real gap.
Problems
plugins/platforms/email/adapter.py:172relaxes the plugin requirement for every SMTP-only environment. In the registry enable pass,gateway/config.py:2185-2249combinesEmailAdapter._is_connected()accepting an address (plugins/platforms/email/adapter.py:1239-1247) with that relaxed requirement and enables Email even when no send-only mode was selected. Normal-modeconnect()still requires IMAP (plugins/platforms/email/adapter.py:556-581), producing a configured-but-fatal adapter instead of preserving prior disabled behavior.- The new user-facing mode is undocumented.
website/docs/user-guide/messaging/email.md:24-28still makes IMAP a prerequisite and lines 65-82 list it as required.
Suggested changes
- Gate SMTP-only enablement on the resolved send-only config, and add coverage for SMTP-only credentials without that mode.
- Add an end-to-end config-loader test and document the mode in the Email guide.
Automated hermes-sweeper review.
| """ | ||
| addr = os.getenv("EMAIL_ADDRESS", "").strip() | ||
| pwd = os.getenv("EMAIL_PASSWORD", "").strip() | ||
| imap = os.getenv("EMAIL_IMAP_HOST", "").strip() | ||
| smtp = os.getenv("EMAIL_SMTP_HOST", "").strip() |
There was a problem hiding this comment.
This broadens the plugin gate for every SMTP-only environment, not just send-only configs. The registry enable pass then sees Email's address-only is_connected predicate and enables normal mode; normal connect() still requires IMAP and fails. Make the enablement predicate configuration-aware so SMTP-only credentials require resolved send_only mode.
df0b610 to
036fd08
Compare
|
Addressed the sweeper findings in the current head |
95f3c5e to
c92169d
Compare
99736ae to
2f4f995
Compare
fix(email): support send-only gateway mode
The explicit-disable test ( |
|
Addressed the latest automated review in head |
ea6e56a to
08640c8
Compare
08640c8 to
90390de
Compare
90390de to
c196109
Compare
Summary
platforms.email.mode: send_only/ SMTP-only mode so Hermes can send cron/system emails without starting IMAP pollingplatforms.email.enabled: falseinstead of env credentials re-enabling the email adapterRelationship to other PRs
Test Plan
scripts/run_tests.sh tests/gateway/test_email.py tests/gateway/test_session_reset_notify.py -q