Skip to content

Commit 1976316

Browse files
committed
fix: update regexes to allow hyphens and underscores when extracting IDs from SMTP bounce emails.
1 parent e7b3a97 commit 1976316

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/features/payload-cms/payload-cms/tasks/fetch-smtp-bounces.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,16 +348,16 @@ export const fetchSmtpBouncesTask: TaskConfig<'fetchSmtpBounces'> = {
348348
extractMatches(messageIdRegex, rawEmailString);
349349
extractMatches(messageIdRegex, textForRegex);
350350

351-
const queuedRegex = /queued as\s*([a-zA-Z0-9]+)/gi;
351+
const queuedRegex = /queued as\s*([a-zA-Z0-9_-]+)/gi;
352352
extractMatches(queuedRegex, rawEmailString);
353353
extractMatches(queuedRegex, textForRegex);
354354

355-
const postfixRegex = /X-Postfix-Queue-ID:\s*([a-zA-Z0-9]+)/gi;
355+
const postfixRegex = /X-Postfix-Queue-ID:\s*([a-zA-Z0-9_-]+)/gi;
356356
extractMatches(postfixRegex, rawEmailString);
357357
extractMatches(postfixRegex, textForRegex);
358358

359359
// Also check the Received header that contains the Queue ID before sending
360-
const receivedRegex = /with ESMTPSA id\s*([a-zA-Z0-9]+)/gi;
360+
const receivedRegex = /with ESMTPSA id\s*([a-zA-Z0-9_-]+)/gi;
361361
extractMatches(receivedRegex, rawEmailString);
362362

363363
const extractedIds = [...possibleIds];

0 commit comments

Comments
 (0)