Fixed Email ID <> Invalid Key Error #142

Open
opened 2026-04-05 16:16:43 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @Farid046 on 10/22/2025

Hey :) Following error occurs when running IMAP Connections and trying to use s3 storage buckets.

[0] [0] message: "Failed to process email 202502281CENSORED@CENSORED.fr for source CENSORED-e105-4064-bab4"
[0] [0] error: {
[0] [0] "name": "InvalidKey",
[0] [0] "Code": "InvalidKey",
[0] [0] "message": "Invalid key: open-archiver/CENSORED@CENSORED.de-CENSORED-e105-4064-bab4emails/INBOX202502281CENSORED@CENSORED.fr.eml"
[0] [0] [11:08:35.647] ERROR (288):

Here is the Fix for that:

/app/packages/backend/dist/services/IngestionService.js

change from:
const emailPath = ${index_1.config.storage.openArchiverFolderName}/${source.name.replaceAll(' ', '-')}-${source.id}/emails/${sanitizedPath}${email.id}.eml;

to:
const emailPath = ${index_1.config.storage.openArchiverFolderName}/${source.name.replaceAll(" ", "-")}-${source.id}/emails/${sanitizedPath}${email.id.replace(/[<>\[\]]/g, "")}.eml;

*Originally created by @Farid046 on 10/22/2025* Hey :) Following error occurs when running IMAP Connections and trying to use s3 storage buckets. [0] [0] message: "Failed to process email <202502281CENSORED@CENSORED.fr> for source CENSORED-e105-4064-bab4" [0] [0] error: { [0] [0] "name": "InvalidKey", [0] [0] "Code": "InvalidKey", [0] [0] "message": "Invalid key: open-archiver/CENSORED@CENSORED.de-CENSORED-e105-4064-bab4emails/INBOX<202502281CENSORED@CENSORED.fr>.eml" [0] [0] [11:08:35.647] ERROR (288): Here is the Fix for that: /app/packages/backend/dist/services/IngestionService.js change from: const emailPath = `${index_1.config.storage.openArchiverFolderName}/${source.name.replaceAll(' ', '-')}-${source.id}/emails/${sanitizedPath}${email.id}.eml`; to: const emailPath = `${index_1.config.storage.openArchiverFolderName}/${source.name.replaceAll(" ", "-")}-${source.id}/emails/${sanitizedPath}${email.id.replace(/[<>\[\]]/g, "")}.eml`;
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/OpenArchiver#142