Skip to content

Commit

Permalink
Send a dummy OUTBOX folder to work around broken clients.
Browse files Browse the repository at this point in the history
Some client evidently try to synchronize the Outbox, even when
no such folder is sent via the FOLDERSYNC response. Try to avoid
this issue by sending a mailbox with the SPECIAL_OUTBOX indicator.
  • Loading branch information
mrubinsk committed Feb 17, 2016
1 parent 5fc9495 commit 80a2682
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion framework/Core/lib/Horde/Core/ActiveSync/Driver.php
Expand Up @@ -1114,7 +1114,8 @@ public function getServerChanges(
break;

case Horde_ActiveSync::CLASS_EMAIL:
if (empty($this->_imap)) {
if (empty($this->_imap) ||
$folder->serverid() == 'OUTBOX') {
$this->_endBuffer();
return array();
}
Expand Down Expand Up @@ -1814,6 +1815,12 @@ public function changeMessage($folderid, $id, Horde_ActiveSync_Message_Base $mes
$this->_pid,
$folderid,
$id));

// Short circuit OUTBOX modifications to work around broken clients.
if ($folderid == 'OUTBOX') {
return false;
}

ob_start();

$folder_split = $this->_parseFolderId($folderid);
Expand Down Expand Up @@ -3088,6 +3095,9 @@ protected function _getMailFolders()
++$level;
}

// Fake Outbox for broken clients.
$folders[] = $this->_buildDummyFolder(self::SPECIAL_OUTBOX);

$this->_mailFolders = $folders;
}
}
Expand Down

0 comments on commit 80a2682

Please sign in to comment.