aboutsummaryrefslogtreecommitdiff
path: root/src/mail
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2023-10-12 10:22:41 +0000
committerQuentin <quentin@dufour.io>2023-10-12 10:22:41 +0000
commit609dde413972ebeeb8cd658a5ec9f62b34b5c402 (patch)
tree419f57fbd9c179c518fd57c0e3f31098305eb4b3 /src/mail
parent726b8c00159230e44e3b7726cb2c96d08073379c (diff)
parenta1b7ca17c0badff4c983f3738531f3aa9b0fb977 (diff)
downloadaerogramme-609dde413972ebeeb8cd658a5ec9f62b34b5c402.tar.gz
aerogramme-609dde413972ebeeb8cd658a5ec9f62b34b5c402.zip
Merge pull request 'partial re-implementation of body ext' (#30) from bodyext into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/aerogramme/pulls/30
Diffstat (limited to 'src/mail')
-rw-r--r--src/mail/incoming.rs8
-rw-r--r--src/mail/mailbox.rs6
-rw-r--r--src/mail/user.rs21
3 files changed, 20 insertions, 15 deletions
diff --git a/src/mail/incoming.rs b/src/mail/incoming.rs
index 290f1b3..b7d2f48 100644
--- a/src/mail/incoming.rs
+++ b/src/mail/incoming.rs
@@ -450,10 +450,10 @@ impl EncryptedMessage {
let por = PutObjectRequest {
bucket: creds.storage.bucket.clone(),
key: format!("incoming/{}", gen_ident()),
- metadata: Some(
- [(MESSAGE_KEY.to_string(), key_header)]
- .into_iter()
- .collect::<HashMap<_, _>>(),
+ metadata: Some(
+ [(MESSAGE_KEY.to_string(), key_header)]
+ .into_iter()
+ .collect::<HashMap<_, _>>(),
),
body: Some(self.encrypted_body.clone().into()),
..Default::default()
diff --git a/src/mail/mailbox.rs b/src/mail/mailbox.rs
index fe36a14..d92140d 100644
--- a/src/mail/mailbox.rs
+++ b/src/mail/mailbox.rs
@@ -369,7 +369,7 @@ impl MailboxInternal {
// Save mail meta
let meta = MailMeta {
internaldate: now_msec(),
- headers: mail.parsed.raw_headers.to_vec(),
+ headers: mail.parsed.raw_headers.to_vec(),
message_key: message_key.clone(),
rfc822_size: mail.raw.len(),
};
@@ -400,7 +400,7 @@ impl MailboxInternal {
futures::try_join!(
async {
// Delete mail body from S3
- let dor = DeleteObjectRequest{
+ let dor = DeleteObjectRequest {
bucket: self.bucket.clone(),
key: format!("{}/{}", self.mail_path, ident),
..Default::default()
@@ -461,7 +461,7 @@ impl MailboxInternal {
futures::try_join!(
async {
// Copy mail body from S3
- let cor = CopyObjectRequest{
+ let cor = CopyObjectRequest {
bucket: self.bucket.clone(),
key: format!("{}/{}", self.mail_path, new_id),
copy_source: format!("{}/{}/{}", from.bucket, from.mail_path, source_id),
diff --git a/src/mail/user.rs b/src/mail/user.rs
index 44e0081..5523c2a 100644
--- a/src/mail/user.rs
+++ b/src/mail/user.rs
@@ -334,17 +334,22 @@ impl MailboxList {
}
fn has_mailbox(&self, name: &str) -> bool {
- matches!(self.0.get(name), Some(MailboxListEntry {
- id_lww: (_, Some(_)),
- ..
- }))
+ matches!(
+ self.0.get(name),
+ Some(MailboxListEntry {
+ id_lww: (_, Some(_)),
+ ..
+ })
+ )
}
fn get_mailbox(&self, name: &str) -> Option<(ImapUidvalidity, Option<UniqueIdent>)> {
- self.0.get(name).map(|MailboxListEntry {
- id_lww: (_, mailbox_id),
- uidvalidity,
- }| (*uidvalidity, *mailbox_id))
+ self.0.get(name).map(
+ |MailboxListEntry {
+ id_lww: (_, mailbox_id),
+ uidvalidity,
+ }| (*uidvalidity, *mailbox_id),
+ )
}
/// Ensures mailbox `name` maps to id `id`.