Fix do imap expunge only if no error

This commit is contained in:
Laurent Destailleur 2023-04-11 10:13:15 +02:00
parent 565057700b
commit 0f58368d5d

View File

@ -2888,7 +2888,7 @@ class EmailCollector extends CommonObject
if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) { if (!empty($conf->global->MAIN_IMAP_USE_PHPIMAP)) {
$client->disconnect(); $client->disconnect();
} else { } else {
if (empty($mode)) { if (empty($mode) && empty($error)) {
imap_expunge($connection); // To validate any move imap_expunge($connection); // To validate any move
} }
imap_close($connection); imap_close($connection);