Skip to content

feat: allow pass hostname in docker env#6

Open
tomerqodo wants to merge 2 commits intocoderabbit_full_base_feat_allow_pass_hostname_in_docker_env_pr6from
coderabbit_full_head_feat_allow_pass_hostname_in_docker_env_pr6
Open

feat: allow pass hostname in docker env#6
tomerqodo wants to merge 2 commits intocoderabbit_full_base_feat_allow_pass_hostname_in_docker_env_pr6from
coderabbit_full_head_feat_allow_pass_hostname_in_docker_env_pr6

Conversation

@tomerqodo
Copy link

@tomerqodo tomerqodo commented Jan 30, 2026

Benchmark PR from agentic-review-benchmarks#6

Summary by CodeRabbit

New Features

  • Added support for configuring a custom SMTP local hostname via the SMTP_LOCAL_HOSTNAME environment variable to override the default hostname in SMTP negotiations.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

This pull request introduces a new configurable SMTP_LOCAL_HOSTNAME parameter across the application. The feature allows users to override the local hostname used in SMTP HELO/EHLO negotiations. Changes include environment variable declarations, configuration class updates, SMTP client implementation, and corresponding test updates.

Changes

Cohort / File(s) Summary
Configuration & Environment Variables
api/.env.example, api/tests/integration_tests/.env.example, docker/.env.example, docker/docker-compose.yaml
Added new SMTP_LOCAL_HOSTNAME environment variable across environment configuration files and Docker Compose setup to support configurable SMTP local hostname.
Configuration Classes
api/configs/feature/__init__.py
Added optional SMTP_LOCAL_HOSTNAME field to MailConfig with None default and updated FeatureConfig base classes to reference AuthConfig instead of OAuthConfig.
SMTP Client Implementation
api/libs/smtp.py
Refactored SMTP connection logic to consolidate TLS handling into a single conditional branch and pass local_hostname parameter from configuration to SMTP/SMTP_SSL constructors.
Unit Tests
api/tests/unit_tests/libs/test_smtp_client.py, api/tests/unit_tests/tasks/test_mail_send_task.py
Updated test assertions to expect local_hostname parameter (ANY) in SMTP constructor calls across all TLS/SSL/plain connection paths.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A bunny hops through SMTP's domain,
With local hostnames now in reign,
HELO and EHLO greet with flair,
Configuration floating through the air,
Test assertions dance with care! 🐰📬

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request description is minimal and only references a benchmark PR without providing substantive information about changes, objectives, or context as required by the template. Provide a proper summary of changes, link to associated issues using 'Fixes #', and include relevant context and motivation for the SMTP_LOCAL_HOSTNAME feature.
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding SMTP_LOCAL_HOSTNAME configuration support across Docker and application configuration files to allow hostname customization.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch coderabbit_full_head_feat_allow_pass_hostname_in_docker_env_pr6

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants