Skip to content

Truncate long MIME parse error messages#202

Merged
wesm merged 2 commits intomainfrom
fix/mime-parse-failure
Mar 15, 2026
Merged

Truncate long MIME parse error messages#202
wesm merged 2 commits intomainfrom
fix/mime-parse-failure

Conversation

@wesm
Copy link
Copy Markdown
Owner

@wesm wesm commented Mar 15, 2026

Summary

  • Cap FirstLine() output at 200 runes using the existing TruncateRunes helper
  • Prevents enmime's malformed-MIME error messages (which embed the full email content as a single line) from flooding console output during sync
  • Uses rune-safe truncation to avoid splitting multi-byte UTF-8 characters in non-ASCII error text

Test plan

  • Existing TestFirstLine tests pass
  • New test cases: long ASCII lines, exact boundary (200 runes), long first line of multi-line, and Unicode truncation safety

🤖 Generated with Claude Code

wesm and others added 2 commits March 15, 2026 07:56
enmime includes the full malformed content in its error string as a
single line, so FirstLine() wasn't helping. Cap the output at 200
characters to keep log output readable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace byte-based len/slice with TruncateRunes to prevent splitting
multi-byte characters in error messages containing non-ASCII text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@roborev-ci
Copy link
Copy Markdown

roborev-ci bot commented Mar 15, 2026

roborev: Combined Review (6f55aef)

Summary Verdict: All reviewers agree the code changes are clean and introduce no issues.

No Medium, High, or Critical issues were found.


Synthesized from 3 reviews (agents: codex, gemini | types: default, security)

@wesm wesm merged commit e44a8e2 into main Mar 15, 2026
4 checks 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.

1 participant