Sfoglia il codice sorgente

added more secure way to logout from IMAP server

Yurii Sokolovskyi 4 settimane fa
parent
commit
6a003b369f
1 ha cambiato i file con 4 aggiunte e 1 eliminazioni
  1. 4 1
      src/imap.rs

+ 4 - 1
src/imap.rs

@@ -106,7 +106,10 @@ pub async fn download_email_from_imap() -> anyhow::Result<Vec<(u32, PathBuf)>>{
     }
     
     // Logout from the IMAP session
-    session.logout().await.expect("Unable to logout");
+    match session.logout().await{
+        Ok(_) => {}
+        Err(_) => {}
+    };
 
     Ok(stored_paths)
 }