From 35fd24ee46d8162cffe3aebcb32d0db1f35bd220 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Mon, 8 Jan 2024 07:52:45 +0100 Subject: [PATCH] Add the ENABLE capability, reduce wild logging --- src/imap/capability.rs | 1 + src/mail/mailbox.rs | 4 ++++ src/mail/user.rs | 5 +++++ 3 files changed, 10 insertions(+) diff --git a/src/imap/capability.rs b/src/imap/capability.rs index 631c3e2..feadb6b 100644 --- a/src/imap/capability.rs +++ b/src/imap/capability.rs @@ -22,6 +22,7 @@ impl Default for ServerCapability { fn default() -> Self { Self(HashSet::from([ Capability::Imap4Rev1, + Capability::Enable, Capability::Move, Capability::LiteralPlus, capability_unselect(), diff --git a/src/mail/mailbox.rs b/src/mail/mailbox.rs index 2a0a24a..7eed34f 100644 --- a/src/mail/mailbox.rs +++ b/src/mail/mailbox.rs @@ -39,7 +39,11 @@ impl Mailbox { .await?; } + // @FIXME reporting through opentelemetry or some logs + // info on the "shape" of the mailbox would be welcomed + /* dump(&uid_index); + */ let mbox = RwLock::new(MailboxInternal { id, diff --git a/src/mail/user.rs b/src/mail/user.rs index da0d509..5af86d0 100644 --- a/src/mail/user.rs +++ b/src/mail/user.rs @@ -71,10 +71,15 @@ impl User { /// Opens an existing mailbox given its IMAP name. pub async fn open_mailbox(&self, name: &str) -> Result>> { let (mut list, ct) = self.load_mailbox_list().await?; + + //@FIXME it could be a trace or an opentelemtry trace thing. + // Be careful to not leak sensible data + /* eprintln!("List of mailboxes:"); for ent in list.0.iter() { eprintln!(" - {:?}", ent); } + */ if let Some((uidvalidity, Some(mbid))) = list.get_mailbox(name) { let mb = self.open_mailbox_by_id(mbid, uidvalidity).await?;