Skip to content

Fix smtp.send hanging on missing trailing CRLF - #2

Merged
davecaos merged 3 commits into
mainfrom
fix/issue-1-smtp-send-hangs-missing-crlf
Mar 6, 2026
Merged

davecaos merged 3 commits into
mainfrom
fix/issue-1-smtp-send-hangs-missing-crlf

Conversation

@davecaos

@davecaos davecaos commented Mar 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Fixes smtp.send hanging when the message body doesn't end with \r\n, causing the SMTP end-of-data sequence (\r\n.\r\n) to be malformed
  • The termination dot was not appearing on its own line, so the server waited indefinitely until timeout (421 response)
  • Ensures build_message_string always returns a message ending with \r\n
  • Adds 4 tests covering all body type combinations (text-only, html-only, multipart, no body)
  • Bumps version to 1.1.0 and adds repository metadata to gleam.toml

Fixes #1

Test plan

  • All 25 unit tests pass (gleam test)
  • Manual test sending email via OVH SMTP (as described in issue)

🤖 Generated with Claude Code

davecaos and others added 3 commits March 6, 2026 17:37
The SMTP end-of-data sequence requires \r\n.\r\n but build_message_string
was not guaranteeing the body ended with \r\n for single text-only or
html-only messages. This caused the termination dot to not appear on its
own line, making the server hang until timeout (421).

Also bumps version to 1.1.0 and adds repository metadata to gleam.toml.

Fixes #1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@davecaos
davecaos merged commit e4a9286 into main Mar 6, 2026
1 check passed
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.

smtp.send hangs when message body does not end with \r\n

1 participant