Commit 0a87b2a7 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 78e6812d
...@@ -2250,14 +2250,14 @@ class BackendIMAP extends BackendDiff implements ISearchProvider { ...@@ -2250,14 +2250,14 @@ class BackendIMAP extends BackendDiff implements ISearchProvider {
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 ) { if ( $epoch_sent === false ) {
$pattern1 = '/^(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]+)* [A-Z]+/'; $pattern1 = '/^(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]+)* [+-]+[0-9]+/';
$pattern2 = '/^(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]+)* [+-]+[0-9]+/'; $pattern2 = '/^(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($pattern1, $overview[0]->date, $matches) == 1) { if (preg_match($pattern1, $overview[0]->date, $matches) == 1) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->imap_inside_cutoffdate(): date: %s, match: %s", $overview[0]->date, $matches[0])); ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->imap_inside_cutoffdate(): date: %s, match: %s", $overview[0]->date, $matches[0]));
$epoch_sent = strtotime($matches[0].' UTC'); $epoch_sent = strtotime($matches[0]);
} else if (preg_match($pattern2, $overview[0]->date, $matches) == 1) { } else if (preg_match($pattern2, $overview[0]->date, $matches) == 1) {
ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->imap_inside_cutoffdate(): date: %s, match: %s", $overview[0]->date, $matches[0])); ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->imap_inside_cutoffdate(): date: %s, match: %s", $overview[0]->date, $matches[0]));
$epoch_sent = strtotime($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)); ZLog::Write(LOGLEVEL_DEBUG, sprintf("BackendIMAP->imap_inside_cutoffdate(): cutoffdate: %s, epoch_sent: %s", $cutoffdate, $epoch_sent));
......
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