aboutsummaryrefslogtreecommitdiff
path: root/internal/imap
diff options
context:
space:
mode:
Diffstat (limited to 'internal/imap')
-rw-r--r--internal/imap/client.go10
-rw-r--r--internal/imap/imap.go3
2 files changed, 1 insertions, 12 deletions
diff --git a/internal/imap/client.go b/internal/imap/client.go
index 7440ed7..7569fb8 100644
--- a/internal/imap/client.go
+++ b/internal/imap/client.go
@@ -84,16 +84,6 @@ func (client *Client) list(folder string) (*imap.MailboxInfo, int, error) {
return mbox, found, nil
}
-func (client *Client) selectToplevel() (err error) {
- err = client.EnsureFolder(client.toplevel)
-
- if err == nil {
- _, err = client.c.Select(client.toplevel, false)
- }
-
- return
-}
-
func (client *Client) fetchDelimiter() error {
mbox, _, err := client.list("")
if err != nil {
diff --git a/internal/imap/imap.go b/internal/imap/imap.go
index ac24b9d..f2a9082 100644
--- a/internal/imap/imap.go
+++ b/internal/imap/imap.go
@@ -120,8 +120,7 @@ func Connect(url *url.URL) (*Client, error) {
log.Printf("Determined '%s' as toplevel, with '%s' as delimiter", client.toplevel, client.delimiter)
- // Go to toplevel folder by default, so that the rest is relative
- if err = client.selectToplevel(); err != nil {
+ if err = client.EnsureFolder(client.toplevel); err != nil {
return nil, err
}