expunge mbox after move and delete cmds (#83)

This commit is contained in:
Clément DOUIN
2021-04-09 14:40:52 +02:00
parent e260823581
commit 557c5b79bc
3 changed files with 15 additions and 0 deletions
+8
View File
@@ -220,4 +220,12 @@ impl<'ic> ImapConnector<'ic> {
Ok(())
}
pub fn expunge(&mut self, mbox: &str) -> Result<()> {
self.sess
.expunge()
.chain_err(|| format!("Could not expunge `{}`", mbox))?;
Ok(())
}
}
+2
View File
@@ -514,6 +514,7 @@ pub fn msg_matches(matches: &ArgMatches) -> Result<()> {
&uid, &target
);
imap_conn.expunge(mbox)?;
imap_conn.logout();
return Ok(());
}
@@ -528,6 +529,7 @@ pub fn msg_matches(matches: &ArgMatches) -> Result<()> {
imap_conn.add_flags(mbox, uid, "\\Seen \\Deleted")?;
info!("Message {} successfully deleted", &uid);
imap_conn.expunge(mbox)?;
imap_conn.logout();
return Ok(());
}