From 621158badcc7d9b23069fc1fe146f5b0805c89b9 Mon Sep 17 00:00:00 2001 From: alexm Date: Wed, 2 Nov 2022 15:11:36 +0100 Subject: [PATCH] fix(checkInbox): fix condition --- .../back/methods/worker-time-control-mail/checkInbox.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/modules/worker/back/methods/worker-time-control-mail/checkInbox.js b/modules/worker/back/methods/worker-time-control-mail/checkInbox.js index 3e64a985ab..5bb772cad3 100644 --- a/modules/worker/back/methods/worker-time-control-mail/checkInbox.js +++ b/modules/worker/back/methods/worker-time-control-mail/checkInbox.js @@ -58,8 +58,7 @@ module.exports = Self => { emailBody = bufferCopy.toUpperCase().trim(); const bodyPositionOK = emailBody.match(/\bOK\b/i); - const bodyPositionIndex = (bodyPositionOK.index == 0 || bodyPositionOK.index == 122); - if (bodyPositionOK != null && bodyPositionIndex) + if (bodyPositionOK != null && (bodyPositionOK.index == 0 || bodyPositionOK.index == 122)) isEmailOk = true; else isEmailOk = false; @@ -157,7 +156,7 @@ module.exports = Self => { let [user] = await Self.rawSql(`SELECT u.id,u.name FROM account.user u LEFT JOIN account.mailForward m on m.account = u.id - WHERE forwardTo =? OR + WHERE forwardTo =? OR CONCAT(u.name,'@verdnatura.es') = ?`, [userEmail[0], userEmail[0]]);