[GH-ISSUE #200] Email import seems to mark all emails as read (gmail) #160

Open
opened 2026-02-25 21:31:20 +03:00 by kerem · 3 comments
Owner

Originally created by @chrismast on GitHub (Nov 4, 2020).
Original GitHub issue: https://github.com/ciur/papermerge/issues/200

Originally assigned to: @ciur on GitHub.

Description
Prelude: I actually run the linuxserver.io docker image whereas I think this might be more related to papermerge than the docker image. If I am wrong, let me know and I gladly open a ticket on their git.

Description: I configured papermerge and all works very well. I also did setup watching an email folder which in my case at the moment is my regular Gmail inbox based on a keyword. It seems though that all my incoming emails are marked as read right away (I assume papermerge is looking for the keyword, hence they are marked as read?).

Expected
Only mark emails containing the keyword as read.

Actual
See above.

If there is no real solution to this, does papermerge accept gmail labels? (As gmail does not really have folders anymore). Or do I have to setup a new dedicated email address?

Info:

  • OS: Debian LXC with docker
  • Browser: Chrome
  • Database: PSQL
  • Papermerge Version: newest
Originally created by @chrismast on GitHub (Nov 4, 2020). Original GitHub issue: https://github.com/ciur/papermerge/issues/200 Originally assigned to: @ciur on GitHub. **Description** Prelude: I actually run the linuxserver.io docker image whereas I think this might be more related to papermerge than the docker image. If I am wrong, let me know and I gladly open a ticket on their git. Description: I configured papermerge and all works very well. I also did setup watching an email folder which in my case at the moment is my regular Gmail inbox based on a keyword. It seems though that all my incoming emails are marked as read right away (I assume papermerge is looking for the keyword, hence they are marked as read?). **Expected** Only mark emails containing the keyword as read. **Actual** See above. If there is no real solution to this, does papermerge accept gmail labels? (As gmail does not really have folders anymore). Or do I have to setup a new dedicated email address? **Info:** - OS: Debian LXC with docker - Browser: Chrome - Database: PSQL - Papermerge Version: newest
Author
Owner

@ciur commented on GitHub (Nov 4, 2020):

@chrismast, I thank you for opening this bug.
I had a look at the issue, and you are completely right - Papermerge reads all emails (marks them as read).

I assume papermerge is looking for the keyword, hence they are marked as read?

Your ticket helped me to spot that mail secret is ignored :(. I will open a separate bug about email secret setting.

I think this might be more related to papermerge

Correct!

does papermerge accept gmail labels?

No, it does not. It is a good idea though. However, it depends on what "gmail labels" are. If "gmail labels" are standard IMAP folders (i.e. folders as per IMAP protocol) then it won't be that difficult to add that sort of filter.

Thank you for your heads up!

<!-- gh-comment-id:721774378 --> @ciur commented on GitHub (Nov 4, 2020): @chrismast, I thank you for opening this bug. I had a look at the issue, and you are completely right - Papermerge reads all emails (marks them as read). > I assume papermerge is looking for the keyword, hence they are marked as read? Your ticket helped me to spot that mail secret is ignored :(. I will open a separate bug about email secret setting. > I think this might be more related to papermerge Correct! > does papermerge accept gmail labels? No, it does not. It is a good idea though. However, it depends on what "gmail labels" are. If "gmail labels" are standard IMAP folders (i.e. folders as per IMAP protocol) then it won't be that difficult to add that sort of filter. Thank you for your heads up!
Author
Owner

@chrismast commented on GitHub (Nov 4, 2020):

@ciur thanks. Gmail introduced labels to replace folders a while ago. It seems though as in the IMAP protocol they are indeed treated as folders (see attached link).
Will try it tomorrow on my setup.

https://developers.google.com/gmail/imap/imap-extensions#:~:text=Gmail%20treats%20labels%20as%20folders,in%20the%20list%20of%20labels.

<!-- gh-comment-id:721799417 --> @chrismast commented on GitHub (Nov 4, 2020): @ciur thanks. Gmail introduced labels to replace folders a while ago. It seems though as in the IMAP protocol they are indeed treated as folders (see attached link). Will try it tomorrow on my setup. https://developers.google.com/gmail/imap/imap-extensions#:~:text=Gmail%20treats%20labels%20as%20folders,in%20the%20list%20of%20labels.
Author
Owner

@chrismast commented on GitHub (Nov 5, 2020):

@ciur
Did some testing with labels/folders in gmail and different setups of papermerge.config.py.
It is indeed confirmed that the mail secret it not used.
Further, I created a label called "Papermerge" and tried the following scenarios:

  • Kept variable as "Inbox" => all emails are marked as read and scrapped for files
  • Set variable to "Papermerge" => all emails are marked as read and scrapped for files
  • Set variable to "\Papermerge" => all emails are marked as read and scrapped for files, also Inbox folder once
  • Set variable to "\label\Papermerge" => no emails are scrapped, neither in Inbox nor in Papermerge label/folder
    Tried a few other combinations but neither worked.
    Let me know if I can help with testing somehow, happy to do so.
<!-- gh-comment-id:722072773 --> @chrismast commented on GitHub (Nov 5, 2020): @ciur Did some testing with labels/folders in gmail and different setups of papermerge.config.py. It is indeed confirmed that the mail secret it not used. Further, I created a label called "Papermerge" and tried the following scenarios: - Kept variable as "Inbox" => all emails are marked as read and scrapped for files - Set variable to "Papermerge" => all emails are marked as read and scrapped for files - Set variable to "\Papermerge" => all emails are marked as read and scrapped for files, also Inbox folder once - Set variable to "\label\Papermerge" => no emails are scrapped, neither in Inbox nor in Papermerge label/folder Tried a few other combinations but neither worked. Let me know if I can help with testing somehow, happy to do so.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/papermerge#160
No description provided.