Skip to content

fix: SMTP HELO hostname#1284

Merged
andrinoff merged 2 commits into
floatpane:masterfrom
nanookclaw:fix/smtp-helo-hostname
May 16, 2026
Merged

fix: SMTP HELO hostname#1284
andrinoff merged 2 commits into
floatpane:masterfrom
nanookclaw:fix/smtp-helo-hostname

Conversation

@nanookclaw
Copy link
Copy Markdown
Contributor

@nanookclaw nanookclaw commented May 13, 2026

What?

Fixes #1084 by using the local OS hostname for the SMTP HELO/EHLO greeting instead of always sending localhost.

Both normal message sending and calendar replies now call a shared helper that returns os.Hostname() when available, with localhost kept as the fallback for hostname lookup failures or empty hostnames.

Why?

Some SMTP anti-spam checks reject or penalize public clients that identify as localhost. Sending the real client hostname matches the issue's requested behavior while preserving a safe fallback if hostname lookup is unavailable.

Verification: git diff --check passed. go test ./sender could not complete locally because this environment is missing libpcsclite (Package 'libpcsclite', required by 'virtual:world', not found); the focused hostname helper test was added but the package build reaches the existing smart-card dependency first.

Signed-off-by: Nanook <nanookclaw@users.noreply.github.com>
@nanookclaw nanookclaw requested a review from a team as a code owner May 13, 2026 20:08
@floatpanebot floatpanebot added bug Something isn't working ci CI / build pipeline area/sender SMTP send path labels May 13, 2026
Copy link
Copy Markdown
Member

@floatpanebot floatpanebot left a comment

Choose a reason for hiding this comment

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

Hi @nanookclaw! Please fix the following issues with your PR:

  • Body: Missing the ## What? or ## Why? headings required by the PR template.

@floatpanebot floatpanebot added the size/S Diff: 11–50 lines label May 13, 2026
@nanookclaw nanookclaw changed the title fix: use hostname for SMTP HELO fix: SMTP HELO hostname May 13, 2026
@floatpanebot floatpanebot dismissed their stale review May 13, 2026 20:11

Formatting issues have been resolved. Thank you!

Copy link
Copy Markdown
Member

@andrinoff andrinoff left a comment

Choose a reason for hiding this comment

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

return the comment back

Comment thread sender/sender.go
return "signed-" + fmt.Sprintf("%x", rb[:]), nil
}

// generateMessageID creates a unique Message-ID header.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why is the comment deleted?

Signed-off-by: Nanook <nanookclaw@users.noreply.github.com>
@nanookclaw
Copy link
Copy Markdown
Contributor Author

Restored the function comment that was accidentally displaced and added a short comment for the new HELO helper in 965b1ba.

Verification rerun:

git diff --check
go test ./sender

git diff --check passes. go test ./sender still stops before package build in this environment because libpcsclite is unavailable via pkg-config, matching the original local blocker.

@andrinoff andrinoff dismissed their stale review May 15, 2026 21:01

returned

Copy link
Copy Markdown
Member

@andrinoff andrinoff left a comment

Choose a reason for hiding this comment

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

lgtm

@andrinoff andrinoff merged commit 6684bd6 into floatpane:master May 16, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/sender SMTP send path bug Something isn't working ci CI / build pipeline size/S Diff: 11–50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BUG: SMTP HELO hostname hardcoded to 'localhost'

3 participants