Other: Copy from All Mail allowed again.

Creates duplicate.
Added test scenario.
This commit is contained in:
Xavier Michelon
2021-09-30 09:35:11 +02:00
committed by Jakub Cuth
parent 1250621a4d
commit 4d1ace5de7
2 changed files with 23 additions and 4 deletions

View File

@ -243,6 +243,10 @@ func (im *imapMailbox) moveMessages(uid bool, seqSet *imap.SeqSet, targetLabel s
// Called from go-imap in goroutines - we need to handle panics for each function.
defer im.panicHandler.HandlePanic()
// Moving from All Mail is not allowed.
if im.storeMailbox.LabelID() == pmapi.AllMailLabel {
return errors.New("move from All Mail is not allowed")
}
return im.labelMessages(uid, seqSet, targetLabel, true)
}
@ -279,10 +283,6 @@ func (im *imapMailbox) labelMessages(uid bool, seqSet *imap.SeqSet, targetLabel
}
return errors.New("move from Sent to Inbox is not allowed")
}
// Moving from All Mail is not allowed.
if im.storeMailbox.LabelID() == pmapi.AllMailLabel {
return errors.New("move from All Mail is not allowed")
}
deletedIDs := []string{}
allDeletedIDs, err := im.storeMailbox.GetDeletedAPIIDs()