[PR #303] [MERGED] Fix/mail import rw access check #577

Closed
opened 2026-02-25 21:32:18 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ciur/papermerge/pull/303
Author: @napcae
Created: 2/13/2021
Status: Merged
Merged: 2/14/2021
Merged by: @ciur

Base: stable/1.5.xHead: fix/MailImportRWAccessCheck


📝 Commits (3)

  • b2ac54f add error message for missing read/write permissions in imap folder
  • 357c9e6 modify documentation to reflect changes: read/write permission is
  • 33c18df remove unused imapclient.exception import

📊 Changes

2 files changed (+10 additions, -3 deletions)

View changed files

📝 docs/source/settings.rst (+2 -2)
📝 papermerge/core/importers/imap.py (+8 -1)

📄 Description

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context, providing screenshots where practical. List any dependencies that are required for this change.

Fixes #302

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • This change requires a documentation update
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How Has This Been Tested?

Create a read-only app user in the Fastmail web interface. Set IMAP import config:

IMPORT_MAIL_HOST="imap.fastmail.com"
IMPORT_MAIL_USER="*redacted*"
IMPORT_MAIL_PASS="*redacted*"
IMPORT_MAIL_INBOX="papermerge"
  • Test it by starting the worker, an error message should appear. No new documents are imported.
papermerge_worker | [2021-02-13 19:55:08,258: DEBUG/ForkPoolWorker-2] Celery beat: import_from_email
papermerge_worker | [2021-02-13 19:55:08,889: ERROR/ForkPoolWorker-2] IMAP import: Failed to select folder with read-write permissions. The user "*redacted*" needs read write access to the folder "papermerge".
papermerge_worker | [2021-02-13 19:55:09,095: DEBUG/ForkPoolWorker-2] IMAP Import: UNSEEN messages 1 count

Test Configuration:

  • Python version: 3.7
  • OS version Docker

Checklist:

  • I have read the Contributing file available here
  • I have formatted this PR according to PEP8 rules
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ciur/papermerge/pull/303 **Author:** [@napcae](https://github.com/napcae) **Created:** 2/13/2021 **Status:** ✅ Merged **Merged:** 2/14/2021 **Merged by:** [@ciur](https://github.com/ciur) **Base:** `stable/1.5.x` ← **Head:** `fix/MailImportRWAccessCheck` --- ### 📝 Commits (3) - [`b2ac54f`](https://github.com/ciur/papermerge/commit/b2ac54f0adbbadf2465b5f7f7c998012645c9cb8) add error message for missing read/write permissions in imap folder - [`357c9e6`](https://github.com/ciur/papermerge/commit/357c9e6db409d1b23ae95d0b1bfa25246ddb71cf) modify documentation to reflect changes: read/write permission is - [`33c18df`](https://github.com/ciur/papermerge/commit/33c18dfa6885504f6e4c353b1ae8d776f03b5481) remove unused imapclient.exception import ### 📊 Changes **2 files changed** (+10 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `docs/source/settings.rst` (+2 -2) 📝 `papermerge/core/importers/imap.py` (+8 -1) </details> ### 📄 Description # Description Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context, providing screenshots where practical. List any dependencies that are required for this change. Fixes #302 ## Type of change Please delete options that are not relevant. - [x] Bug fix (non-breaking change which fixes an issue) - [x] This change requires a documentation update - [x] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) # How Has This Been Tested? Create a read-only app user in the Fastmail web interface. Set IMAP import config: ``` IMPORT_MAIL_HOST="imap.fastmail.com" IMPORT_MAIL_USER="*redacted*" IMPORT_MAIL_PASS="*redacted*" IMPORT_MAIL_INBOX="papermerge" ``` - [x] Test it by starting the worker, an error message should appear. No new documents are imported. ``` papermerge_worker | [2021-02-13 19:55:08,258: DEBUG/ForkPoolWorker-2] Celery beat: import_from_email papermerge_worker | [2021-02-13 19:55:08,889: ERROR/ForkPoolWorker-2] IMAP import: Failed to select folder with read-write permissions. The user "*redacted*" needs read write access to the folder "papermerge". papermerge_worker | [2021-02-13 19:55:09,095: DEBUG/ForkPoolWorker-2] IMAP Import: UNSEEN messages 1 count ``` **Test Configuration**: * Python version: 3.7 * OS version Docker # Checklist: - [x] I have read the [Contributing file available here](https://github.com/ciur/papermerge/blob/master/CONTRIBUTING.md) - [x] I have formatted this PR according to [PEP8 rules](https://www.python.org/dev/peps/pep-0008/) - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [x] New and existing unit tests pass locally with my changes --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 21:32:18 +03:00
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#577
No description provided.