feat: allow pass hostname in docker env#6
Conversation
🤖 Augment PR SummarySummary: Adds an optional SMTP client hostname override to support environments where the default HELO/EHLO identity is rejected. Changes:
Technical Notes: The SMTP connection now passes 🤖 Was this summary useful? React with 👍 or 👎 |
|
|
||
| assert smtp is not None | ||
| if self.use_tls and self.opportunistic_tls: | ||
| smtp.ehlo(local_host) |
There was a problem hiding this comment.
When SMTP_LOCAL_HOSTNAME is unset, local_host becomes "", so smtp.ehlo(local_host) sends an empty HELO/EHLO name; some servers reject that. Consider letting smtplib pick its default EHLO name when no override is configured rather than explicitly passing an empty string.
Other Locations
api/libs/smtp.py:36
🤖 Was this useful? React with 👍 or 👎
| client.send(_mail()) | ||
|
|
||
| mock_smtp_cls.assert_called_once_with("smtp.example.com", 25, timeout=10) | ||
| mock_smtp_cls.assert_called_once_with("smtp.example.com", 25, timeout=10, local_hostname=ANY) |
There was a problem hiding this comment.
These assertions now use local_hostname=ANY, which means the tests won’t catch regressions where the configured SMTP_LOCAL_HOSTNAME value isn’t actually propagated. Consider adding at least one test case with a non-empty SMTP_LOCAL_HOSTNAME and asserting it’s passed through to the SMTP constructor/ehlo.
Other Locations
api/tests/unit_tests/tasks/test_mail_send_task.py:154api/tests/unit_tests/tasks/test_mail_send_task.py:184api/tests/unit_tests/tasks/test_mail_send_task.py:216
🤖 Was this useful? React with 👍 or 👎
Benchmark PR from agentic-review-benchmarks#6