diff --git a/melib/src/email.rs b/melib/src/email.rs index 367a8a227..b5eb5800a 100644 --- a/melib/src/email.rs +++ b/melib/src/email.rs @@ -22,7 +22,7 @@ /*! * Email parsing, handling, sending etc. */ - +use fnv::FnvHashMap; mod compose; pub use self::compose::*; @@ -319,6 +319,7 @@ pub struct Envelope { message_id: MessageID, in_reply_to: Option, references: Option, + other_headers: FnvHashMap, timestamp: UnixTimestamp, thread: ThreadHash, @@ -354,6 +355,7 @@ impl Envelope { message_id: MessageID::default(), in_reply_to: None, references: None, + other_headers: FnvHashMap::default(), timestamp: 0, @@ -476,6 +478,11 @@ impl Envelope { } _ => {} } + } else { + self.other_headers.insert( + String::from_utf8_lossy(name).into(), + String::from_utf8_lossy(value).into(), + ); } } /* @@ -749,6 +756,9 @@ impl Envelope { None => Vec::new(), } } + pub fn other_headers(&self) -> &FnvHashMap { + &self.other_headers + } pub fn thread(&self) -> ThreadHash { self.thread }