Skip to content

Commit

Permalink
[IMP] We exclude read emails (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
zamberjo committed Jul 29, 2024
1 parent 984b34e commit 9772cd0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ def check_imap_archive_folder(self, connection):
def retrieve_imap_folder(self, connection):
"""Retrieve all mails for one IMAP folder."""
self.ensure_one()
msgids = self.get_msgids(connection, "UNDELETED")
msgids = self.get_msgids(connection, "UNSEEN UNDELETED")
for msgid in msgids[0].split():
# We will accept exceptions for single messages
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def default_get(self, fields_list):
folder = folder_model.browse([folder_id])
connection = folder.server_id.connect()
connection.select(folder.path)
criteria = "FLAGGED" if folder.flag_nonmatching else "UNDELETED"
criteria = "FLAGGED" if folder.flag_nonmatching else "UNSEEN UNDELETED"
msgids = folder.get_msgids(connection, criteria)
for msgid in msgids[0].split():
mail_message, message_org = folder.fetch_msg(connection, msgid)
Expand Down

0 comments on commit 9772cd0

Please sign in to comment.