Page MenuHomePhorge

D5193.1775401870.diff
No OneTemporary

Authored By
Unknown
Size
3 KB
Referenced Files
None
Subscribers
None

D5193.1775401870.diff

diff --git a/config/config.inc.php.dist b/config/config.inc.php.dist
--- a/config/config.inc.php.dist
+++ b/config/config.inc.php.dist
@@ -119,3 +119,8 @@
// Enables adding sender name in the From: header of send email
// when a device uses email address only (e.g. iOS devices)
$config['activesync_fix_from'] = false;
+
+// Force a subscription state per folder
+// The following configuration is recommended for Outlook.
+// States can be: 0 => not subscribed, 1 => subscribed, 2 => subscribed with alarm
+$config['activesync_force_subscription_state'] = ['INBOX' => 1, 'Sent' => 1, 'Trash' => 1, 'Calendar' => 1, 'Contacts' => 1, 'Tasks' => 1];
diff --git a/lib/kolab_sync_storage.php b/lib/kolab_sync_storage.php
--- a/lib/kolab_sync_storage.php
+++ b/lib/kolab_sync_storage.php
@@ -59,6 +59,7 @@
protected $relationSupport = [self::MODEL_TASKS, self::MODEL_NOTES, self::MODEL_EMAIL];
protected $tag_rts = [];
private $modseq = [];
+ private $protectedFolders = null;
protected static $instance;
@@ -175,9 +176,7 @@
// check if folders are "subscribed" for activesync
foreach ($folderdata as $folder => $meta) {
- if (empty($meta['FOLDER']) || empty($meta['FOLDER'][$deviceid])
- || empty($meta['FOLDER'][$deviceid]['S'])
- ) {
+ if (!$this->is_subscribed($deviceid, $folder, $meta)) {
continue;
}
@@ -1872,6 +1871,27 @@
return $this->folder_uids[$name] = $uid;
}
+ private function is_protected($folder)
+ {
+ if ($this->protectedFolders === null) {
+ $this->protectedFolders = rcube::get_instance()->config->get('activesync_force_subscription_state', []);
+ }
+ return array_key_exists($folder, $this->protectedFolders);
+ }
+
+ protected function is_subscribed($deviceid, $folder, $meta)
+ {
+ if ($this->is_protected($folder)) {
+ return true;
+ }
+ if (empty($meta['FOLDER']) || empty($meta['FOLDER'][$deviceid])
+ || empty($meta['FOLDER'][$deviceid]['S'])
+ ) {
+ return false;
+ }
+ return true;
+ }
+
/**
* Returns IMAP folder name
*
@@ -1915,9 +1935,7 @@
// check if folders are "subscribed" for activesync
foreach ($folderdata as $folder => $meta) {
- if (empty($meta['FOLDER']) || empty($meta['FOLDER'][$deviceid])
- || empty($meta['FOLDER'][$deviceid]['S'])
- ) {
+ if (!$this->is_subscribed($deviceid, $folder, $meta)) {
continue;
}
diff --git a/lib/kolab_sync_storage_kolab4.php b/lib/kolab_sync_storage_kolab4.php
--- a/lib/kolab_sync_storage_kolab4.php
+++ b/lib/kolab_sync_storage_kolab4.php
@@ -111,9 +111,7 @@
// Get the folders "subscribed" for activesync
foreach ($folderdata as $folder => $meta) {
- if (empty($meta['FOLDER']) || empty($meta['FOLDER'][$deviceid])
- || empty($meta['FOLDER'][$deviceid]['S'])
- ) {
+ if (!$this->is_subscribed($deviceid, $folder, $meta)) {
continue;
}
@@ -448,9 +446,7 @@
// check if folders are "subscribed" for activesync
foreach ($folderdata as $folder => $meta) {
- if (empty($meta['FOLDER']) || empty($meta['FOLDER'][$deviceid])
- || empty($meta['FOLDER'][$deviceid]['S'])
- ) {
+ if (!$this->is_subscribed($deviceid, $folder, $meta)) {
continue;
}

File Metadata

Mime Type
text/plain
Expires
Sun, Apr 5, 3:11 PM (7 h, 25 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18833742
Default Alt Text
D5193.1775401870.diff (3 KB)

Event Timeline