Skip to content
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 <zulu99@gmx.net>
# Copyright 2016 Timo Kankare <timo.kankare@iki.fi>
# Copyright 2016, 2024 Timo Kankare <timo.kankare@iki.fi>
#
# 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