Skip to content

Commit

Permalink
fix MailBoxFolderManager.list parse bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ikvk committed Jul 29, 2024
1 parent d1f5a63 commit 1d523fa
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,8 @@ Big thanks to people who helped develop this library:
`Docpart <https://github.com/Docpart>`_,
`meetttttt <https://github.com/meetttttt>`_,
`sapristi <https://github.com/sapristi>`_,
`thomwiggers <https://github.com/thomwiggers>`_
`thomwiggers <https://github.com/thomwiggers>`_,
`histogal <https://github.com/histogal>`_,

Help the project
----------------
Expand Down
4 changes: 4 additions & 0 deletions docs/release_notes.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
1.7.1
=====
* Fixed: MailBoxFolderManager.list parse bug

1.7.0
=====
* Moved: SortCriteria to consts
Expand Down
2 changes: 1 addition & 1 deletion imap_tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
from .utils import EmailAddress
from .errors import *

__version__ = '1.7.0'
__version__ = '1.7.1'
2 changes: 1 addition & 1 deletion imap_tools/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def list(self, folder: AnyStr = '', search_args: str = '*', subscribed_only: boo
:param subscribed_only: bool - get only subscribed folders
:return: [FolderInfo]
"""
folder_item_re = re.compile(r'\((?P<flags>[\S ]*)\) (?P<delim>[\S]+) (?P<name>.+)')
folder_item_re = re.compile(r'\((?P<flags>[\S ]*?)\) (?P<delim>[\S]+) (?P<name>.+)')
command = 'LSUB' if subscribed_only else 'LIST'
typ, data = self.mailbox.client._simple_command(
command, encode_folder(folder), encode_folder(search_args))
Expand Down
4 changes: 2 additions & 2 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import configparser
from imap_tools import MailBox

# 'GOOGLE', 'YANDEX', 'ZIMBRA', 'MAIL_RU', 'YAHOO', 'OUTLOOK'
TEST_MAILBOX_NAME_SET = {'YANDEX', 'ZIMBRA', 'MAIL_RU', 'YAHOO', 'OUTLOOK'}
# all: 'GOOGLE', 'YANDEX', 'ZIMBRA', 'MAIL_RU', 'YAHOO', 'OUTLOOK'
TEST_MAILBOX_NAME_SET = {'YANDEX', 'ZIMBRA', 'MAIL_RU', 'YAHOO'}


def get_test_mailbox_config(mailbox_name: str) -> dict:
Expand Down

0 comments on commit 1d523fa

Please sign in to comment.