diff options
Diffstat (limited to 'internal/imap/connection.go')
-rw-r--r-- | internal/imap/connection.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/imap/connection.go b/internal/imap/connection.go index 88b1496..358445b 100644 --- a/internal/imap/connection.go +++ b/internal/imap/connection.go @@ -99,6 +99,13 @@ func (conn *connection) ensureFolder(folder Folder) error { return nil } + if conn.mailboxes.locking(folder) { + // someone else tried to create the MB -- try again, now that he's done + return conn.ensureFolder(folder) + } else { + defer conn.mailboxes.unlocking(folder) + } + log.Printf("Checking for folder '%s'", folder) mbox, found, err := conn.list(folder.str) |