Skip to content

Commit f8994ae

Browse files
committed
fix: add trailing slash to IMAP folder path to prevent name collision
Without the separator, emails in folder 'مجلد' were stored as 'مجلدID.eml' instead of 'مجلد/ID.eml'.
1 parent 0c42b30 commit f8994ae

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/backend/src/services/IngestionService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ export class IngestionService {
575575
return null;
576576
}
577577

578-
const sanitizedPath = email.path ? email.path : '';
578+
const sanitizedPath = email.path ? email.path.replace(/\/?$/, '/') : '';
579579
// Use effectiveSource (root) for storage path and DB ownership.
580580
// Child sources are assistants; all content physically belongs to the root.
581581
const emailPath = `${config.storage.openArchiverFolderName}/${effectiveSource.name.replaceAll(' ', '-')}-${effectiveSource.id}/emails/${sanitizedPath}${email.id}.eml`;

0 commit comments

Comments
 (0)