aboutsummaryrefslogtreecommitdiffstats
path: root/worker/jmap/directories.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/jmap/directories.go')
-rw-r--r--worker/jmap/directories.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/worker/jmap/directories.go b/worker/jmap/directories.go
index b3297169..0fa3d898 100644
--- a/worker/jmap/directories.go
+++ b/worker/jmap/directories.go
@@ -244,8 +244,15 @@ func (w *JMAPWorker) handleCreateDirectory(msg *types.CreateDirectory) error {
var req jmap.Request
var parentId, id jmap.ID
- if _, ok := w.dir2mbox[msg.Directory]; ok {
+ if id, ok := w.dir2mbox[msg.Directory]; ok {
// directory already exists
+ mbox, err := w.cache.GetMailbox(id)
+ if err != nil {
+ return err
+ }
+ if mbox.Role == mailbox.RoleArchive && w.config.useLabels {
+ return errNoop
+ }
return nil
}
if parent := path.Dir(msg.Directory); parent != "" && parent != "." {