79583463

Date: 2025-04-20 14:53:01
Score: 2.5
Natty:
Report link

The Maildir object itself can be iterated to loop through the messages in the top-level folder.

mbox = mailbox.Maildir(dirpath, create=False)
for msg in mbox.itervalues():
  ...

or just:

for msg in mbox:
  ...

https://docs.python.org/3/library/mailbox.html#maildir-objects

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: user30323242