From 22ca7eb94bc8e86a08f6a90ff312c01895967eab Mon Sep 17 00:00:00 2001 From: Andreas Knuth Date: Sat, 18 Oct 2025 20:57:03 -0500 Subject: [PATCH] remove invalid ... --- app/lib/sync.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/app/lib/sync.ts b/app/lib/sync.ts index b655144..783e7cb 100644 --- a/app/lib/sync.ts +++ b/app/lib/sync.ts @@ -129,7 +129,23 @@ async function syncEmailsForDomainOptimized(domainId: number, bucket: string, s3 { retries: 3 } ); - allS3Keys.push(...(response.Contents?.map(obj => obj.Key!).filter(Boolean) || [])); + // Filtere Amazon SES System-Nachrichten und andere nicht-E-Mail-Objekte + const validKeys = response.Contents?.map(obj => obj.Key!) + .filter(key => { + // Filtere bekannte System-Nachrichten von Amazon SES + if (key === 'AMAZON_SES_SETUP_NOTIFICATION') { + console.log(`Skipping AWS system notification: ${key}`); + return false; + } + // Filtere andere potenzielle System-Dateien + if (key.startsWith('AMAZON_') || key.startsWith('.')) { + console.log(`Skipping system file: ${key}`); + return false; + } + return true; + }) || []; + + allS3Keys.push(...validKeys); continuationToken = response.NextContinuationToken; } while (continuationToken);