Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added missing method and fixed return value. #249

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions Mailnag/backends/local.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Copyright 2020 Patrick Ulbrich <[email protected]>
# Copyright 2016 Timo Kankare <[email protected]>
# Copyright 2016, 2024 Timo Kankare <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -119,7 +119,7 @@ def is_open(self):

def list_messages(self):
"""List unread messages from the mailbox.
Yields pairs (folder, message).
Yields tuples (folder, message, flags).
"""
folders = self._folders if len(self._folders) != 0 else ['']
root_maildir = mailbox.Maildir(self._path, factory=None, create=False)
Expand All @@ -128,7 +128,7 @@ def list_messages(self):
maildir = self._get_folder(root_maildir, folder)
for msg in maildir:
if 'S' not in msg.get_flags():
yield folder, msg
yield folder, msg, {}
finally:
root_maildir.close()

Expand All @@ -142,6 +142,11 @@ def request_folders(self):
maildir.close()


def mark_as_seen(self, mails):
# TODO: local mailboxes should support this
raise NotImplementedError


def notify_next_change(self, callback=None, timeout=None):
raise NotImplementedError("maildir does not support notifications")

Expand Down