This commit is contained in:
Leandro Facchinetti 2020-12-07 22:56:00 +00:00
parent ab543e302a
commit 640fbef200
1 changed files with 3 additions and 1 deletions

View File

@ -89,7 +89,9 @@ export const emailServer = new SMTPServer({
const email = await mailparser.simpleParser(stream); const email = await mailparser.simpleParser(stream);
const content = const content =
typeof email.html === "string" ? email.html : email.textAsHtml ?? ""; typeof email.html === "string" ? email.html : email.textAsHtml ?? "";
for (const { address } of session.envelope.rcptTo) { for (const address of new Set(
session.envelope.rcptTo.map(({ address }) => address)
)) {
const match = address.match( const match = address.match(
new RegExp(`^(?<identifier>\\w+)@${R(EMAIL_DOMAIN)}$`) new RegExp(`^(?<identifier>\\w+)@${R(EMAIL_DOMAIN)}$`)
); );