瀏覽代碼

added more secure way to logout from IMAP server

Yurii Sokolovskyi 4 周之前
父節點
當前提交
6a003b369f
共有 1 個文件被更改,包括 4 次插入1 次删除
  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)
 }