diff options
author | Julian Pidancet <julian.pidancet@oracle.com> | 2022-10-21 21:15:07 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-10-25 23:30:56 +0200 |
commit | 8153f59188bfb62a944a731fcffc78670085b675 (patch) | |
tree | cb4e8647b04c46fdd83163bec20de3b898776fdd | |
parent | a381630604066cde5b791bfadb92de8c35e1cd1c (diff) | |
download | aerc-8153f59188bfb62a944a731fcffc78670085b675.tar.gz |
maildir: fix maildir folder listing
Previous change "maildir: hide invalid folders" prevents filepath.Walk
from descending into directories that don't contain new/, tmp/ or cur/
because the WalkDirFunc returns filepath.SkipDir.
We have to assume that these directories can be the parent of valid
maildir folders even if they're not themselves valid maildir folders, so
it is a mistake not to recurse into these subfolders. Fix it by
returning nil instead of filepath.SkipDir in the WalkDirFunc.
Fixes: 150aa0f498b9 ("maildir: hide invalid folders")
Signed-off-by: Julian Pidancet <julian.pidancet@oracle.com>
Acked-by: Robin Jarry <robin@jarry.cc>
-rw-r--r-- | worker/maildir/container.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/worker/maildir/container.go b/worker/maildir/container.go index 156b0af5..4181648b 100644 --- a/worker/maildir/container.go +++ b/worker/maildir/container.go @@ -81,7 +81,7 @@ func (c *Container) ListFolders() ([]string, error) { // Drop dirs that lack {new,tmp,cur} subdirs for _, sub := range []string{"new", "tmp", "cur"} { if _, err := os.Stat(filepath.Join(path, sub)); os.IsNotExist(err) { - return filepath.SkipDir + return nil } } |