-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve fetching email in Show Original window - closes #3658
- Loading branch information
1 parent
c55d94d
commit b2dae09
Showing
2 changed files
with
12 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -733,6 +733,11 @@ public static function fetchMessage($mailbox, $message_id, $message_date = null) | |
foreach ($imap_folders as $folder_name) { | ||
try { | ||
$folder = self::getImapFolder($client, $folder_name); | ||
|
||
if (!$folder) { | ||
\Log::error('('.$mailbox->name.') Show Original - folder not found: '.$folder_name); | ||
continue; | ||
} | ||
// Message-ID: <[email protected]> | ||
$query = $folder->query() | ||
->text('<'.$message_id.'>') | ||
|
@@ -763,7 +768,7 @@ public static function fetchMessage($mailbox, $message_id, $message_date = null) | |
$query = $folder->query()->text('<'.$message_id.'>')->leaveUnread()->limit(1)->setCharset(null); | ||
if ($message_date) { | ||
$query->since($message_date->subDays(7)); | ||
$query->before($message_date->addDays(7)); | ||
$query->before($message_date->addDays(14)); | ||
} | ||
$messages = $query->get(); | ||
$no_charset = true; | ||
|
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