From fd4e7ac4466593605c18b1b5fab4f76db5326520 Mon Sep 17 00:00:00 2001 From: Elizabeth Hunt Date: Mon, 18 Aug 2025 11:00:23 -0700 Subject: Use From: and To: headers like a sane person --- lib/email.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/email.ts') diff --git a/lib/email.ts b/lib/email.ts index 38beb0c..d889900 100644 --- a/lib/email.ts +++ b/lib/email.ts @@ -118,7 +118,7 @@ export class Inbox { public async close() { await this.recv.mailboxClose().then(() => this.recv.logout()); this.lock!.peek((l) => l.get().release()) - .peek(t => t.trace.trace(Inbox.Metrics.LOCK)) + .peek((t) => t.trace.trace(Inbox.Metrics.LOCK)) .peek((res) => res.trace.traceScope(LogLevel.INFO).trace('Released lock')) .get(); delete this.lock; @@ -185,8 +185,8 @@ export class Inbox { const subjectMatches = email.subject === message.envelope?.subject; const bodyMatches = message.bodyParts?.get('text')?.toString().trim() === email.text.trim(); const headers = message.headers?.toLocaleString(); - const fromMatches = headers?.includes(`Return-Path: <${email.from}>`); - const toMatches = headers?.includes(`Delivered-To: ${email.to}`); + const fromMatches = headers?.includes(`From: ${email.from}`); + const toMatches = headers?.includes(`To: ${email.to}`); return subjectMatches && bodyMatches && fromMatches && toMatches; } -- cgit v1.2.3-70-g09d2