aboutsummaryrefslogtreecommitdiff
path: root/src/mail
diff options
context:
space:
mode:
Diffstat (limited to 'src/mail')
-rw-r--r--src/mail/incoming.rs5
-rw-r--r--src/mail/user.rs2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/mail/incoming.rs b/src/mail/incoming.rs
index b7d2f48..7094b42 100644
--- a/src/mail/incoming.rs
+++ b/src/mail/incoming.rs
@@ -23,6 +23,7 @@ use crate::mail::unique_ident::*;
use crate::mail::user::User;
use crate::mail::IMF;
use crate::time::now_msec;
+use crate::storage::Sto;
const INCOMING_PK: &str = "incoming";
const INCOMING_LOCK_SK: &str = "lock";
@@ -139,14 +140,14 @@ async fn incoming_mail_watch_process_internal(
Ok(())
}
-async fn handle_incoming_mail(
+async fn handle_incoming_mail<X: Sto>(
user: &Arc<User>,
s3: &S3Client,
inbox: &Arc<Mailbox>,
lock_held: &watch::Receiver<bool>,
) -> Result<()> {
let lor = ListObjectsV2Request {
- bucket: user.creds.storage.bucket.clone(),
+ bucket: user.creds.storage.engine::<X>().bucket.clone(),
max_keys: Some(1000),
prefix: Some("incoming/".into()),
..Default::default()
diff --git a/src/mail/user.rs b/src/mail/user.rs
index 360786d..5523c2a 100644
--- a/src/mail/user.rs
+++ b/src/mail/user.rs
@@ -30,8 +30,6 @@ pub const INBOX: &str = "INBOX";
const MAILBOX_LIST_PK: &str = "mailboxes";
const MAILBOX_LIST_SK: &str = "list";
-use crate::storage::*;
-
pub struct User {
pub username: String,
pub creds: Credentials,