-
Notifications
You must be signed in to change notification settings - Fork 503
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
4f253bf
commit 61e5f1f
Showing
1 changed file
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -623,7 +623,6 @@ public function processMessage($message, $message_id, $mailbox, $mailboxes, $ext | |
$body = $message->getTextBody() ?? ''; | ||
$body = htmlspecialchars($body); | ||
} | ||
$body = $this->separateReply($body, $is_html, $is_reply, !$message_from_customer, (($message_from_customer && $prev_thread) ? $prev_thread->getMessageId($mailbox) : '')); | ||
|
||
// We have to fetch absolutely all emails, even with empty body. | ||
// if (!$body) { | ||
|
@@ -646,7 +645,7 @@ public function processMessage($message, $message_id, $mailbox, $mailboxes, $ext | |
|
||
// It will always return an empty value as it's Bcc. | ||
$bcc = $this->formatEmailList($message->getBcc()); | ||
|
||
// If existing user forwarded customer's email to the mailbox | ||
// we are creating a new conversation as if it was sent by the customer. | ||
if ($in_reply_to | ||
|
@@ -683,6 +682,12 @@ public function processMessage($message, $message_id, $mailbox, $mailboxes, $ext | |
} | ||
} | ||
|
||
// separateReply() function may distort original HTML if email | ||
// is mentioned as <[email protected]> and it will interpret it as a tag. | ||
// https://github.com/freescout-helpdesk/freescout/issues/4036 | ||
|
||
$body = $this->separateReply($body, $is_html, $is_reply, !$message_from_customer, (($message_from_customer && $prev_thread) ? $prev_thread->getMessageId($mailbox) : '')); | ||
|
||
// Create customers | ||
$emails = array_merge( | ||
$this->attrToArray($message->getFrom()), | ||
|
@@ -839,6 +844,7 @@ public function getOriginalSenderFromFwd($body) | |
$email = $b[1] ?? ''; | ||
// https://github.com/freescout-helpdesk/freescout/issues/2517 | ||
$email = preg_replace("#.*<(.*)>.*#", "$1", $email); | ||
return Email::sanitizeEmail($email); | ||
} | ||
|