aboutsummaryrefslogtreecommitdiffstats
path: root/worker/imap/connect.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/imap/connect.go')
-rw-r--r--worker/imap/connect.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/worker/imap/connect.go b/worker/imap/connect.go
index 6f341753..f0ed8043 100644
--- a/worker/imap/connect.go
+++ b/worker/imap/connect.go
@@ -94,6 +94,17 @@ func (w *IMAPWorker) connect() (*client.Client, error) {
return nil, err
}
+ info := make(chan *imap.MailboxInfo, 1)
+ if err := c.List("", "", info); err != nil {
+ return nil, fmt.Errorf("failed to retrieve delimiter: %w", err)
+ }
+ mailboxinfo := <-info
+ w.delimiter = mailboxinfo.Delimiter
+ if w.delimiter == "" {
+ // just in case some implementation does not follow standards
+ w.delimiter = "/"
+ }
+
return c, nil
}