diff --git a/libimagmail/src/mail.rs b/libimagmail/src/mail.rs index bc57c402..3eb07fa0 100644 --- a/libimagmail/src/mail.rs +++ b/libimagmail/src/mail.rs @@ -43,7 +43,10 @@ impl<'a> Mail<'a> { /// Opens a mail by the passed hash pub fn open>(store: &Store, hash: S) -> Result> { - unimplemented!() + Ref::get_by_hash(store, String::from(hash.as_ref())) + .map(|opt| opt.map(|r| Mail(r))) + .map_err_into(MEK::FetchByHashError) + .map_err_into(MEK::FetchError) } pub fn get_field>(&self, field: S) -> Result> {