Skip to content

feat: allow pass hostname in docker env#6

Open
tomerqodo wants to merge 2 commits intocursor_full_base_feat_allow_pass_hostname_in_docker_env_pr6from
cursor_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 intocursor_full_base_feat_allow_pass_hostname_in_docker_env_pr6from
cursor_full_head_feat_allow_pass_hostname_in_docker_env_pr6

Conversation

@tomerqodo
Copy link
Copy Markdown

@tomerqodo tomerqodo commented Jan 25, 2026

Benchmark PR from agentic-review-benchmarks#6


Note

Introduces configurable SMTP HELO/EHLO hostname for deployments behind NAT or with strict MTAs.

  • Adds SMTP_LOCAL_HOSTNAME to config (MailConfig) and wires it into SMTPClient as local_hostname for smtplib.SMTP/SMTP_SSL and EHLO during STARTTLS
  • Updates .env.example files (api, integration tests, docker) and docker-compose.yaml to expose SMTP_LOCAL_HOSTNAME
  • Refactors SMTPClient.send to select SMTP vs SMTP_SSL via a ternary and to EHLO with the configured hostname when using STARTTLS
  • Adjusts unit tests to expect local_hostname to be passed (uses ANY)

Written by Cursor Bugbot for commit 6facade. Configure here.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment thread api/libs/smtp.py
if self.use_tls and self.opportunistic_tls:
smtp.ehlo(local_host)
smtp.starttls()
smtp.ehlo(local_host)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EHLO behavior changed from server to local hostname

Medium Severity

The SMTP EHLO command behavior changed unintentionally. Previously, smtp.ehlo(self.server) used the SMTP server's address for the EHLO domain name (as documented in the removed comment). Now smtp.ehlo(local_host) uses SMTP_LOCAL_HOSTNAME if configured, otherwise an empty string which causes Python's smtplib to use socket.getfqdn() (the local machine's FQDN). This silent change in default behavior could break existing opportunistic TLS SMTP configurations that relied on using the server address for EHLO.

Additional Locations (1)

Fix in Cursor Fix in Web

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