Add possibility to fetch full RFC822

This commit is contained in:
Alex 2022-06-29 20:10:42 +02:00
parent b71d967889
commit 4a412b96aa
Signed by: lx
GPG Key ID: 0E496D15096376BE
2 changed files with 7 additions and 2 deletions

View File

@ -246,6 +246,11 @@ impl MailboxView {
IString::Literal(meta.headers.clone().try_into().unwrap()),
))))
}
FetchAttribute::Rfc822 => {
attributes.push(MessageAttribute::Rfc822(NString(Some(
IString::Literal(body.as_ref().unwrap().clone().try_into().unwrap()),
))))
}
FetchAttribute::Envelope => {
attributes.push(MessageAttribute::Envelope(message_envelope(&parsed)))
}
@ -260,7 +265,6 @@ impl MailboxView {
}));
}
tracing::info!("Fetch result: {:?}", ret);
Ok(ret)
}

View File

@ -239,7 +239,8 @@ impl MailboxInternal {
let mail = br#"From: Garage team <garagehq@deuxfleurs.fr>
Subject: Welcome to Aerogramme!!
This is just a test email, feel free to ignore."#;
This is just a test email, feel free to ignore.
"#;
let mail = IMF::try_from(&mail[..]).unwrap();
self.append(mail, None).await?;