From 6c96643d1298b57a69f4012f953bf43b3b915f19 Mon Sep 17 00:00:00 2001 From: Michal Horejsek Date: Fri, 8 Jan 2021 08:39:18 +0100 Subject: [PATCH] Do not explicitly unlabel folders during move --- internal/imap/mailbox_messages.go | 5 ++++- internal/imap/store.go | 1 + unreleased.md | 8 ++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/internal/imap/mailbox_messages.go b/internal/imap/mailbox_messages.go index b66e9114..122cde6f 100644 --- a/internal/imap/mailbox_messages.go +++ b/internal/imap/mailbox_messages.go @@ -249,7 +249,10 @@ func (im *imapMailbox) labelMessages(uid bool, seqSet *imap.SeqSet, targetLabel if err := targetStoreMailbox.LabelMessages(messageIDs); err != nil { return err } - if move { + // Folder cannot be unlabeled. Every message has to belong to exactly one folder. + // In case of labeling message to folder, the original one is implicitly unlabeled. + // Therefore, we have to unlabel explicitly only if the source mailbox is label. + if im.storeMailbox.IsLabel() && move { if err := im.storeMailbox.UnlabelMessages(messageIDs); err != nil { return err } diff --git a/internal/imap/store.go b/internal/imap/store.go index 137c916c..c8748ae5 100644 --- a/internal/imap/store.go +++ b/internal/imap/store.go @@ -62,6 +62,7 @@ type storeMailboxProvider interface { Color() string IsSystem() bool IsFolder() bool + IsLabel() bool UIDValidity() uint32 Rename(newName string) error diff --git a/unreleased.md b/unreleased.md index 81ac9feb..77c51cf4 100644 --- a/unreleased.md +++ b/unreleased.md @@ -11,3 +11,11 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/) ### Changed ### Fixed +* GODT-979 Fix panic when trying to parse a multipart/alternative section that has no child sections. +### Changed +* GODT-389 Prefer `From` header instead of `MAIL FROM` address. +* GODT-898 Only set ContentID for inline attachments. +* GODT-773 Replace `INTERNALDATE` older than birthday of RFC822 by birthday of RFC822 to not crash Apple Mail. +* GODT-927 Avoid to call API with empty label name. +* GODT-732 Fix usage of fontawesome +* GODT-885 Do not explicitly unlabel folders during move to match behaviour of other clients.