Skip to content

Commit

Permalink
fix: Guarantee immediate message deletion if delete_server_after == 0 (
Browse files Browse the repository at this point in the history
  • Loading branch information
iequidoo committed Feb 7, 2024
1 parent f8907e3 commit fba27ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/ephemeral.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,11 @@ pub(crate) async fn delete_expired_imap_messages(context: &Context) -> Result<()
match context.get_config_delete_server_after().await? {
None => (0, 0),
Some(delete_server_after) => (
now - delete_server_after,
match delete_server_after {
// Guarantee immediate deletion.
0 => i64::MAX,
_ => now - delete_server_after,
},
now - max(delete_server_after, MIN_DELETE_SERVER_AFTER),
),
};
Expand Down

0 comments on commit fba27ff

Please sign in to comment.