Commit 92bde207 authored by YANO Takashi's avatar YANO Takashi

ZP-1167 Some new messages are outdated and lost when sync. Released under the...

ZP-1167 Some new messages are outdated and lost when sync.  Released under the Affero GNU General Public License (AGPL) version 3.
parent affb95a8
...@@ -2249,6 +2249,14 @@ class BackendIMAP extends BackendDiff implements ISearchProvider { ...@@ -2249,6 +2249,14 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
if (is_array($overview)) { if (is_array($overview)) {
if (isset($overview[0]->date)) { if (isset($overview[0]->date)) {
$epoch_sent = strtotime($overview[0]->date); $epoch_sent = strtotime($overview[0]->date);
if ( $epoch_sent === false ) {
$pattern = '/^(Sun|Mon|Tue|Wed|Thu|Fri|Sat), [0-9]+ (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) [0-9]+ [0-9]+:[0-9]+(:[0-9]+)* /';
if (preg_match($pattern, $overview[0]->date, $matches) == 1) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->imap_inside_cutoffdate(): date: %s, match: %s", $overview[0]->date, $matches[0]));
$epoch_sent = strtotime($matches[0].' UTC');
}
}
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->imap_inside_cutoffdate(): cutoffdate: %s, epoch_sent: %s", $cutoffdate, $epoch_sent));
$is_inside = ($cutoffdate <= $epoch_sent); $is_inside = ($cutoffdate <= $epoch_sent);
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->imap_inside_cutoffdate(): Message is %s cutoffdate range", ($is_inside ? "INSIDE" : "OUTSIDE"))); ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->imap_inside_cutoffdate(): Message is %s cutoffdate range", ($is_inside ? "INSIDE" : "OUTSIDE")));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment