diff --git a/crates/jmap/src/identity/get.rs b/crates/jmap/src/identity/get.rs index 6cc7295b..3fe07ee2 100644 --- a/crates/jmap/src/identity/get.rs +++ b/crates/jmap/src/identity/get.rs @@ -167,7 +167,6 @@ impl IdentityGet for Server { // Create identities let name = principal.description.unwrap_or(principal.name); - let has_many = num_emails > 1; let mut next_document_id = self .store() .assign_document_ids(account_id, Collection::Identity, num_emails as u64) @@ -175,13 +174,11 @@ impl IdentityGet for Server { .caused_by(trc::location!())?; for email in &principal.emails { let email = sanitize_email(email).unwrap_or_default(); - if email.is_empty() { + if email.is_empty() || email.starts_with('@') { continue; } let name = if name.is_empty() { email.clone() - } else if has_many { - format!("{} <{}>", name, email) } else { name.clone() }; diff --git a/tests/src/imap/mailbox.rs b/tests/src/imap/mailbox.rs index ae57868b..88cdae35 100644 --- a/tests/src/imap/mailbox.rs +++ b/tests/src/imap/mailbox.rs @@ -34,10 +34,14 @@ pub async fn test(mut imap: &mut ImapConnection, mut imap_check: &mut ImapConnec imap.assert_read(Type::Tagged, ResponseType::Ok).await; imap.send("CREATE \"Fruit/Apple/Green\"").await; imap.assert_read(Type::Tagged, ResponseType::Ok).await; + imap.send("CREATE \"L&APg-bende opgaver\"").await; + imap.assert_read(Type::Tagged, ResponseType::Ok).await; // Select folder from another connection other_conn.send("SELECT \"Tofu\"").await; other_conn.assert_read(Type::Tagged, ResponseType::Ok).await; + other_conn.send("SELECT \"L&APg-bende opgaver\"").await; + other_conn.assert_read(Type::Tagged, ResponseType::Ok).await; // Make sure folders are visible for imap in [&mut imap, &mut imap_check] { @@ -52,10 +56,13 @@ pub async fn test(mut imap: &mut ImapConnection, mut imap_check: &mut ImapConnec ("Fruit/Apple", [""]), ("Fruit/Apple/Green", [""]), ("Tofu", [""]), + ("L&APg-bende opgaver", [""]), ], true, ); } + imap.send("DELETE \"L&APg-bende opgaver\"").await; + imap.assert_read(Type::Tagged, ResponseType::Ok).await; // Special use folders that already exist should not be allowed imap.send("CREATE \"Second trash\" (USE (\\Trash))").await; @@ -65,6 +72,16 @@ pub async fn test(mut imap: &mut ImapConnection, mut imap_check: &mut ImapConnec imap.send("ENABLE IMAP4rev2").await; imap.assert_read(Type::Tagged, ResponseType::Ok).await; + // Create and delete using IMAP4rev2 + imap.send("CREATE \"L&APg-bende opgaver\"").await; + imap.assert_read(Type::Tagged, ResponseType::Ok).await; + imap.send("SELECT \"L&APg-bende opgaver\"").await; + imap.assert_read(Type::Tagged, ResponseType::Ok).await; + imap.send("UNSELECT \"L&APg-bende opgaver\"").await; + imap.assert_read(Type::Tagged, ResponseType::Ok).await; + imap.send("DELETE \"L&APg-bende opgaver\"").await; + imap.assert_read(Type::Tagged, ResponseType::Ok).await; + // Create missing parent folders imap.send("CREATE \"/Vegetable/Broccoli\" (USE (\\Important))") .await; diff --git a/tests/src/webdav/mod.rs b/tests/src/webdav/mod.rs index 75ff85c4..2b5bdfb6 100644 --- a/tests/src/webdav/mod.rs +++ b/tests/src/webdav/mod.rs @@ -76,7 +76,7 @@ pub async fn webdav_tests() { //test_build_itip_templates(&handle.server).await; - /* basic::test(&handle).await; + basic::test(&handle).await; put_get::test(&handle).await; mkcol::test(&handle).await; copy_move::test(&handle).await; @@ -89,7 +89,7 @@ pub async fn webdav_tests() { card_query::test(&handle).await; cal_query::test(&handle).await; cal_alarm::test(&handle).await; - cal_itip::test();*/ + cal_itip::test(); cal_scheduling::test(&handle).await; // Print elapsed time