mirror of
https://github.com/chatmail/core.git
synced 2026-04-25 01:16:29 +03:00
IMAP: logout from the server with a LOGOUT command
CLOSE, which was used previously, only expunges messages and deselects folder, and it should only be called if some folder is selected. For that, Imap.close_folder() method is used.
This commit is contained in:
committed by
holger krekel
parent
554160db15
commit
f5156f3df6
@@ -314,9 +314,15 @@ impl Imap {
|
||||
}
|
||||
|
||||
async fn unsetup_handle(&mut self, context: &Context) {
|
||||
// Close folder if messages should be expunged
|
||||
if let Err(err) = self.close_folder(context).await {
|
||||
warn!(context, "failed to close folder: {:?}", err);
|
||||
}
|
||||
|
||||
// Logout from the server
|
||||
if let Some(mut session) = self.session.take() {
|
||||
if let Err(err) = session.close().await {
|
||||
warn!(context, "failed to close connection: {:?}", err);
|
||||
if let Err(err) = session.logout().await {
|
||||
warn!(context, "failed to logout: {:?}", err);
|
||||
}
|
||||
}
|
||||
self.connected = false;
|
||||
|
||||
Reference in New Issue
Block a user