You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add Maildir.get_flags() to access message flags without opening the file #90890
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2022-02-12.22:21:50.052>labels= ['type-feature', 'library', '3.11']
title='Add Maildir.get_flags() to access message flags without opening the file'updated_at=<Date2022-02-12.22:49:37.459>user='https://github.com/gildea'
A message's flags are stored in its filename by Maildir, so the flags
are available without reading the message file itself. The structured
message file name makes it efficient to scan a large mailbox to select
only messages that are, for example, not Trashed.
The mailbox.Maildir interface does not expose these flags, however. The
only way to access the flags through the mailbox library is to create a
mailbox.MaildirMessage object, which has a get_flags() method. But
creating a MaildirMessage requires opening the message file, which is slow.
I propose adding a parallel get_flags(key) method to mailbox.Maildir,
so that the flags are available without having to create a
MaildirMessage object.
In iterating through a mailbox with thousands of messages, I find that
this proposed Maildir.get_flags() method is 50 times faster than
MaildirMessage.get_flags().
Activity
gildea commentedon Feb 12, 2022
A message's flags are stored in its filename by Maildir, so the flags
are available without reading the message file itself. The structured
message file name makes it efficient to scan a large mailbox to select
only messages that are, for example, not Trashed.
The mailbox.Maildir interface does not expose these flags, however. The
only way to access the flags through the mailbox library is to create a
mailbox.MaildirMessage object, which has a get_flags() method. But
creating a MaildirMessage requires opening the message file, which is slow.
I propose adding a parallel get_flags(key) method to mailbox.Maildir,
so that the flags are available without having to create a
MaildirMessage object.
In iterating through a mailbox with thousands of messages, I find that
this proposed Maildir.get_flags() method is 50 times faster than
MaildirMessage.get_flags().
gildea commentedon Apr 14, 2023
Ping. This issue has a patch that needs reviewing
NEWS entry for pythongh-90890, new mailbox.Maildir methods.
gildea commentedon May 25, 2023
I have updated the patch based on initial review. Please take another look.
gildea commentedon Aug 17, 2023
Ping. This issue has a patch that needs reviewing
gh-90890: New methods to access mailbox.Maildir message info and flags (
gpshead commentedon Nov 11, 2023
Thanks!
gh-90890: Reorder mailbox.Maildir method documentation (GH-113071)
pythongh-90890: Reorder mailbox.Maildir method documentation (pythonG…
pythongh-90890: New methods to access mailbox.Maildir message info an…
pythongh-90890: Reorder mailbox.Maildir method documentation (pythonG…
pythongh-90890: New methods to access mailbox.Maildir message info an…
pythongh-90890: Reorder mailbox.Maildir method documentation (pythonG…