From b796694cd5df688105b490edd43aa923743b3113 Mon Sep 17 00:00:00 2001 From: Beowulf Date: Sun, 28 Apr 2024 14:11:17 +0200 Subject: [PATCH] Skip already handled incoming emails It seems like (at least on my machine) that every mail is processed twice. Added a check if the email is already handled and if so, skip it. --- services/mailer/incoming/incoming.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/mailer/incoming/incoming.go b/services/mailer/incoming/incoming.go index a2352773ae..555cdfee8b 100644 --- a/services/mailer/incoming/incoming.go +++ b/services/mailer/incoming/incoming.go @@ -219,6 +219,11 @@ loop: } err := func() error { + if handledSet.Contains(msg.SeqNum) { + log.Debug("Skipping already handled message") + return nil + } + r := msg.GetBody(section) if r == nil { return fmt.Errorf("could not get body from message: %w", err)