diff --git a/app/Console/Commands/FetchEmails.php b/app/Console/Commands/FetchEmails.php index e3b14b6f6..25269d611 100644 --- a/app/Console/Commands/FetchEmails.php +++ b/app/Console/Commands/FetchEmails.php @@ -701,7 +701,7 @@ public function processMessage($message, $message_id, $mailbox, $mailboxes, $ext && !$user_id && !$is_reply && !$prev_thread // Only if the email has been sent to one mailbox. && count($to) == 1 && count($cc) == 0 - && preg_match("/^[\s]*".self::FWD_AS_CUSTOMER_COMMAND."/su", trim(strip_tags($body))) + && preg_match("/^[\s]*".self::FWD_AS_CUSTOMER_COMMAND."/su", strtolower(trim(strip_tags($body)))) ) { // Try to get "From:" from body. $original_sender = $this->getOriginalSenderFromFwd($body); @@ -871,7 +871,7 @@ public function getOriginalSenderFromFwd($body) // https://github.com/freescout-helpdesk/freescout/issues/2672 $body = preg_replace("/[\"']cid:/", '!', $body); // Cut out the command, otherwise it will be recognized as an email. - $body = preg_replace("/".self::FWD_AS_CUSTOMER_COMMAND."([\s<]+)/su", '$1', $body); + $body = preg_replace("/".self::FWD_AS_CUSTOMER_COMMAND."([\s<]+)/isu", '$1', $body); // Looks like email texts may appear in attributes: // https://github.com/freescout-helpdesk/freescout/issues/276