remove invalid ...

This commit is contained in:
Andreas Knuth 2025-10-18 20:57:03 -05:00
parent 603299a2f7
commit 22ca7eb94b
1 changed files with 17 additions and 1 deletions

View File

@ -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);