e2e: fixture skips empty folders

This commit is contained in:
grabowski committed 2026-10-23 10:22:09 +07:00
1 parent bc600c27a0
commit 7e01130172
1 file changed
+4 -1
+4 -1
View File
@@ -94,9 +94,12 @@ def inspect(user, password):
boxes.append(m.group(3).decode())
out = {"boxes": boxes, "folders": {}}
for b in boxes:
typ, _ = c.select(f'"{b}"', readonly=True)
typ, count = c.select(f'"{b}"', readonly=True)
if typ != "OK":
continue
if int(count[0]) == 0: # Dovecot answers FETCH 1:* on an empty box with BAD
out["folders"][b] = []
continue
typ, data = c.fetch("1:*", "(FLAGS INTERNALDATE RFC822.SIZE BODY.PEEK[HEADER.FIELDS (MESSAGE-ID SUBJECT)])")
msgs = []
for item in data: