Commit 008ba615 authored by Sebastian Kummer's avatar Sebastian Kummer

ZP-920 Changed KOE sendflags regexp to match all kinds of folder and

item ids, transform potential short folderid into a backendid before
passing it to IBackend->SendMail.

Released under the Affero GNU General Public License (AGPL) version 3. 
parent 37f038eb
......@@ -491,6 +491,7 @@ class BackendKopano implements IBackend, ISearchProvider {
if(isset($sm->source->itemid) && $sm->source->itemid) {
// answering an email in a public/shared folder
// TODO as the store is setup, we should actually user $this->store instead of $this->defaultstore - nevertheless we need to make sure this store is able to send mail (has an outbox)
if (!$this->Setup(ZPush::GetAdditionalSyncFolderStore($sm->source->folderid)))
throw new StatusException(sprintf("KopanoBackend->SendMail() could not Setup() the backend for folder id '%s'", $sm->source->folderid), SYNC_COMMONSTATUS_SERVERERROR);
......
......@@ -90,7 +90,7 @@ class SendMail extends RequestProcessor {
// KOE ZO-6: grep for the KOE header and set flags accordingly.
// The header has the values verb/message-source-key/folder-source-key
if (KOE_CAPABILITY_SENDFLAGS && preg_match("/X-Push-Flags: (\d{3})\/([\da-f]+)\/([\da-f]+)/i", $sm->mime, $ol_flags)) {
if (KOE_CAPABILITY_SENDFLAGS && preg_match("/X-Push-Flags: (\d{3})\/([a-z0-9:]+)\/([a-z0-9]+)/i", $sm->mime, $ol_flags)) {
// "reply" and "reply-all" are handled as "reply"
if ($ol_flags[1] == 102 || $ol_flags[1] == 103) {
$reply = true;
......@@ -124,7 +124,10 @@ class SendMail extends RequestProcessor {
if (isset($sm->source->folderid)) {
$sm->source->folderid = self::$deviceManager->GetBackendIdForFolderId($sm->source->folderid);
}
if (isset($sm->source->itemid)) {
list(, $sk) = MAPIUtils::SplitMessageId($sm->source->itemid);
$sm->source->itemid = $sk;
}
// replyflag and forward flags are actually only for the correct icon.
// Even if they are a part of SyncSendMail object, they won't be streamed.
if ($smartreply || $reply)
......
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