mirror of
https://github.com/stalwartlabs/mail-parser.git
synced 2026-11-28 08:01:24 +00:00
v0.5.0
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
mail-parser 0.5.0
|
||||
================================
|
||||
- `Message` headers are now stored as a `MessagePart` with index 0.
|
||||
- Improved `MessagePart` API.
|
||||
- Nested base64/quoted-printable encoded message/rfc822 parts are automatically parsed when calling `get_message`.
|
||||
- Better handling of malformed MIME messages.
|
||||
- Added raw offsets to MIME parts.
|
||||
|
||||
mail-parser 0.4.8
|
||||
================================
|
||||
- get_bytes_to_boundary fix (#21)
|
||||
|
||||
Generated
+1
-1
@@ -81,7 +81,7 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
|
||||
|
||||
[[package]]
|
||||
name = "mail-parser"
|
||||
version = "0.4.8"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"bincode",
|
||||
"chrono",
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
[package]
|
||||
name = "mail-parser"
|
||||
description = "Fast and robust e-mail parsing library for Rust"
|
||||
version = "0.4.8"
|
||||
version = "0.5.0"
|
||||
edition = "2018"
|
||||
authors = [ "Stalwart Labs <hello@stalw.art>"]
|
||||
license = "Apache-2.0 OR MIT"
|
||||
|
||||
Generated
+1
-1
@@ -42,7 +42,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "mail-parser"
|
||||
version = "0.4.7"
|
||||
version = "0.5.0"
|
||||
dependencies = [
|
||||
"encoding_rs",
|
||||
"serde",
|
||||
|
||||
+22
@@ -446,6 +446,14 @@ impl<'x> HeaderName<'x> {
|
||||
HeaderName::Other(name) => name.into_owned(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if it is a MIME header.
|
||||
pub fn is_mime_header(&self) -> bool {
|
||||
match self {
|
||||
HeaderName::Rfc(header) => header.is_mime_header(),
|
||||
HeaderName::Other(_) => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A header field
|
||||
@@ -535,6 +543,20 @@ impl RfcHeader {
|
||||
RfcHeader::ListUnsubscribe => "List-Unsubscribe",
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if it is a MIME header.
|
||||
pub fn is_mime_header(&self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
RfcHeader::ContentDescription
|
||||
| RfcHeader::ContentId
|
||||
| RfcHeader::ContentLanguage
|
||||
| RfcHeader::ContentLocation
|
||||
| RfcHeader::ContentTransferEncoding
|
||||
| RfcHeader::ContentType
|
||||
| RfcHeader::ContentDisposition
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for RfcHeader {
|
||||
|
||||
@@ -604,6 +604,7 @@ impl<'x> Message<'x> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use std::{collections::BTreeMap, fs, path::PathBuf};
|
||||
|
||||
Reference in New Issue
Block a user