Ensure all parsed messages have at least one part#121
Open
sftse wants to merge 4 commits intostalwartlabs:mainfrom
Open
Ensure all parsed messages have at least one part#121sftse wants to merge 4 commits intostalwartlabs:mainfrom
sftse wants to merge 4 commits intostalwartlabs:mainfrom
Conversation
After parsing the attached message that has no parts
|
Hey! I ran into this exact same issue while using himalaya to send emails. Got the Really hoping this gets reviewed and merged soon. Thanks for the fix! 🙏 |
Piesson
added a commit
to Piesson/mail-parser
that referenced
this pull request
Jan 8, 2026
Use first_mut() instead of direct array access to safely handle the case when message.parts is empty. This prevents index out of bounds panic at message.rs:528. Based on PR stalwartlabs#121 fix, backported to v0.9.x branch.
Piesson
added a commit
to Piesson/himalaya
that referenced
this pull request
Jan 8, 2026
Added patch.crates-io entry to use local mail-parser with fix for index out of bounds panic when message.parts is empty. Related: stalwartlabs/mail-parser#121
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #120
With corrupted messages the type of the part is a bit arbitrary. Chosen
PartType::Binaryto be as generic as possible, butPartType::Textcould be acceptable as well.