-
Notifications
You must be signed in to change notification settings - Fork 20
Open
Description
Current code of get_body expects that body starts after <CR><LF><CR><LF>:
Line 23 in b50a082
| Ok(bytes::get_all_after(email.raw_bytes, b"\r\n\r\n").to_vec()) |
This code does not work for mails extracted from Dovecot Maildir which have LF line endings.
mailparse already splits headers and body in a different way inside parse_headers function:
https://github.com/staktrace/mailparse/blob/c51e92416c193072c739035fdcd5501c15f690e4/src/lib.rs#L939C1-L952C7
I managed to verify signatures of mails from Maildir, but had to do .replace("\n", "\r\n").
It would be nice to reuse mailparse splitting instead of splitting in a non-robust way. mailparse currently does not expose body_bytes (and header_bytes) fields, but proposing this to https://github.com/staktrace/mailparse/ is easy as it is well-maintained.
Metadata
Metadata
Assignees
Labels
No labels