From 19a54b3b23d3e7a8e00f322562a0b50f6b99d056 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Mon, 22 Sep 2025 11:17:42 -0700 Subject: [PATCH] Feature: processed mail UI (#10866) --- docs/usage.md | 4 + .../manage/mail/mail.component.html | 22 +- .../manage/mail/mail.component.spec.ts | 9 + .../components/manage/mail/mail.component.ts | 9 + .../processed-mail-dialog.component.html | 107 +++++++ .../processed-mail-dialog.component.scss | 8 + .../processed-mail-dialog.component.spec.ts | 150 +++++++++ .../processed-mail-dialog.component.ts | 96 ++++++ src-ui/src/app/data/processed-mail.ts | 12 + .../src/app/services/permissions.service.ts | 1 + .../rest/processed-mail.service.spec.ts | 39 +++ .../services/rest/processed-mail.service.ts | 19 ++ src-ui/src/main.ts | 4 + src/paperless/urls.py | 2 + src/paperless_mail/filters.py | 12 + src/paperless_mail/serialisers.py | 18 ++ src/paperless_mail/tests/test_api.py | 284 ++++++++++++++++++ src/paperless_mail/views.py | 36 +++ 18 files changed, 824 insertions(+), 8 deletions(-) create mode 100644 src-ui/src/app/components/manage/mail/processed-mail-dialog/processed-mail-dialog.component.html create mode 100644 src-ui/src/app/components/manage/mail/processed-mail-dialog/processed-mail-dialog.component.scss create mode 100644 src-ui/src/app/components/manage/mail/processed-mail-dialog/processed-mail-dialog.component.spec.ts create mode 100644 src-ui/src/app/components/manage/mail/processed-mail-dialog/processed-mail-dialog.component.ts create mode 100644 src-ui/src/app/data/processed-mail.ts create mode 100644 src-ui/src/app/services/rest/processed-mail.service.spec.ts create mode 100644 src-ui/src/app/services/rest/processed-mail.service.ts create mode 100644 src/paperless_mail/filters.py diff --git a/docs/usage.md b/docs/usage.md index 94ef5ae1b..32441862d 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -261,6 +261,10 @@ different means. These are as follows: Paperless is set up to check your mails every 10 minutes. This can be configured via [`PAPERLESS_EMAIL_TASK_CRON`](configuration.md#PAPERLESS_EMAIL_TASK_CRON) +#### Processed Mail + +Paperless keeps track of emails it has processed in order to avoid processing the same mail multiple times. This uses the message `UID` provided by the mail server, which should be unique for each message. You can view and manage processed mails from the web UI under Mail > Processed Mails. If you need to re-process a message, you can delete the corresponding processed mail entry, which will allow Paperless-ngx to process the email again the next time the mail fetch task runs. + #### OAuth Email Setup Paperless-ngx supports OAuth2 authentication for Gmail and Outlook email accounts. To set up an email account with OAuth2, you will need to create a 'developer' app with the respective provider and obtain the client ID and client secret and set the appropriate [configuration variables](configuration.md#email_oauth). You will also need to set either [`PAPERLESS_OAUTH_CALLBACK_BASE_URL`](configuration.md#PAPERLESS_OAUTH_CALLBACK_BASE_URL) or [`PAPERLESS_URL`](configuration.md#PAPERLESS_URL) to the correct value for the OAuth2 flow to work correctly. diff --git a/src-ui/src/app/components/manage/mail/mail.component.html b/src-ui/src/app/components/manage/mail/mail.component.html index 16e8e88fb..97b2bf507 100644 --- a/src-ui/src/app/components/manage/mail/mail.component.html +++ b/src-ui/src/app/components/manage/mail/mail.component.html @@ -109,10 +109,11 @@