From 70baf12adbf124da7a22aeb56a1ac45824bd4ed6 Mon Sep 17 00:00:00 2001 From: Ralph Slooten Date: Wed, 19 Jun 2024 16:02:40 +1200 Subject: [PATCH] Chore: Delete multiple POP3 messages in single action --- server/pop3/pop3.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/pop3/pop3.go b/server/pop3/pop3.go index 5f6d529..92a227c 100644 --- a/server/pop3/pop3.go +++ b/server/pop3/pop3.go @@ -93,10 +93,10 @@ func handleClient(conn net.Conn) { defer func() { if state == UPDATE { - for _, id := range toDelete { - _ = storage.DeleteMessages([]string{id}) - } if len(toDelete) > 0 { + if err := storage.DeleteMessages(toDelete); err != nil { + logger.Log().Errorf("[pop3] error deleting: %s", err.Error()) + } // Update web UI to remove deleted messages websockets.Broadcast("prune", nil) }