fix: update mailparse to 0.16.1 to fix panic when parsing a message

This commit is contained in:
link2xt
2025-02-27 20:44:31 +00:00
committed by l
parent 33f96d4010
commit 43a3e40bc7
4 changed files with 19 additions and 3 deletions

View File

@@ -312,6 +312,19 @@ fn test_mailparse_content_type() {
);
}
/// Test to reproduce
/// <https://github.com/staktrace/mailparse/issues/130>.
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_mailparse_0_16_0_panic() {
let context = TestContext::new_alice().await;
let raw = include_bytes!("../../test-data/message/mailparse-0.16.0-panic.eml");
// There should be an error, but no panic.
assert!(MimeMessage::from_bytes(&context.ctx, &raw[..], None)
.await
.is_err());
}
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_parse_first_addr() {
let context = TestContext::new().await;