diff options
author | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-01-02 00:08:39 +0200 |
---|---|---|
committer | Manos Pitsidianakis <el13635@mail.ntua.gr> | 2020-01-02 00:09:21 +0200 |
commit | 6671fe926ef6a2b79c494b69ffe40577a829b964 (patch) | |
tree | 13bb8b5fdec9c0747412976a68d037fbb31da197 /melib/src/email/parser.rs | |
parent | 8694278369a312a1c4e605adedb7ed631c02c95a (diff) |
melib: don't treat missing end boundary as error
Don't treat missing end boundary as error in multipart attachments.
python3's nntplib seems to return MIME attachments with this property
Diffstat (limited to 'melib/src/email/parser.rs')
-rw-r--r-- | melib/src/email/parser.rs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/melib/src/email/parser.rs b/melib/src/email/parser.rs index 4efd2e91..7a2aad28 100644 --- a/melib/src/email/parser.rs +++ b/melib/src/email/parser.rs @@ -750,9 +750,12 @@ pub fn multipart_parts<'a>(input: &'a [u8], boundary: &[u8]) -> IResult<&'a [u8] offset += 2; input = &input[2..]; } - continue; } else { - return IResult::Error(error_code!(ErrorKind::Custom(43))); + ret.push(StrBuilder { + offset, + length: input.len(), + }); + break; } } IResult::Done(input, ret) @@ -805,9 +808,9 @@ fn parts_f<'a>(input: &'a [u8], boundary: &[u8]) -> IResult<&'a [u8], Vec<&'a [u } else if input[0..].starts_with(b"\r\n") { input = &input[2..]; } - continue; } else { - return IResult::Error(error_code!(ErrorKind::Custom(43))); + ret.push(input); + break; } } IResult::Done(input, ret) |