Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F117915067
D5193.1775404741.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
2 KB
Referenced Files
None
Subscribers
None
D5193.1775404741.diff
View Options
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);
+ }
+
+ private 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;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 5, 3:59 PM (11 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18833847
Default Alt Text
D5193.1775404741.diff (2 KB)
Attached To
Mode
D5193: Force default folders to be always subscribed
Attached
Detach File
Event Timeline