jonaswinkler/paperless-ng

[BUG] `imap_tools` is sending `UserWarning`s

jschpp opened this issue · 1 comments

Describe the bug

When using imap to add documents to paperless imap_tools is sending UserWarnings

UserWarning: seen method are deprecated and will be removed soon, use flag methon instead

I think this refers to the deprecation of seen() as described here: https://github.com/ikvk/imap_tools/blob/master/docs/release_notes.rst#0430
this will be a problem when imap_tools > 0.47.0 will be used in the future https://github.com/ikvk/imap_tools/blob/master/docs/release_notes.rst#0470

This should be a relatively easy fix.

def post_consume(self, M, message_uids, parameter):
M.seen(message_uids, True)
can be changed into

def post_consume(self, M, message_uids, parameter):
    M.flag(message_uids, imap_tools.MailMessageFlags.SEEN, True)

To Reproduce

  1. Start paperless with docker-compse up (without -d) so you can observe/read the messages
  2. Set up mail account + rule
  3. Wait for a matching message to get marked seen

Expected behavior
The correct API should be used if there are any plans to upgrade imap_tools in the future

Screenshots
image

Relevant information

  • Host OS of the machine running paperless: Archlinux
  • Browser chrome
  • Version 7.5.0
  • Installation method: docker

fixed in fork