diff --git a/server/email.js b/server/email.js index 205a0c28..bf7deb3f 100644 --- a/server/email.js +++ b/server/email.js @@ -41,7 +41,7 @@ export async function handleIncomingEmails() { console.log("New email found"); const emailFrom = await simpleParser(emailBody); const user = await User.findOne({ - email: emailFrom?.from?.value?.[0]?.address, + email: { $regex: new RegExp(emailFrom?.from?.value?.[0]?.address, "i") }, }); if (user && emailBody) { const attachments = emailFrom.attachments;