feat: delete archived emails + improve IMAP UID and PDF parsing #299

Closed
opened 2026-04-05 16:17:19 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @tilwegener on 8/14/2025

Summary

This PR adds a complete feature for deleting emails from the archive, as well as improvements to email ingestion reliability and error handling.


Feature: Delete Archived Emails #27

Backend

  • Introduced a dedicated API endpoint and controller handler to remove archived emails.
  • Implemented service logic to:
    • Delete the email record.
    • Remove associated attachments.
    • Purge related entries from the MeiliSearch index.
    • Conditionally delete shared attachments if no other emails reference them.

Frontend

  • Added a delete action with confirmation dialog in the archived-email view.
  • After successful deletion:
    • Redirects the user back to the archived email list.
    • Calls invalidateAll to refresh the list so the deleted email no longer appears.

🛠 Improvements & Fixes: Email Ingestion

  • IMAP UID range handling
    • Updated the IMAP connector to always determine the latest UID in a mailbox.
    • Iterates through all UID ranges up to that value, preventing premature termination when there are gaps in message UIDs.
  • PDF-to-JSON failure handling
    • Avoids hanging when pdf2json fails by resolving text extraction with an empty string.
    • Added debug logging in the IMAP connector to trace each message’s UID and capture parse failures, making it easier to identify which email causes an import error.
*Originally created by @tilwegener on 8/14/2025* ## Summary This PR adds a complete feature for deleting emails from the archive, as well as improvements to email ingestion reliability and error handling. --- ### ✨ Feature: Delete Archived Emails #27 #### Backend - Introduced a dedicated API endpoint and controller handler to remove archived emails. - Implemented service logic to: - Delete the email record. - Remove associated attachments. - Purge related entries from the MeiliSearch index. - Conditionally delete shared attachments if no other emails reference them. #### Frontend - Added a delete action with confirmation dialog in the archived-email view. - After successful deletion: - Redirects the user back to the archived email list. - Calls `invalidateAll` to refresh the list so the deleted email no longer appears. --- ### 🛠 Improvements & Fixes: Email Ingestion - **IMAP UID range handling** - Updated the IMAP connector to always determine the latest UID in a mailbox. - Iterates through all UID ranges up to that value, preventing premature termination when there are gaps in message UIDs. - **PDF-to-JSON failure handling** - Avoids hanging when `pdf2json` fails by resolving text extraction with an empty string. - Added debug logging in the IMAP connector to trace each message’s UID and capture parse failures, making it easier to identify which email causes an import error.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OpenArchiver#299