Summary | ActiveSync : auto detection of special folders (trash, sent, etc...) and hierarchy fails |
Queue | Synchronization |
Queue Version | Git master |
Type | Bug |
State | Not A Bug |
Priority | 1. Low |
Owners | mrubinsk (at) horde (dot) org |
Requester | ryu (at) ryux (dot) org |
Created | 11/02/2012 (4617 days ago) |
Due | |
Updated | 08/15/2013 (4331 days ago) |
Assigned | 01/10/2013 (4548 days ago) |
Resolved | 01/23/2013 (4535 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | No |
There are two seperate problems: One is not recognizing the drafts folder,
I've analyzed the WBXML stream, compared to z-push and so on.
Everything looked correct, even the $folder->type is set properly. Crap.
Apple support article on this:
http://support.apple.com/kb/HT2124
There are two seperate problems: One is not recognizing the drafts folder,
start sending "dummy" folder ids to the client because then we will
have to worry about adding logic that would handle/ignore
synchronization requests for those folders - and have to explain to
users why there is a trash folder on the client that doesn't match the
contents of a trash folder on the server etc...
There are two seperate problems: One is not recognizing the drafts folder,
the other is message deletion handling on iOS.
(tested on iOS 6.x and iOS 4.2.1 and Windows phone 8)
My imp setup is without a trash folder, I delete messages directly.
imp shows all special mailboxes with the correct icon.
When I configure a trash folder in imp, the trash folder
is also recognized on the iOS device. Without a trash folder though
iOS is unable to delete any message (it does not even send a
SYNC_REMOVE request)
and complains it can't move the message to the trash (=there is none).
I'll test if sending a dummy trash folder to the iOS device will satisfy it.
Unfortunately there is no way on the iOS device to configure
the DELETESASMOVES stuff. Grrr.
State ⇒ Not A Bug
you will need to figure out why the unit test fails on your install,
and not on any other.
iOS local, folder than my server Drafts folder.
No draft folder detected although it is well passed in sync of
folders. (in ActiveSync Horde log)
iOS local, folder than my server Drafts folder.
Still, this doesn't explain why the test case passes for me but not the OP.
draft folder detected although it is well passed in sync of folders.
(in ActiveSync Horde log)
Ryu
Draft or draft + spams ?
folder as far as EAS is concerned.
problem... All folders (sent and trash) are ok except drafts (and
spams of course)...
with her iphone.
Draft or draft + spams ?
I just reset my device, an ipad on ios 6.0.2 and it is the same
problem... All folders (sent and trash) are ok except drafts (and
spams of course)...
Mine are running IOS 6.0.2.
Draft folder is not recognized in ios whereas its type is well sent.
Here is a part of my sync log :
2013-01-11T08:53:13+00:00 DEBUG: O <FolderHierarchy:Add>
2013-01-11T08:53:13+00:00 DEBUG: O <FolderHierarchy:ServerEntryId>
2013-01-11T08:53:13+00:00 DEBUG: O INBOX.Drafts
2013-01-11T08:53:13+00:00 DEBUG: O <FolderHierarchy:ServerEntryId/>
2013-01-11T08:53:13+00:00 DEBUG: O <FolderHierarchy:ParentId>
2013-01-11T08:53:13+00:00 DEBUG: O 0
2013-01-11T08:53:13+00:00 DEBUG: O <FolderHierarchy:ParentId/>
2013-01-11T08:53:13+00:00 DEBUG: O <FolderHierarchy:DisplayName>
2013-01-11T08:53:13+00:00 DEBUG: O Brouillons
2013-01-11T08:53:13+00:00 DEBUG: O <FolderHierarchy:DisplayName/>
2013-01-11T08:53:13+00:00 DEBUG: O <FolderHierarchy:Type>
2013-01-11T08:53:13+00:00 DEBUG: O 3
2013-01-11T08:53:13+00:00 DEBUG: O <FolderHierarchy:Type/>
2013-01-11T08:53:13+00:00 DEBUG: O <FolderHierarchy:Add/>
The folder type "3" *is* the type of draft folder... But even with
this, ios does not match it.
For Templates, Spams (Junks), I think it is not in the ActiveSync
protocol types list
See
http://msdn.microsoft.com/en-us/library/gg650877%28v=exchg.80%29.aspx
for full types list
and
http://msdn.microsoft.com/en-us/library/jj572420%28v=exchg.140%29.aspx
for an example
So for me, all is ok for Horde
Ryu.
./ActiveSyncTests.php
PHPUnit 3.7.10 by Sebastian Bergmann.
Configuration read from /usr/share/php/test/Horde_Core/Horde/Core/phpunit.xml
F
Time: 0 seconds, Memory: 5.25Mb
There was 1 failure:
1) Horde_Core_ActiveSyncTests::testGetFolders
Missing Draft
/usr/share/php/test/Horde_Core/Horde/Core/ActiveSyncTests.php:103
FAILURES!
Tests: 1, Assertions: 0, Failures: 1.
root@mail:/usr/share/php/test/Horde_Core/Horde/Core#
Declaration of
Mock_Horde_Core_ActiveSync_Connector_495a72a1::calendar_import_vevent()
should be compatible with
Horde_Core_ActiveSync_Connector::calendar_import_vevent(Horde_Icalendar_vEvent
$vEvent)
doesn't work when mocking. It works locally, since it's in my php
include path. Guess I need to stub that object as well.
properly. When connecting the IOS device through IMAP, it shows the
special folders.
2. The test from PHP shell
$f = new Horde_Core_ActiveSync_Imap_Factory();
var_dump($f->getMailboxes());
======================
array (size=5)
'INBOX' =>
array (size=5)
'a' => int 40
'd' => string '.' (length=1)
'label' => string 'Inbox' (length=5)
'level' => int 0
'ob' =>
object(Horde_Imap_Client_Mailbox)[231]
protected '_utf7imap' => null
protected '_utf8' => string 'INBOX' (length=5)
'Draft' =>
array (size=5)
'a' => int 8
'd' => string '.' (length=1)
'label' => string 'Drafts' (length=6)
'level' => int 0
'ob' =>
object(Horde_Imap_Client_Mailbox)[232]
protected '_utf7imap' => null
protected '_utf8' => string 'Draft' (length=5)
'Sent' =>
array (size=5)
'a' => int 8
'd' => string '.' (length=1)
'label' => string 'Sent' (length=4)
'level' => int 0
'ob' =>
object(Horde_Imap_Client_Mailbox)[233]
protected '_utf7imap' => null
protected '_utf8' => string 'Sent' (length=4)
'Spam' =>
array (size=5)
'a' => int 8
'd' => string '.' (length=1)
'label' => string 'Spam' (length=4)
'level' => int 0
'ob' =>
object(Horde_Imap_Client_Mailbox)[234]
protected '_utf7imap' => null
protected '_utf8' => string 'Spam' (length=4)
'Trash' =>
array (size=5)
'a' => int 8
'd' => string '.' (length=1)
'label' => string 'Trash' (length=5)
'level' => int 0
'ob' =>
object(Horde_Imap_Client_Mailbox)[235]
protected '_utf7imap' => null
protected '_utf8' => string 'Trash' (length=5)
=====================
3. The ActiveSyncTests result:
============================
root@mail:/usr/share/php/test/Horde_Core/Horde/Core# phpunit
ActiveSyncTests.php
PHPUnit 3.7.10 by Sebastian Bergmann.
Configuration read from /usr/share/php/test/Horde_Core/Horde/Core/phpunit.xml
E
Time: 0 seconds, Memory: 4.75Mb
There was 1 error:
1) Horde_Core_ActiveSyncTests::testGetFolders
Declaration of
Mock_Horde_Core_ActiveSync_Connector_495a72a1::calendar_import_vevent() should
be compatible with
Horde_Core_ActiveSync_Connector::calendar_import_vevent(Horde_Icalendar_vEvent
$vEvent)
/usr/share/php/Horde/Test/Case.php:37
/usr/share/php/test/Horde_Core/Horde/Core/ActiveSyncTests.php:68
FAILURES!
Tests: 1, Assertions: 0, Errors: 1.
========================
$f = new Horde_Core_ActiveSync_Imap_Factory();
var_dump($f->getMailboxes());
PHPUnit 3.5.10 by Sebastian Bergmann.
.
Time: 0 seconds, Memory: 11.25Mb
OK (1 test, 12 assertions)
Are you sure you are subscribed to the "Draft" folder?
The other folders not showing as "special" do not have special status
in ActiveSync.
commit dea336a6745523a2b37fb54b419479575149181a
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Thu Jan 10 11:50:09 2013 -0500
(Passing) ActiveSync test for
Bug: 11626framework/Core/package.xml | 8 +-
framework/Core/test/Horde/Core/ActiveSyncTests.php | 131
++++++++++++++++++++
2 files changed, 136 insertions(+), 3 deletions(-)
http://git.horde.org/horde-git/-/commit/dea336a6745523a2b37fb54b419479575149181a
following:
var_dump($GLOBALS['registry']->mail->getSpecialMailboxes());
and post the results.
This server below is running PHP 5.3 also show the same symptoms:
array(6) {
["composetemplates"]=>
object(IMP_Mailbox)#194 (4) {
["_cache":protected]=>
array(0) {
}
["_changed":protected]=>
int(0)
["_import":protected]=>
NULL
["_mbox":protected]=>
string(9) "Templates"
}
["drafts"]=>
object(IMP_Mailbox)#196 (4) {
["_cache":protected]=>
array(0) {
}
["_changed":protected]=>
int(0)
["_import":protected]=>
NULL
["_mbox":protected]=>
string(5) "Draft"
}
["sent"]=>
array(1) {
[0]=>
object(IMP_Mailbox)#211 (4) {
["_cache":protected]=>
array(0) {
}
["_changed":protected]=>
int(0)
["_import":protected]=>
NULL
["_mbox":protected]=>
string(4) "Sent"
}
}
["spam"]=>
object(IMP_Mailbox)#201 (4) {
["_cache":protected]=>
array(0) {
}
["_changed":protected]=>
int(0)
["_import":protected]=>
NULL
["_mbox":protected]=>
string(4) "Spam"
}
["trash"]=>
object(IMP_Mailbox)#199 (4) {
["_cache":protected]=>
array(0) {
}
["_changed":protected]=>
int(0)
["_import":protected]=>
NULL
["_mbox":protected]=>
string(5) "Trash"
}
["userhook"]=>
array(0) {
}
}
following:
var_dump($GLOBALS['registry']->mail->getSpecialMailboxes());
and post the results.
'composetemplates' =>
object(IMP_Mailbox)[187]
protected '_cache' =>
array (size=0)
empty
protected '_changed' => int 0
protected '_import' => null
protected '_mbox' => string 'Templates' (length=9)
'drafts' =>
object(IMP_Mailbox)[190]
protected '_cache' =>
array (size=0)
empty
protected '_changed' => int 0
protected '_import' => null
protected '_mbox' => string 'Draft' (length=5)
'sent' =>
array (size=1)
0 =>
object(IMP_Mailbox)[204]
protected '_cache' =>
array (size=0)
...
protected '_changed' => int 0
protected '_import' => null
protected '_mbox' => string 'Sent' (length=4)
'spam' =>
object(IMP_Mailbox)[194]
protected '_cache' =>
array (size=0)
empty
protected '_changed' => int 0
protected '_import' => null
protected '_mbox' => string 'Spam' (length=4)
'trash' =>
object(IMP_Mailbox)[193]
protected '_cache' =>
array (size=0)
empty
protected '_changed' => int 0
protected '_import' => null
protected '_mbox' => string 'Trash' (length=5)
'userhook' =>
array (size=0)
Priority ⇒ 1. Low
var_dump($GLOBALS['registry']->mail->getSpecialMailboxes());
and post the results.
New Attachment: photo.PNG
special folder is detected.
Only Inbox, Sent and Trash folder displayed correctly while Drafts and
Spam folder is not detected correctly.
Please check the attachment.
P.S. I have updated to the latest horde packages.
For the altnamespace configuration in Cyrus, of course, it solves the
problem, but it is not mandatory with the fix.
State ⇒ Feedback
deletion problem on the iPhone device. The IMAP backend server is
using the standard 2.3 rpm of Cyrus-imapd on CentOS6. In order to
correct the issue I had to turn on "altnamespace" in imapd.conf
http://cyrusimap.web.cmu.edu/docs/cyrus-imapd/2.4.7/altnamespace.php
Once that was done it was possible to choose a trash folder in the
preferences and have the iPhone respect that without causing an
"unable to move to folder" message
visual hierarchy, not the serverid. Good catch, thanks.
And... even if we don't say it enough, I think you do a great job with Horde.
Keep it up.
And I continue to test and track the bugs.
thank you!
Ryu
State ⇒ Resolved
visual hierarchy, not the serverid. Good catch, thanks.
commit 0dd32677fce0518b56935eef3b707a37fdedbdb7
Author: horde-ryu@ryux.org <horde-ryu@ryux.org>
Date: Tue Nov 6 11:01:11 2012 -0500
Bug: 11626Properly detect folder hierarchy for ActiveSync.Signed-off-by: Michael J Rubinsky <mrubinsk@horde.org>
.../Core/lib/Horde/Core/ActiveSync/Driver.php | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/0dd32677fce0518b56935eef3b707a37fdedbdb7
New Attachment: expectedHierarchy.png
ActiveSync, folder has its serverId as $sid. So, to retrieve parent's
folder, we *must* put full parent serverid. Except that actually, the
value is false...
Example :
Parent => Folder 1
=> serverid = 'INBOX.Folder1'
=> parentid = '0'
=> displayname = 'Level1'
*FALSE*
Child => Folder 2 (Folder1.Folder2)
=> serverid = 'INBOX.Folder1.Folder2'
=> parentid = 'Folder1' ======> 'Folder1' does not exists as serverid!
=> displayname = 'Folder2'
*OK*
Child => Folder 2 (Folder1.Folder2)
=> serverid = 'INBOX.Folder1.Folder2'
=> parentid = 'INBOX.Folder1'
=> displayname = 'Folder2'
With this configuration, result is OK, as expected. See the screenshot...
State ⇒ Feedback
delimiters? What *does* it contain?
contains the full name.
2012-11-03T09:10:25+00:00 DEBUG: --- HORDEDEBUG --- f = Array
(
[a] => 8
[d] => .
[label] => Level1.Level6
[level] => 1
[ob] => Horde_Imap_Client_Mailbox Object
(
[_utf7imap:protected] =>
[_utf8:protected] => INBOX.Level1.Level6
)
)
commit 1e611041f2b996139d1b1c161d67db2f564736e9
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Mon Nov 5 13:29:12 2012 -0500
split -> explode
Fixes part of
Bug: 11626.split() is a regexp based split (and is depreceatd anyway) while
explode() is string based and is what was intended here.
.../Core/lib/Horde/Core/ActiveSync/Driver.php | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
http://git.horde.org/horde-git/-/commit/1e611041f2b996139d1b1c161d67db2f564736e9
commit 7219d78904b50fbb546b6dd96ba27bf888f22dea
Author: horde-ryu@ryux.org <horde-ryu@ryux.org>
Date: Mon Nov 5 13:22:45 2012 -0500
Bug: 11626Need the full mailbox name, not just the basename forspecial mboxes.
Fixes detecting special mailboxes on servers where they are part of the
INBOX namespace.
Signed-off-by: Michael J Rubinsky <mrubinsk@horde.org>
.../Core/lib/Horde/Core/ActiveSync/Driver.php | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
http://git.horde.org/horde-git/-/commit/7219d78904b50fbb546b6dd96ba27bf888f22dea
Juste replace line 1827 by :
$parts = explode($f['d'], $sid);
delimiters? What *does* it contain?
Juste replace line 1827 by :
$parts = explode($f['d'], $sid);
and forget the block
if (!empty($fl["INBOX." . implode($f['d'], $parts)])) {
$folder->parentid = "INBOX." . implode($f['d'], $parts);
$folder->displayname = $displayname;
}
Ryu
I replaced the "split" function, line 1827 (which seems to return an
empty array) by "explode". Futhermore, split is deprecated since php
5.3.0
Ryu
For the first problem => bad type for special folders
in Horde Framework / Core/ActiveSync/Driver.php, ~ line 1862 : replace
mailbox property from "basename" to "value" for each special folders.
INBOX prefix was missing with basename...
With this fix, types are ok in ActiveSync
============================================
Next, for the hierarchy problem.
Always the same file (Core/ActiveSync/Driver.php), just above, ~ line 1829
Add INBOX prefix
if (!empty($fl["INBOX." . implode($f['d'], $parts)])) {
$folder->parentid = "INBOX." . implode($f['d'], $parts);
$folder->displayname = $displayname;
}
============================================
I don't know if it is the good fix... Maybe there is a cleaner
solution ! But this works...
Ryu
State ⇒ Assigned
New Attachment: MicrosoftExchangeServer.png
New Attachment: HordeFolders.png
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ ActiveSync : auto detection of special folders (trash, sent, etc...) and hierarchy fails
Queue ⇒ Synchronization
Milestone ⇒
Patch ⇒ No
New Attachment: FolderSync.txt
It seems there's a bug on FOLDERSYNC command. The folders list does
not contain good hierarchy and types.
With ios, special folders like "trash" and "sent" are nor flagged as
"Trash" and "Sent". So it results it is not possible to delete a
message. iPhone shows a popup "The message cannot be moved to the
Trash mailbox"
Futhermore, the hierarchy is not detected. If a folder "Level1"
contains another folder "Level2", ios does not detect the hierarchy
and display the two folders in the same level.
With a "true" Exchange Server, there is no problem.