6.0.0-git
2019-03-19

[#12970] Don't override sticky OPTIONS values with default values.
Summary Don't override sticky OPTIONS values with default values.
Queue Horde Framework Packages
Queue Version Git master
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester software-horde (at) interfasys (dot) ch
Created 2014-02-12 (1861 days ago)
Due
Updated 2014-10-30 (1601 days ago)
Assigned 2014-10-27 (1604 days ago)
Resolved 2014-10-30 (1601 days ago)
Milestone
Patch No

History
2014-10-30 13:32:46 Michael Rubinsky State ⇒ Resolved
 
2014-10-30 00:09:15 software-horde (at) interfasys (dot) ch Comment #76 Reply to this comment
*Sigh*

I thought I did. The revert probably blew it away though. Again, 
thanks for the catch.
:) Yeah, the revert restored the original array.
And sorry for not providing a patch myself. I simply moved the options 
from that array to the empty array in _parseSyncOptions, but thought 
there might be more to it.
2014-10-30 00:08:00 Git Commit Comment #75 Reply to this comment
Changes have been made in Git (master):

commit 1628efa4bc3e19da7b5dc9e4a34026bc86e7b474
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Oct 29 20:07:23 2014 -0400

     This got lost during the revert.

     (Hopefully) final fix for Bug: 12970

  .../lib/Horde/ActiveSync/Collections.php           |    7 +------
  1 files changed, 1 insertions(+), 6 deletions(-)

http://github.com/horde/horde/commit/1628efa4bc3e19da7b5dc9e4a34026bc86e7b474
2014-10-30 00:05:17 Michael Rubinsky Comment #74 Reply to this comment
I think you still need to modify the array in getNewCollection() to only keep
             'clientids' => array(),
             'fetchids' => array(),
             'windowsize' => 100
*Sigh*

I thought I did. The revert probably blew it away though. Again, 
thanks for the catch.
2014-10-29 23:49:32 software-horde (at) interfasys (dot) ch Comment #73 Reply to this comment
Yeah. I had the logic reversed in my head :)

Better, correct, fix now in place. Thanks for the catch.
I think you still need to modify the array in getNewCollection() to only keep
             'clientids' => array(),
             'fetchids' => array(),
             'windowsize' => 100


2014-10-29 23:30:24 Michael Rubinsky Comment #72 Reply to this comment
I don't think this fix works.

If I understand it correctly, it adds defaults in case options are 
not given and we want the opposite: default options when options are 
being sent in a sync so that the minimum requirements are met.
Yeah. I had the logic reversed in my head :)

Better, correct, fix now in place. Thanks for the catch.
2014-10-29 23:29:23 Git Commit Comment #71 Reply to this comment
Changes have been made in Git (master):

commit cc88e5476914a6f6a41837a71ca4a5bffa8375b8
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Oct 29 19:28:35 2014 -0400

     Proper fix for Bug: 12970

  .../lib/Horde/ActiveSync/Collections.php           |   30 
++++++++++++++++++++
  .../lib/Horde/ActiveSync/Request/Sync.php          |    7 ++--
  2 files changed, 34 insertions(+), 3 deletions(-)

http://github.com/horde/horde/commit/cc88e5476914a6f6a41837a71ca4a5bffa8375b8
2014-10-29 23:29:19 Git Commit Comment #70 Reply to this comment
Changes have been made in Git (master):

commit b5fc1d2b2af1132651cd20856c91c5788e8cd42a
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Oct 29 19:27:25 2014 -0400

     Revert "Bug: 12970  Don't overwrite sticky OPTIONS."

     This reverts commit 3902eb2f42197aea6d291816ae204711ff96edb7.

     Conflicts:
             framework/ActiveSync/lib/Horde/ActiveSync/Collections.php

  .../lib/Horde/ActiveSync/Collections.php           |   24 
+++++---------------
  .../lib/Horde/ActiveSync/Request/Sync.php          |    5 ----
  2 files changed, 6 insertions(+), 23 deletions(-)

http://github.com/horde/horde/commit/b5fc1d2b2af1132651cd20856c91c5788e8cd42a
2014-10-29 22:45:40 software-horde (at) interfasys (dot) ch Comment #69 Reply to this comment
Just saw this. I can successfully send an encrypted email from iOS 
and it is readable in Horde, as well an another iOS client that 
receives it via ActiveSync.
Yes, the problem came from iOS which encoded the message using the 
wrong cert...
2014-10-29 22:44:21 software-horde (at) interfasys (dot) ch Comment #68 Reply to this comment
I don't think this fix works.

If I understand it correctly, it adds defaults in case options are not 
given and we want the opposite: default options when options are being 
sent in a sync so that the minimum requirements are met.

[Show Quoted Text - 14 lines]
2014-10-29 20:56:09 Git Commit Comment #67 Reply to this comment
Changes have been made in Git (master):

commit 3902eb2f42197aea6d291816ae204711ff96edb7
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Wed Oct 29 13:03:03 2014 -0400

     Bug: 12970  Don't overwrite sticky OPTIONS.

  .../lib/Horde/ActiveSync/Collections.php           |   25 +++++++++++++++----
  .../lib/Horde/ActiveSync/Request/Sync.php          |    5 ++++
  2 files changed, 24 insertions(+), 6 deletions(-)

http://github.com/horde/horde/commit/3902eb2f42197aea6d291816ae204711ff96edb7
2014-10-29 15:52:10 Michael Rubinsky Comment #66 Reply to this comment
I would start by getting wire traces and full debug sync logs to see
exactly what is being sent along each step of the way. Kind of hard
for me to debug without a device to test, or at the very least the
actual data transmitted.
You should be able to witness the same thing since sending an 
encrypted message from iOS 8.1 can't be read in Horde.
Just saw this. I can successfully send an encrypted email from iOS and 
it is readable in Horde, as well an another iOS client that receives 
it via ActiveSync.
2014-10-29 15:46:03 Michael Rubinsky Comment #65 Reply to this comment
Yep, I've found a reference last night. It's strange that they're 
not following the rules.
I've found that when it comes to ActiveSync, hardly ANYONE follows all 
the rules...very frustrating.
2014-10-29 15:45:11 Michael Rubinsky Comment #64 Reply to this comment

[Show Quoted Text - 9 lines]
You can disable the truncation by commenting out line 1061 in 
Horde_ActiveSync_Adapter::_buildMailMessage().
2014-10-29 14:59:39 software-horde (at) interfasys (dot) ch Comment #63 Reply to this comment
Could message truncation have and impact on that? They set a limit, 
but I'm guessing Horde doesn't touch the message unless it's over 
the limit.
Never mind. Since messages sent via SMTP are affected, it can't be that.
2014-10-29 14:50:51 software-horde (at) interfasys (dot) ch Comment #62 Reply to this comment
application/pcks7-mime, which is normally base64 transfer-encoded is 
limited to 76 characters per line.
Yep, I've found a reference last night. It's strange that they're not 
following the rules.

Could message truncation have and impact on that? They set a limit, 
but I'm guessing Horde doesn't touch the message unless it's over the 
limit.
2014-10-29 14:46:46 Michael Rubinsky Comment #61 Reply to this comment
After analysis, I found that the pkcs7 data is sent in one long line 
and that throws off the OpenSSL parser.
If I format the data using a max-length of 72 characters, then 
OpenSSL can decrypt the data.
I am almost 100% positive that the encoded data has a maximum line 
length of 76 characters. This is almost certainly a BB bug.
So, my guess is that Horde sends the msg to OpenSSL which can't 
handle it as is. That's one half of the problem.
Yes, we use the PHP native openssl_pkcs7_decrypt() function.
The other half is figuring out if Horde is doing something which 
prevents the BB client from understanding the message it gets or if 
the client only understands messages where the data is on one line.
Horde_ActiveSync passes all S/MIME messages UNTOUCHED to the client.
I couldn't find a spec regarding the maximum amount of characters 
per line allowed in pkcs7 data, so I'm guessing that what they're 
doing is legal and one reason most clients can read it.
application/pcks7-mime, which is normally base64 transfer-encoded is 
limited to 76 characters per line.
2014-10-29 03:29:13 software-horde (at) interfasys (dot) ch Comment #60 Reply to this comment
I've processed 3 messages using OpenSSL. One sent from Thunderbird, 
one from the BB client and one from the iOS client using `openssl cms`.

Message from TB can be decrypted properly
Message from iOS can't be decrypted because iOS got confused and used 
the wrong certificate to encrypt the message. Not sure what happened, 
but I can't test further as the client just crashes as soon as it 
receives certificates from Horde.

Message from BB client can't be decrypted as is
Error reading S/MIME message
34374513640:error:0D07207B:asn1 encoding 
routines:ASN1_get_object:header too long:asn1_lib.c:153:
34374513640:error:0D0D106E:asn1 encoding routines:B64_READ_ASN1:decode 
error:asn_mime.c:193:
34374513640:error:0D0D40CB:asn1 encoding routines:SMIME_read_ASN1:asn1 
parse error:asn_mime.c:528:

After analysis, I found that the pkcs7 data is sent in one long line 
and that throws off the OpenSSL parser.
If I format the data using a max-length of 72 characters, then OpenSSL 
can decrypt the data.

What's inside is another binary message which starts with
Content-Type: application/x-pkcs7-mime
Content-Transfer-Encoding: base64

but this time it's a signed message with a SignedData structure and 
lines with fixed width.

So, my guess is that Horde sends the msg to OpenSSL which can't handle 
it as is. That's one half of the problem.

The other half is figuring out if Horde is doing something which 
prevents the BB client from understanding the message it gets or if 
the client only understands messages where the data is on one line.

I couldn't find a spec regarding the maximum amount of characters per 
line allowed in pkcs7 data, so I'm guessing that what they're doing is 
legal and one reason most clients can read it.





2014-10-27 15:08:46 software-horde (at) interfasys (dot) ch Comment #59 Reply to this comment
I would start by getting wire traces and full debug sync logs to see 
exactly what is being sent along each step of the way. Kind of hard 
for me to debug without a device to test, or at the very least the 
actual data transmitted.
You should be able to witness the same thing since sending an 
encrypted message from iOS 8.1 can't be read in Horde.





2014-10-27 14:07:12 Michael Rubinsky Comment #58 Reply to this comment

I would start by getting wire traces and full debug sync logs to see 
exactly what is being sent along each step of the way. Kind of hard 
for me to debug without a device to test, or at the very least the 
actual data transmitted.

2014-10-27 13:53:04 software-horde (at) interfasys (dot) ch Comment #57 Reply to this comment
The cache seems to be holding the proper information now, but one 
problem remains and I have no idea where to look.

Encrypted message
Horde > BB 10
Device says message is not valid
Horde > iOS
Message can be decrypted
BB10 > Horde
Can't read message
BB10 > iOS
Can read the message just fine
iOS > Horde
Can't decrypt message
iOS > BB10
TBD



2014-10-27 13:51:08 Michael Rubinsky Comment #56
Summary ⇒ Don't override sticky OPTIONS values with default values.
State ⇒ Assigned
Reply to this comment
Perfect. Nice catch.
2014-10-27 11:49:18 software-horde (at) interfasys (dot) ch Comment #55 Reply to this comment
I've had a look around and I think the problem comes from 
collections->getNewCollection() which contains defaults which are only 
overridden if the sync contains an options block.

I've moved the defaults to Sync->_parseSyncOptions() and it seems to 
work as expected.

2014-10-27 09:43:42 software-horde (at) interfasys (dot) ch Comment #54 Reply to this comment
You can verify that the MIMESUPPORT value is being cached by looking 
in the table horde_activesync_cache.
OK, it's not working then. Seems mimetruncation and mimesupport are 
not stored properly.

That's what the logs show
2014-10-27T10:30:50+01:00 DEBUG: [88886] I  <Synchronize>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I   <Folders>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I    <Folder>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I     <SyncKey>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I       
{542e663e-92d4-4777-a9de-1a73904cae96}132
2014-10-27T10:30:50+01:00 DEBUG: [88886] I     </SyncKey>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I     <FolderId>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I       F0b8f474e
2014-10-27T10:30:50+01:00 DEBUG: [88886] I     </FolderId>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I     <GetChanges />
2014-10-27T10:30:50+01:00 DEBUG: [88886] I     <WindowSize>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I       25
2014-10-27T10:30:50+01:00 DEBUG: [88886] I     </WindowSize>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I     <Options>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      <FolderType>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I        Email
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      </FolderType>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      <FilterType>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I        0
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      </FilterType>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      <MIMESupport>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I        1
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      </MIMESupport>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      <MIMETruncation>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I        7
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      </MIMETruncation>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      <AirSyncBase:BodyPreference>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I       <AirSyncBase:Type>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I         2
2014-10-27T10:30:50+01:00 DEBUG: [88886] I       </AirSyncBase:Type>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      </AirSyncBase:BodyPreference>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      <AirSyncBase:BodyPreference>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I       <AirSyncBase:Type>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I         1
2014-10-27T10:30:50+01:00 DEBUG: [88886] I       </AirSyncBase:Type>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      </AirSyncBase:BodyPreference>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      <AirSyncBase:BodyPreference>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I       <AirSyncBase:Type>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I         4
2014-10-27T10:30:50+01:00 DEBUG: [88886] I       </AirSyncBase:Type>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I       <AirSyncBase:TruncationSize>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I         200000
2014-10-27T10:30:50+01:00 DEBUG: [88886] I       </AirSyncBase:TruncationSize>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I      </AirSyncBase:BodyPreference>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I     </Options>
2014-10-27T10:30:50+01:00 DEBUG: [88886] I    </Folder>
2014-10-27T10:30:50+01:00 INFO: [88886] Collection added to collection 
handler: collection: INBOX, synckey: 
{542e663e-92d4-4777-a9de-1a73904cae96}132.

and that's what I see in the table
s: 9: "F0b8f474e";a: 13: {
                        s: 5: "class";s: 5: "Email";s: 10: "windowsize";s: 2: "25";s: 10: 
"truncation";i: 0;s: 11: "mimesupport";i: 0;s: 14: "mimetruncation";i: 
8;s: 8: "conflict";i: 1;s: 9: "bodyprefs";a: 3: {
                                i: 2;a: 1: {
                                        s: 4: "type";s: 1: "2";
                                }i: 1;a: 1: {
                                        s: 4: "type";s: 1: "1";
                                }i: 4;a: 2: {
                                        s: 4: "type";s: 1: "4";s: 14: "truncationsize";s: 6: "200000";
                                }
                        }s: 8: "serverid";s: 5: "INBOX";s: 11: "lastsynckey";s: 41: 
"{542e663e-92d4-4777-a9de-1a73904cae96}132";s: 10: "filtertype";s: 1: 
"0";s: 2: "id";s: 9: "F0b8f474e";s: 14: "deletesasmoves";b: 1;s: 8: 
"pingable";b: 1;

2014-10-27 01:33:26 Michael Rubinsky Comment #53 Reply to this comment

[Show Quoted Text - 9 lines]
Correct, and we already do that.

I was misunderstanding what was happening on your end. I thought the 
client WAS sending an OPTIONS request, but was just not including the 
MIMESUPPORT.  We fill in any missing values in 
Horde_ActiveSync_SyncCache::validateCollectionsFromCache()

Maybe what is happening is that at some point after the initial sync, 
the client IS sending an OPTIONS request either without the 
MIMESUPPORT or with it set to 0. This then becomes the cached value of 
the OPTIONS to be used when it is omitted.

You can verify that the MIMESUPPORT value is being cached by looking 
in the table horde_activesync_cache.

2014-10-26 18:16:56 software-horde (at) interfasys (dot) ch Comment #52 Reply to this comment
There is no such thing as "being defined" in EAS. The only time we 
look at previously sent values for a collection's OPTIONS is when 
the client issues a PARTIAL SYNC. Then we load the ENTIRE previously 
requested collection data. If a SYNC request sends an OPTIONS 
structure, it MUST contain the MIMESUPPORT field, or it defaults to 0.
Ok, but what I mean is that MIMESUPPORT is defined when the SYNC > 
OPTIONS is being sent. It only happens when settings things up. 
Afterwards, there is never another SYNC > OPTIONS being sent.

And according to 2.2.3.115.5, these options have to be kept in the 
database and re-used across requests:
"The server preserves the Options block across requests, using a 
concept referred to as "sticky options". If the Options block is not 
included in a request, the previous Options block is used. "


Regarding the patch, it's half working.

For the encrypted message, same as before in the logs, but the device 
now knows it's an encrypted message, but still receives it as HTML and 
can't decrypt it.

For signed messages, there are now extra steps.
First the message is the usual HTML one with no MIMESUPPORT in 
getMessage, but then it triggers an itemoperation which includes 
MIMESUPPORT.

2014-10-26 17:47:44 Michael Rubinsky Comment #51 Reply to this comment
That doesn't matter. It's supposed to be set for each
fetch/sync/itemoperation to tell the server the client can accept the
MIME blob. If it's missing, it's assumed to be zero. See MS-ASCMD
section 2.2.3.100.3.
I don't think so. 2.2.3.100.3 says that it has to be part of every 
Sync>Options request and it is when the collection is being defined.
There is no such thing as "being defined" in EAS. The only time we 
look at previously sent values for a collection's OPTIONS is when the 
client issues a PARTIAL SYNC. Then we load the ENTIRE previously 
requested collection data. If a SYNC request sends an OPTIONS 
structure, it MUST contain the MIMESUPPORT field, or it defaults to 0.
2014-10-26 17:45:30 software-horde (at) interfasys (dot) ch Comment #50 Reply to this comment
That doesn't matter. It's supposed to be set for each 
fetch/sync/itemoperation to tell the server the client can accept 
the MIME blob. If it's missing, it's assumed to be zero. See 
MS-ASCMD section 2.2.3.100.3.
I don't think so. 2.2.3.100.3 says that it has to be part of every 
Sync>Options request and it is when the collection is being defined.
2014-10-26 17:45:09 Michael Rubinsky Comment #49 Reply to this comment
Does this change anything for you?

I changed it so that we always at least set the message class value 
for S/MIME messages, even if we are not sending the MIME part.
2014-10-26 17:44:10 Git Commit Comment #48 Reply to this comment
Changes have been made in Git (master):

commit 6ed73e0edab15b6132a7ef7918fdbfd2c362fa81
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Sun Oct 26 13:43:14 2014 -0400

     Set the SMIME message class regardless of MIME support value.

     Another attempt at Bug: 12970

  .../lib/Horde/ActiveSync/Imap/Adapter.php          |   11 +++++------
  1 files changed, 5 insertions(+), 6 deletions(-)

http://github.com/horde/horde/commit/6ed73e0edab15b6132a7ef7918fdbfd2c362fa81
2014-10-26 17:26:59 Michael Rubinsky Comment #47 Reply to this comment
I set it manually to see what the client would say. Based on my 
comment #32, the client supports type 1. It's defined at 
provisioning time or when adding a collection.
That doesn't matter. It's supposed to be set for each 
fetch/sync/itemoperation to tell the server the client can accept the 
MIME blob. If it's missing, it's assumed to be zero. See MS-ASCMD 
section 2.2.3.100.3.
I've verified that the client never sets it in itemoperations for 
unencrypted messages and I think it's normal, as it's an optional 
element, unless the client is fetching a S/MIME message.
Exactly. This is what the problem is. The client is fetching a S/MIME 
message, but fails to tell the server that it can support it.
For an encrypted message, there is no itemoperations command being 
sent when receiving the message
Doesn't matter. It can be requested via a SYNC FETCH, though that 
method is deprecated.
Wait, I'm confused now. You said earlier that the MessageClass was
always being set to IPM.Note, and NOT IPM.Note.SMIME. Below, it
clearly shows that it IS set correctly.
That's when I manually enable a mimetype. I did it to check what 
would happen later on in the chain if given the mimetype I think it 
expects.
If it's not sending non-empty MIMESupport tag, that it's not expecting 
anything related to MIME.
This means that the client is NOT requesting the MIME data. You will
never get the full MIME message as long as the client is sending
MIMESUPPORT of 0.
The client is not sending mimesupport of 0.
As per the specs, if MimeSupport is missing in any request, the 
default value of 0 should be used. See the reference I posted earlier 
in this message.
Horde is using the default value because it could not find it in the 
request, but a value of 1 has been sent when adding the collection 
via a sync command and I think that it's the value which should be 
used since the client is not sending an updated value of 0 per 
example.
There is no mechanism or expectation in the EAS protocol to use an 
earlier value of just one OPTION field. The client can omit the entire 
collection in a SYNC request, and flag it as a PARTIAL, in which case 
the server falls back to the last SYNC information for that collection 
in it's entirety. If this is what BB is expecting, it's a bug in their 
implementation.
2014-10-26 15:22:16 software-horde (at) interfasys (dot) ch Comment #46 Reply to this comment
What do you mean "with mimesupport set at 1 or 2"? This is not a 
configurable value. It comes from the client and it indicates what 
the client is able to understand, or what it is expecting to be 
returned. Changing it on the server side after the client sends it 
leads to undefined behavior because the device is not longer 
receiving what it is expecting in return.
I set it manually to see what the client would say. Based on my 
comment #32, the client supports type 1. It's defined at provisioning 
time or when adding a collection.
I've verified that the client never sets it in itemoperations for 
unencrypted messages and I think it's normal, as it's an optional 
element, unless the client is fetching a S/MIME message. For an 
encrypted message, there is no itemoperations command being sent when 
receiving the message
Wait, I'm confused now. You said earlier that the MessageClass was   
always being set to IPM.Note, and NOT IPM.Note.SMIME. Below, it   
clearly shows that it IS set correctly.
That's when I manually enable a mimetype. I did it to check what would 
happen later on in the chain if given the mimetype I think it expects.
This means that the client is NOT requesting the MIME data. You will 
  never get the full MIME message as long as the client is sending   
MIMESUPPORT of 0.
The client is not sending mimesupport of 0. Horde is using the default 
value because it could not find it in the request, but a value of 1 
has been sent when adding the collection via a sync command and I 
think that it's the value which should be used since the client is not 
sending an updated value of 0 per example.



2014-10-26 02:30:39 Michael Rubinsky Comment #45 Reply to this comment
I did a quick test with mimesupport set at 1 or 2.
What do you mean "with mimesupport set at 1 or 2"? This is not a 
configurable value. It comes from the client and it indicates what the 
client is able to understand, or what it is expecting to be returned. 
Changing it on the server side after the client sends it leads to 
undefined behavior because the device is not longer receiving what it 
is expecting in return.

2014-10-26 02:28:49 Michael Rubinsky Comment #44 Reply to this comment
And that's what the logs look like with a message sent from Horde 
which can't be read on the other side.
Wait, I'm confused now. You said earlier that the MessageClass was 
always being set to IPM.Note, and NOT IPM.Note.SMIME. Below, it 
clearly shows that it IS set correctly.

[Show Quoted Text - 66 lines]
2014-10-26 02:26:53 Michael Rubinsky Comment #43 Reply to this comment
I had forgotten there were other devices connected...
So this is the log when only the BlackBerry gets the message.
mimesupport is set at 0 (int versus string for the other device)
This means that the client is NOT requesting the MIME data. You will 
never get the full MIME message as long as the client is sending 
MIMESUPPORT of 0.


2014-10-26 01:16:28 software-horde (at) interfasys (dot) ch Comment #42 Reply to this comment
And that's what the logs look like with a message sent from Horde 
which can't be read on the other side.

2014-10-26T02:04:10+01:00 DEBUG: [18622] O        <POOMMAIL:Importance>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         1
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        </POOMMAIL:Importance>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        <POOMMAIL:Read>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         0
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        </POOMMAIL:Read>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        <POOMMAIL:MessageClass>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         IPM.Note.SMIME
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        </POOMMAIL:MessageClass>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        <POOMMAIL:InternetCPID>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         65001
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        </POOMMAIL:InternetCPID>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        <AirSyncBase:NativeBodyType>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         1
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         
</AirSyncBase:NativeBodyType>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        <AirSyncBase:Body>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         <AirSyncBase:Type>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O          4
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         </AirSyncBase:Type>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         
<AirSyncBase:EstimatedDataSize>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O          17314
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         
</AirSyncBase:EstimatedDataSize>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         <AirSyncBase:Truncated>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O          0
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         </AirSyncBase:Truncated>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         <AirSyncBase:Data>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O          [STREAM]
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         </AirSyncBase:Data>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        </AirSyncBase:Body>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        <AirSyncBase:Attachments>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         <AirSyncBase:Attachment>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O          <AirSyncBase:DisplayName>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O           S/MIME Encrypted Message
2014-10-26T02:04:10+01:00 DEBUG: [18622] O          </AirSyncBase:DisplayName>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O           
<AirSyncBase:FileReference>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O           INBOX:3336:1
2014-10-26T02:04:10+01:00 DEBUG: [18622] O           
</AirSyncBase:FileReference>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O          <AirSyncBase:Method>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O           1
2014-10-26T02:04:10+01:00 DEBUG: [18622] O          </AirSyncBase:Method>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O           
<AirSyncBase:EstimatedDataSize>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O           8826
2014-10-26T02:04:10+01:00 DEBUG: [18622] O           
</AirSyncBase:EstimatedDataSize>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O          <AirSyncBase:IsInline>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O           1
2014-10-26T02:04:10+01:00 DEBUG: [18622] O          </AirSyncBase:IsInline>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         </AirSyncBase:Attachment>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        </AirSyncBase:Attachments>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        <POOMMAIL:Flag/>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        <POOMMAIL:ContentClass>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O         urn:content-classes:message
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        </POOMMAIL:ContentClass>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O        <POOMMAIL:Categories/>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O       </Data>
2014-10-26T02:04:10+01:00 DEBUG: [18622] O      </Add>

2014-10-26 01:07:43 software-horde (at) interfasys (dot) ch Comment #41 Reply to this comment
I did a quick test with mimesupport set at 1 or 2.

Any message sent from outside is detected as being encrypted, but the 
device says the message isn't valid.

The reverse is true as well, the device can send encrypted messages 
and read them, but Horde doesn't understand them.

Thunderbird can read everything.
2014-10-26 00:31:21 software-horde (at) interfasys (dot) ch Comment #40 Reply to this comment
I had forgotten there were other devices connected...
So this is the log when only the BlackBerry gets the message.
mimesupport is set at 0 (int versus string for the other device)

2014-10-26T02:26:59+02:00 DEBUG: Variable information:
array(4) {
   ["protocolversion"]=>
   string(4) "14.1"
   ["truncation"]=>
   bool(false)
   ["bodyprefs"]=>
   array(3) {
     [2]=>
     array(2) {
       ["type"]=>
       string(1) "2"
       ["truncationsize"]=>
       int(1048576)
     }
     [1]=>
     array(2) {
       ["type"]=>
       string(1) "1"
       ["truncationsize"]=>
       int(1048576)
     }
     [4]=>
     array(2) {
       ["type"]=>
       string(1) "4"
       ["truncationsize"]=>
       string(6) "200000"
     }
   }
   ["mimesupport"]=>
   int(0)
}

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:988

2014-10-26T02:26:59+02:00 DEBUG: Variable information:
bool(false)

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:989

2014-10-26T02:26:59+02:00 DEBUG: Variable information:
bool(true)

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:990

2014-10-25 23:17:06 software-horde (at) interfasys (dot) ch Comment #39 Reply to this comment
That's for a signed message. It seems isEncrypted() is failing


2014-10-26T01:14:14+02:00 DEBUG: Variable information:
array(4) {
   ["protocolversion"]=>
   string(4) "14.1"
   ["truncation"]=>
   bool(false)
   ["bodyprefs"]=>
   array(3) {
     [2]=>
     array(2) {
       ["type"]=>
       string(1) "2"
       ["truncationsize"]=>
       int(1048576)
     }
     [1]=>
     array(2) {
       ["type"]=>
       string(1) "1"
       ["truncationsize"]=>
       int(1048576)
     }
     [4]=>
     array(2) {
       ["type"]=>
       string(1) "4"
       ["truncationsize"]=>
       string(6) "200000"
     }
   }
   ["mimesupport"]=>
   int(0)
}

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:988

2014-10-26T01:14:14+02:00 DEBUG: Variable information:
bool(true)

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:989

2014-10-26T01:14:14+02:00 DEBUG: Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:990

2014-10-26T01:14:15+02:00 DEBUG: Variable information:
array(4) {
   ["protocolversion"]=>
   string(4) "14.1"
   ["truncation"]=>
   int(4096)
   ["bodyprefs"]=>
   array(1) {
     [1]=>
     array(2) {
       ["type"]=>
       string(1) "1"
       ["truncationsize"]=>
       string(3) "500"
     }
   }
   ["mimesupport"]=>
   string(1) "0"
}

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:988

2014-10-26T01:14:15+02:00 DEBUG: Variable information:
bool(true)

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:989

2014-10-26T01:14:15+02:00 DEBUG: Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:990

2014-10-26T01:14:15+02:00 DEBUG: Variable information:
array(4) {
   ["protocolversion"]=>
   string(4) "14.1"
   ["truncation"]=>
   bool(false)
   ["bodyprefs"]=>
   array(1) {
     [4]=>
     &array(2) {
       ["type"]=>
       string(1) "4"
       ["truncationsize"]=>
       int(1048576)
     }
   }
   ["mimesupport"]=>
   string(1) "2"
}

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Driver_Base->fetch() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:559
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Driver/Base.php:254
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:988

2014-10-26T01:14:15+02:00 DEBUG: Variable information:
bool(true)

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Driver_Base->fetch() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:559
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Driver/Base.php:254
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:989

2014-10-26T01:14:15+02:00 DEBUG: Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Driver_Base->fetch() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:559
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Driver/Base.php:254
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:990
2014-10-25 23:02:00 software-horde (at) interfasys (dot) ch Comment #38 Reply to this comment
Some information was missing due to the fact that I didn't configure a 
global debug log file. Here is the proper output for a meesage which 
is both signed and encrypted

2014-10-26T00:57:01+02:00 DEBUG: Variable information:
array(4) {
   ["protocolversion"]=>
   string(4) "14.1"
   ["truncation"]=>
   int(4096)
   ["bodyprefs"]=>
   array(1) {
     [1]=>
     array(2) {
       ["type"]=>
       string(1) "1"
       ["truncationsize"]=>
       string(3) "500"
     }
   }
   ["mimesupport"]=>
   string(1) "0"
}

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:988

2014-10-26T00:57:01+02:00 DEBUG: Variable information:
bool(false)

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:989

2014-10-26T00:57:01+02:00 DEBUG: Variable information:
bool(true)

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:990

2014-10-26T00:57:01+02:00 DEBUG: Variable information:
array(4) {
   ["protocolversion"]=>
   string(4) "14.1"
   ["truncation"]=>
   bool(false)
   ["bodyprefs"]=>
   array(3) {
     [2]=>
     array(2) {
       ["type"]=>
       string(1) "2"
       ["truncationsize"]=>
       int(1048576)
     }
     [1]=>
     array(2) {
       ["type"]=>
       string(1) "1"
       ["truncationsize"]=>
       int(1048576)
     }
     [4]=>
     array(2) {
       ["type"]=>
       string(1) "4"
       ["truncationsize"]=>
       string(6) "200000"
     }
   }
   ["mimesupport"]=>
   int(0)
}

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:988

2014-10-26T00:57:01+02:00 DEBUG: Variable information:
array(4) {
   ["protocolversion"]=>
   string(4) "14.1"
   ["truncation"]=>
   bool(false)
   ["bodyprefs"]=>
   array(1) {
     [4]=>
     &array(2) {
       ["type"]=>
       string(1) "4"
       ["truncationsize"]=>
       int(1048576)
     }
   }
   ["mimesupport"]=>
   string(1) "2"
}

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Driver_Base->fetch() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:559
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Driver/Base.php:254
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:988

2014-10-26T00:57:01+02:00 DEBUG: Variable information:
bool(false)

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Driver_Base->fetch() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:559
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Driver/Base.php:254
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:989

2014-10-26T00:57:01+02:00 DEBUG: Variable information:
bool(true)

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Driver_Base->fetch() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:559
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Driver/Base.php:254
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:990


2014-10-25 22:40:31 software-horde (at) interfasys (dot) ch Comment #37 Reply to this comment
OK, here is what I get when the message is being received by the 
device. Seems like Horde is sending the plain text and the S/MIME parts.

2014-10-26T00:34:00+02:00 DEBUG: Variable information:
array(4) {
   ["protocolversion"]=>
   string(4) "14.1"
   ["truncation"]=>
   bool(false)
   ["bodyprefs"]=>
   array(3) {
     [2]=>
     array(2) {
       ["type"]=>
       string(1) "2"
       ["truncationsize"]=>
       int(1048576)
     }
     [1]=>
     array(2) {
       ["type"]=>
       string(1) "1"
       ["truncationsize"]=>
       int(1048576)
     }
     [4]=>
     array(2) {
       ["type"]=>
       string(1) "4"
       ["truncationsize"]=>
       string(6) "200000"
     }
   }
   ["mimesupport"]=>
   int(0)
}

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:988

2014-10-26T00:34:01+02:00 DEBUG: Variable information:
array(4) {
   ["protocolversion"]=>
   string(4) "14.1"
   ["truncation"]=>
   int(4096)
   ["bodyprefs"]=>
   array(1) {
     [1]=>
     array(2) {
       ["type"]=>
       string(1) "1"
       ["truncationsize"]=>
       string(3) "500"
     }
   }
   ["mimesupport"]=>
   string(1) "0"
}

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Connector_Exporter->sendNextChange() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:613
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Connector/Exporter.php:215
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:988

2014-10-26T00:34:02+02:00 DEBUG: Variable information:
array(4) {
   ["protocolversion"]=>
   string(4) "14.1"
   ["truncation"]=>
   bool(false)
   ["bodyprefs"]=>
   array(1) {
     [4]=>
     &array(2) {
       ["type"]=>
       string(1) "4"
       ["truncationsize"]=>
       int(1048576)
     }
   }
   ["mimesupport"]=>
   string(1) "2"
}

Backtrace:
1. Horde_Rpc_ActiveSync->getResponse() /var/www/html/webmail/rpc.php:159
2. Horde_ActiveSync->handleRequest() 
/usr/local/php54/lib/php/Horde/Rpc/ActiveSync.php:143
3. Horde_ActiveSync_Request_Base->handle() 
/usr/local/php54/lib/php/Horde/ActiveSync.php:880
4. Horde_ActiveSync_Request_Sync->_handle() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Base.php:253
5. Horde_ActiveSync_Driver_Base->fetch() 
/usr/local/php54/lib/php/Horde/ActiveSync/Request/Sync.php:559
6. Horde_Core_ActiveSync_Driver->getMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Driver/Base.php:254
7. Horde_ActiveSync_Imap_Adapter->getMessages() 
/usr/local/php54/lib/php/Horde/Core/ActiveSync/Driver.php:1274
8. Horde_ActiveSync_Imap_Adapter->_buildMailMessage() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:535
9. Horde::debug() 
/usr/local/php54/lib/php/Horde/ActiveSync/Imap/Adapter.php:988

[Show Quoted Text - 11 lines]
2014-10-25 22:19:46 Michael Rubinsky Comment #36 Reply to this comment
For the record, simulator does not support enterprise features.

So, to continue debugging try adding:

Horde::debug($options);
Horde::debug($imap_message->isSigned());
Horde::debug($imap_message->isEncrypted());

in Horde_ActiveSync_Imap_Adapter::_buildMailMessage() right before the 
if statement on line 988. The output will be put into a file name 
horde_debug.txt in your system's tmp directory.
2014-10-25 21:04:54 Michael Rubinsky Comment #35 Reply to this comment
Great. Sent details privately.
2014-10-25 20:44:28 software-horde (at) interfasys (dot) ch Comment #34 Reply to this comment
I need the email address you want to add and the IP or hostname of the server.
I'll configure it to sync everything for 1 month and will enable 
S/MIME, with forced signatures.
All this can be changed at will if you need to be able to sync data 
for a shorter period of time per example.
What do you need from me to attempt to add my simulator to your BES?
2014-10-25 20:31:05 Michael Rubinsky Comment #33 Reply to this comment
Also any message sent by the device can't be decoded by Horde, even 
though it recognises that it's a S/MIME message.
Yeah, I noticed that. I can read the encrypted email you sent me on my 
iPhone, but not in Horde.

What do you need from me to attempt to add my simulator to your BES?
2014-10-25 20:25:04 software-horde (at) interfasys (dot) ch Comment #32 Reply to this comment
Thank for the detailed example.
So there is no MIMESupport options being sent before the message 
itself is being sent in HTML.
Is there another tag to look for?

I've added a new folder to sync to see what would be asked and it 
seems it's expecting type 1,2 or 4 (text,html,mime).

Also any message sent by the device can't be decoded by Horde, even 
though it recognises that it's a S/MIME message.

Here is the log when adding the folder:
DEBUG: [91873] I    <Folder>
DEBUG: [91873] I     <SyncKey>
DEBUG: [91873] I       {544c0366-24f4-4ee2-841b-66e1904cae96}1
DEBUG: [91873] I     </SyncKey>
DEBUG: [91873] I     <FolderId>
DEBUG: [91873] I       Fc767dd23
DEBUG: [91873] I     </FolderId>
DEBUG: [91873] I     <GetChanges />
DEBUG: [91873] I     <WindowSize>
DEBUG: [91873] I       25
DEBUG: [91873] I     </WindowSize>
DEBUG: [91873] I     <Options>
DEBUG: [91873] I      <FolderType>
DEBUG: [91873] I        Email
DEBUG: [91873] I      </FolderType>
DEBUG: [91873] I      <FilterType>
DEBUG: [91873] I        0
DEBUG: [91873] I      </FilterType>
DEBUG: [91873] I      <MIMESupport>
DEBUG: [91873] I        1
DEBUG: [91873] I      </MIMESupport>
DEBUG: [91873] I      <MIMETruncation>
DEBUG: [91873] I        7
DEBUG: [91873] I      </MIMETruncation>
DEBUG: [91873] I      <AirSyncBase:BodyPreference>
DEBUG: [91873] I       <AirSyncBase:Type>
DEBUG: [91873] I         2
DEBUG: [91873] I       </AirSyncBase:Type>
DEBUG: [91873] I      </AirSyncBase:BodyPreference>
DEBUG: [91873] I      <AirSyncBase:BodyPreference>
DEBUG: [91873] I       <AirSyncBase:Type>
DEBUG: [91873] I         1
DEBUG: [91873] I       </AirSyncBase:Type>
DEBUG: [91873] I      </AirSyncBase:BodyPreference>
DEBUG: [91873] I      <AirSyncBase:BodyPreference>
DEBUG: [91873] I       <AirSyncBase:Type>
DEBUG: [91873] I         4
DEBUG: [91873] I       </AirSyncBase:Type>
DEBUG: [91873] I       <AirSyncBase:TruncationSize>
DEBUG: [91873] I         200000
DEBUG: [91873] I       </AirSyncBase:TruncationSize>
DEBUG: [91873] I      </AirSyncBase:BodyPreference>
DEBUG: [91873] I     </Options>
DEBUG: [91873] I    </Folder>
That's why I'm asking. The logs below show an HTML message being 
sent, which doesn't support SMIME. The device must explicitly 
request a MIME message.
2014-10-25 19:18:31 Michael Rubinsky Comment #31 Reply to this comment
Well, based on the logs posted below, the client gets an attachment, 
so I'm guessing it's asking for a MIME message?
Also, attachments are still sent even if the client is not requesting 
the MIME message. Horde just has to do extra work to parse out the 
attachment from the message and send it separately.
Horde creates a S/MIME Encrypted Message attachement
The device creates a smime.p7m attach
Still occurs when not sending the actual MIME message. The signature, 
in this case, is just another attachment. Though I thought we were 
filtering out signatures in this case, I'll have to double check. 
Either way, not an indication the device is requesting a MIME message.

2014-10-25 19:12:11 Michael Rubinsky Comment #30 Reply to this comment
That's why I'm asking. The logs below show an HTML message being sent, 
which doesn't support SMIME. The device must explicitly request a MIME 
message. E.g., this is the OPTIONS portion of a SYNC request the is 
NOT requesting a MIME message:

2014-10-25T14:48:23-04:00 DEBUG: [281] I     <Options>
2014-10-25T14:48:23-04:00 DEBUG: [281] I      <FilterType>
2014-10-25T14:48:23-04:00 DEBUG: [281] I        5
2014-10-25T14:48:23-04:00 DEBUG: [281] I      </FilterType>
2014-10-25T14:48:23-04:00 DEBUG: [281] I      <MIMETruncation>
2014-10-25T14:48:23-04:00 DEBUG: [281] I        1
2014-10-25T14:48:23-04:00 DEBUG: [281] I      </MIMETruncation>
2014-10-25T14:48:23-04:00 DEBUG: [281] I      <MIMESupport>
2014-10-25T14:48:23-04:00 DEBUG: [281] I        0
2014-10-25T14:48:23-04:00 DEBUG: [281] I      </MIMESupport>
2014-10-25T14:48:23-04:00 DEBUG: [281] I      <AirSyncBase:BodyPreference>
2014-10-25T14:48:23-04:00 DEBUG: [281] I       <AirSyncBase:Type>
2014-10-25T14:48:23-04:00 DEBUG: [281] I         1
2014-10-25T14:48:23-04:00 DEBUG: [281] I       </AirSyncBase:Type>
2014-10-25T14:48:23-04:00 DEBUG: [281] I       <AirSyncBase:TruncationSize>
2014-10-25T14:48:23-04:00 DEBUG: [281] I         500
2014-10-25T14:48:23-04:00 DEBUG: [281] I       </AirSyncBase:TruncationSize>
2014-10-25T14:48:23-04:00 DEBUG: [281] I      </AirSyncBase:BodyPreference>
2014-10-25T14:48:23-04:00 DEBUG: [281] I     </Options>

The MIMESupport element is set to '0' - which means no mime support. 
The BodyPreference Type is set to '1', which indicates plaintext. So 
the client is requesting only a plaintext representation of the 
message. No MIME and no S/MIME. This results in the following log 
snippits:

2014-10-25T14:48:23-04:00 INFO: [281] 
Horde_Core_ActiveSync_Driver::getMessage(INBOX, 255000)
2014-10-25T14:48:23-04:00 INFO: [281] Sending PLAINTEXT Message.
.
.
.
2014-10-25T14:48:23-04:00 DEBUG: [281] O        <POOMMAIL:MessageClass>
2014-10-25T14:48:23-04:00 DEBUG: [281] O         IPM.Note
2014-10-25T14:48:23-04:00 DEBUG: [281] O        </POOMMAIL:MessageClass>
.
.
2014-10-25T14:48:23-04:00 DEBUG: [281] O        <POOMMAIL:MessageClass>
2014-10-25T14:48:23-04:00 DEBUG: [281] O         IPM.Note
2014-10-25T14:48:23-04:00 DEBUG: [281] O        </POOMMAIL:MessageClass>
2014-10-25T14:48:23-04:00 DEBUG: [281] O        <POOMMAIL:InternetCPID>
2014-10-25T14:48:23-04:00 DEBUG: [281] O         65001
2014-10-25T14:48:23-04:00 DEBUG: [281] O        </POOMMAIL:InternetCPID>
2014-10-25T14:48:23-04:00 DEBUG: [281] O        <AirSyncBase:NativeBodyType>
2014-10-25T14:48:23-04:00 DEBUG: [281] O         1
2014-10-25T14:48:23-04:00 DEBUG: [281] O        </AirSyncBase:NativeBodyType>
2014-10-25T14:48:23-04:00 DEBUG: [281] O        <AirSyncBase:Body>
2014-10-25T14:48:23-04:00 DEBUG: [281] O         <AirSyncBase:Type>
2014-10-25T14:48:23-04:00 DEBUG: [281] O          1
2014-10-25T14:48:23-04:00 DEBUG: [281] O         </AirSyncBase:Type>
2014-10-25T14:48:23-04:00 DEBUG: [281] O         
<AirSyncBase:EstimatedDataSize>
2014-10-25T14:48:23-04:00 DEBUG: [281] O          139
2014-10-25T14:48:23-04:00 DEBUG: [281] O         
</AirSyncBase:EstimatedDataSize>
2014-10-25T14:48:23-04:00 DEBUG: [281] O         <AirSyncBase:Data>
2014-10-25T14:48:23-04:00 DEBUG: [281] O          [STREAM]
2014-10-25T14:48:23-04:00 DEBUG: [281] O         </AirSyncBase:Data>
2014-10-25T14:48:23-04:00 DEBUG: [281] O        </AirSyncBase:Body>

  The following is the OPTIONS request from the same client, but 
asking for the MIME data:

2014-10-25T14:48:23-04:00 DEBUG: [282] I     <Options>
2014-10-25T14:48:23-04:00 DEBUG: [282] I      <FilterType>
2014-10-25T14:48:23-04:00 DEBUG: [282] I        5
2014-10-25T14:48:23-04:00 DEBUG: [282] I      </FilterType>
2014-10-25T14:48:23-04:00 DEBUG: [282] I      <MIMESupport>
2014-10-25T14:48:23-04:00 DEBUG: [282] I        2
2014-10-25T14:48:23-04:00 DEBUG: [282] I      </MIMESupport>
2014-10-25T14:48:23-04:00 DEBUG: [282] I      <AirSyncBase:BodyPreference>
2014-10-25T14:48:23-04:00 DEBUG: [282] I       <AirSyncBase:Type>
2014-10-25T14:48:23-04:00 DEBUG: [282] I         4
2014-10-25T14:48:23-04:00 DEBUG: [282] I       </AirSyncBase:Type>
2014-10-25T14:48:23-04:00 DEBUG: [282] I       <AirSyncBase:TruncationSize>
2014-10-25T14:48:23-04:00 DEBUG: [282] I         32768
2014-10-25T14:48:23-04:00 DEBUG: [282] I       </AirSyncBase:TruncationSize>
2014-10-25T14:48:23-04:00 DEBUG: [282] I      </AirSyncBase:BodyPreference>
2014-10-25T14:48:23-04:00 DEBUG: [282] I     </Options>

This time, MIMESupport is '2', which means the client can support any 
MIME messages (including S/MIME). It could also be set to '1', which 
means only S/MIME data is allowed. This results in the following 
output (same message as in previous example):

2014-10-25T14:48:23-04:00 INFO: [282] 
Horde_Core_ActiveSync_Driver::getMessage(INBOX, 255000)
2014-10-25T14:48:24-04:00 INFO: [282] Sending MIME Message.
2014-10-25T14:48:24-04:00 INFO: [282] Checking MIMETRUNCATION: , 
ServerData: 10353
.
.
.
2014-10-25T14:48:24-04:00 DEBUG: [282] O        <POOMMAIL:MessageClass>
2014-10-25T14:48:24-04:00 DEBUG: [282] O         
IPM.Note.SMIME.MultipartSigned
2014-10-25T14:48:24-04:00 DEBUG: [282] O        </POOMMAIL:MessageClass>
2014-10-25T14:48:24-04:00 DEBUG: [282] O        <POOMMAIL:InternetCPID>
2014-10-25T14:48:24-04:00 DEBUG: [282] O         65001
2014-10-25T14:48:24-04:00 DEBUG: [282] O        </POOMMAIL:InternetCPID>
2014-10-25T14:48:24-04:00 DEBUG: [282] O        <AirSyncBase:NativeBodyType>
2014-10-25T14:48:24-04:00 DEBUG: [282] O         1
2014-10-25T14:48:24-04:00 DEBUG: [282] O        </AirSyncBase:NativeBodyType>
2014-10-25T14:48:24-04:00 DEBUG: [282] O        <AirSyncBase:Body>
2014-10-25T14:48:24-04:00 DEBUG: [282] O         <AirSyncBase:Type>
2014-10-25T14:48:24-04:00 DEBUG: [282] O          4
2014-10-25T14:48:24-04:00 DEBUG: [282] O         </AirSyncBase:Type>
2014-10-25T14:48:24-04:00 DEBUG: [282] O         
<AirSyncBase:EstimatedDataSize>
2014-10-25T14:48:24-04:00 DEBUG: [282] O          10353
2014-10-25T14:48:24-04:00 DEBUG: [282] O         
</AirSyncBase:EstimatedDataSize>
2014-10-25T14:48:24-04:00 DEBUG: [282] O         <AirSyncBase:Truncated>
2014-10-25T14:48:24-04:00 DEBUG: [282] O          0
2014-10-25T14:48:24-04:00 DEBUG: [282] O         </AirSyncBase:Truncated>
2014-10-25T14:48:24-04:00 DEBUG: [282] O         <AirSyncBase:Data>
2014-10-25T14:48:24-04:00 DEBUG: [282] O          [STREAM]
2014-10-25T14:48:24-04:00 DEBUG: [282] O         </AirSyncBase:Data>
2014-10-25T14:48:24-04:00 DEBUG: [282] O        </AirSyncBase:Body>

The BodyType of '4' indicates it is a MIME message, and the 
MessageClass indicates it's S/MIME Signed. I have similar tests with 
just encrypted and signed/encrypted.
2014-10-25 18:53:44 software-horde (at) interfasys (dot) ch Comment #29 Reply to this comment
Well, based on the logs posted below, the client gets an attachment, 
so I'm guessing it's asking for a MIME message?

Horde creates a S/MIME Encrypted Message attachement
The device creates a smime.p7m attach
Are you sure that the client is actually asking for a MIME message 
and not plaintext or html?
2014-10-25 17:19:16 Michael Rubinsky Comment #28 Reply to this comment
Are you sure that the client is actually asking for a MIME message and 
not plaintext or html?
2014-10-25 15:13:38 software-horde (at) interfasys (dot) ch Comment #27 Reply to this comment
Both signed and encrypted send from either Horde or the device have 
the same "plain text" MessageClass of IMP.Note, so it seems the 
ActiveSync "parser" is not detecting the message as being encrypted or 
signed.

Since my certs expired today, I need to see if this plays a role, but 
I doubt it. The next step would be for me to be able to trace which 
mime types are detected.

I'm going to send you test emails as soon as I've renewed the certs
Nevermind. Can you see if THIS fixes it?
2014-10-25 14:48:42 Michael Rubinsky Comment #26 Reply to this comment
Nevermind. Can you see if THIS fixes it?
2014-10-25 14:48:18 Git Commit Comment #25 Reply to this comment
Changes have been made in Git (master):

commit 9118988317a9e9b08bbd8b512df5c6e8da562ec2
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Sat Oct 25 10:47:01 2014 -0400

     Bug: 12970 More fixes for S/MIME handling in EAS.

  .../lib/Horde/ActiveSync/Imap/Adapter.php          |    8 ++++----
  1 files changed, 4 insertions(+), 4 deletions(-)

http://github.com/horde/horde/commit/9118988317a9e9b08bbd8b512df5c6e8da562ec2
2014-10-25 14:42:17 Michael Rubinsky Comment #24 Reply to this comment
Can you post or email me directly both a signed and an encrypted 
message? All of my test emails work here, and the unit tests that 
detect if they are signed or encrypted currently pass.
2014-10-25 12:20:53 software-horde (at) interfasys (dot) ch Comment #23 Reply to this comment
And that's the header for the encrypted message:

User-Agent: Internet Messaging Program (IMP) H5 (6.2.2)
Content-Type: application/pkcs7-mime; smime-type=enveloped-data
Content-Description: S/MIME Encrypted Message
MIME-Version: 1.0
Content-Disposition: inline
Content-Transfer-Encoding: base64
2014-10-25 11:53:25 software-horde (at) interfasys (dot) ch Comment #22 Reply to this comment
Same MessageClass for a signed message: IPM.Note
2014-10-24 23:09:59 software-horde (at) interfasys (dot) ch Comment #21 Reply to this comment
No, not yet.
I've sent an encrypted message from Horde and the MessageClass is 
still IPM.Note

INFO: [8022] Horde_Core_ActiveSync_Driver::getMessage(INBOX, 3301)
INFO: [8022] Sending HTML Message.
INFO: FETCHING VERB
INFO: RETURNING VERB
DEBUG: [8022] O     <Commands>
DEBUG: [8022] O      <Add>
DEBUG: [8022] O       <ServerEntryId>
DEBUG: [8022] O        3301
DEBUG: [8022] O       </ServerEntryId>
DEBUG: [8022] O       <Data>
DEBUG: [8022] O        <POOMMAIL:To>
DEBUG: [8022] O         recipient@domain.tld
DEBUG: [8022] O        </POOMMAIL:To>
DEBUG: [8022] O        <POOMMAIL:From>
DEBUG: [8022] O         sender@domain.tld
DEBUG: [8022] O        </POOMMAIL:From>
DEBUG: [8022] O        <POOMMAIL:Subject>
DEBUG: [8022] O         hordesmimepatch
DEBUG: [8022] O        </POOMMAIL:Subject>
DEBUG: [8022] O        <POOMMAIL:Reply-To>
DEBUG: [8022] O         recipient@domain.tld
DEBUG: [8022] O        </POOMMAIL:Reply-To>
DEBUG: [8022] O        <POOMMAIL:DateReceived>
DEBUG: [8022] O         2014-10-24T22:54:17.000Z
DEBUG: [8022] O        </POOMMAIL:DateReceived>
DEBUG: [8022] O        <POOMMAIL:DisplayTo>
DEBUG: [8022] O         recipient@domain.tld
DEBUG: [8022] O        </POOMMAIL:DisplayTo>
DEBUG: [8022] O        <POOMMAIL:ThreadTopic>
DEBUG: [8022] O         hordesmimepatch
DEBUG: [8022] O        </POOMMAIL:ThreadTopic>
DEBUG: [8022] O        <POOMMAIL:Importance>
DEBUG: [8022] O         1
DEBUG: [8022] O        </POOMMAIL:Importance>
DEBUG: [8022] O        <POOMMAIL:Read>
DEBUG: [8022] O         0
DEBUG: [8022] O        </POOMMAIL:Read>
DEBUG: [8022] O        <POOMMAIL:MessageClass>
DEBUG: [8022] O         IPM.Note
DEBUG: [8022] O        </POOMMAIL:MessageClass>
DEBUG: [8022] O        <POOMMAIL:InternetCPID>
DEBUG: [8022] O         65001
DEBUG: [8022] O        </POOMMAIL:InternetCPID>
DEBUG: [8022] O        <AirSyncBase:NativeBodyType>
DEBUG: [8022] O         1
DEBUG: [8022] O        </AirSyncBase:NativeBodyType>
DEBUG: [8022] O        <AirSyncBase:Attachments>
DEBUG: [8022] O         <AirSyncBase:Attachment>
DEBUG: [8022] O          <AirSyncBase:DisplayName>
DEBUG: [8022] O           S/MIME Encrypted Message
DEBUG: [8022] O          </AirSyncBase:DisplayName>
DEBUG: [8022] O          <AirSyncBase:FileReference>
DEBUG: [8022] O           INBOX:3301:1
DEBUG: [8022] O          </AirSyncBase:FileReference>
DEBUG: [8022] O          <AirSyncBase:Method>
DEBUG: [8022] O           1
DEBUG: [8022] O          </AirSyncBase:Method>
DEBUG: [8022] O          <AirSyncBase:EstimatedDataSize>
DEBUG: [8022] O           15351
DEBUG: [8022] O          </AirSyncBase:EstimatedDataSize>
DEBUG: [8022] O          <AirSyncBase:IsInline>
DEBUG: [8022] O           1
DEBUG: [8022] O          </AirSyncBase:IsInline>
DEBUG: [8022] O         </AirSyncBase:Attachment>
DEBUG: [8022] O        </AirSyncBase:Attachments>
DEBUG: [8022] O        <POOMMAIL:Flag/>
DEBUG: [8022] O        <POOMMAIL:ContentClass>
DEBUG: [8022] O         urn:content-classes:message
DEBUG: [8022] O        </POOMMAIL:ContentClass>
DEBUG: [8022] O        <POOMMAIL:Categories/>
DEBUG: [8022] O       </Data>
DEBUG: [8022] O      </Add>
INFO: [8022] Updating state during change
DEBUG: [8022] O     </Commands>
Does this fix it for you then?
2014-10-24 20:53:27 Michael Rubinsky Comment #20 Reply to this comment
Does this fix it for you then?
2014-10-24 20:52:42 Git Commit Comment #19 Reply to this comment
Changes have been made in Git (master):

commit 5a29cb2215a357c9674147615399da22f05b260c
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Fri Oct 24 16:49:16 2014 -0400

     Bug: 12970 Differentiate between signed and encrypted messages.

  .../lib/Horde/ActiveSync/Imap/Adapter.php          |    6 ++-
  .../lib/Horde/ActiveSync/Imap/Message.php          |   26 ++++++++++--
  framework/ActiveSync/lib/Horde/ActiveSync/Mime.php |   41 +++++++++++++++----
  3 files changed, 58 insertions(+), 15 deletions(-)

http://github.com/horde/horde/commit/5a29cb2215a357c9674147615399da22f05b260c
2014-10-23 23:39:50 software-horde (at) interfasys (dot) ch Comment #18 Reply to this comment
I've just checked
framework/ActiveSync/lib/Horde/ActiveSync/Imap/Adapter.php

The default MessageClass is IPM.Note
If the message is signed, then it's set to IPM.Note.SMIME.MultipartSigned
but it's never set to IPM.Note.SMIME which I think is how encrypted 
messages are identified.

iOS probably ignores that element, but I think BlackBerry 10 is using 
it in order to determine how to parse the message.
2014-06-16 19:08:58 Michael Rubinsky Comment #17 Reply to this comment
Can you also send me one not sent from a BB client?
2014-06-16 18:14:36 software-horde (at) interfasys (dot) ch Comment #16 Reply to this comment
I need your public key in order to send you an encrypted message.
Where do I find it?
Sorry. Must have missed this comment. I'll send you a signed email 
directly and you can import it from that.
OK, I've just sent you an encrypted message from a .co.uk domain.
2014-06-16 15:01:03 Michael Rubinsky Comment #15 Reply to this comment
I need your public key in order to send you an encrypted message. 
Where do I find it?
Sorry. Must have missed this comment. I'll send you a signed email 
directly and you can import it from that.
2014-05-28 18:13:17 software-horde (at) interfasys (dot) ch Comment #14 Reply to this comment
Can you send me an encrypted email from both IMP and from your device?

I still don't have access to a BB that supports s/mime, but I'll at 
least try to look at the messages and see what I can figure out. 
FWIW though, we pass the raw mime data directly when it's 
signed/encrypted so I'm not sure what can be done...
I need your public key in order to send you an encrypted message. 
Where do I find it?
2014-04-07 17:27:02 Michael Rubinsky Comment #13 Reply to this comment
In Summary:
- Messages sent from Thunderbird or the phone can be decrypted from 
the phone (Yeah! :))
- Messages sent from IMP can't be decrypted by the phone
- Messages sent from the phone can't be decrypted by IMP
Can you send me an encrypted email from both IMP and from your device?

I still don't have access to a BB that supports s/mime, but I'll at 
least try to look at the messages and see what I can figure out. FWIW 
though, we pass the raw mime data directly when it's signed/encrypted 
so I'm not sure what can be done...
2014-04-07 17:10:03 software-horde (at) interfasys (dot) ch Comment #12 Reply to this comment
In Summary:
- Messages sent from Thunderbird or the phone can be decrypted from 
the phone (Yeah! :))
- Messages sent from IMP can't be decrypted by the phone
- Messages sent from the phone can't be decrypted by IMP
2014-04-07 16:51:34 software-horde (at) interfasys (dot) ch Comment #11 Reply to this comment
Does this fix at least the ActiveSync client related problems with verifying?
This seems to fix one use case.
Messages sent from the phone which are placed in the sent folder can 
now be decrypted by the phone.
2014-04-07 16:02:54 Git Commit Comment #10 Reply to this comment
Changes have been made in Git (master):

commit 71ffec6a7d5d9a1bd626febdb3bec09e9d955451
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Mon Apr 7 12:01:48 2014 -0400

     One more place to accept the deprecated x-pkcs7-* subtypes.

     Bug: 12970

  .../lib/Horde/ActiveSync/Imap/Message.php          |    1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

http://github.com/horde/horde/commit/71ffec6a7d5d9a1bd626febdb3bec09e9d955451
2014-04-07 15:58:43 Michael Rubinsky Comment #9
State ⇒ Feedback
Reply to this comment
Does this fix at least the ActiveSync client related problems with verifying?
2014-04-07 15:57:25 Git Commit Comment #8 Reply to this comment
Changes have been made in Git (master):

commit 1082153498149b1653ab4f2af67eff0d86c62de8
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Mon Apr 7 11:55:50 2014 -0400

     Parse x-pkcs7-mime as well.

     Possible fix for Bug: 12970

  .../lib/Horde/ActiveSync/Imap/Message.php          |    3 ++-
  1 files changed, 2 insertions(+), 1 deletions(-)

http://github.com/horde/horde/commit/1082153498149b1653ab4f2af67eff0d86c62de8
2014-03-21 12:31:03 Jan Schneider Assigned to Michael Rubinsky
State ⇒ Assigned
 
2014-03-07 16:00:13 software-horde (at) interfasys (dot) ch Comment #7 Reply to this comment
I did a bunch of new tests using the latest version of the libraries.
All accounts are using Horde's activesync v2.12.4
"Sent message" is the one in the Sent box

Sending from Thunderbird
--------------------------------------------------
Sent message can be decrypted by IMP

Received message can be decrypted by IMP

Sent message CANNOT be decrypted by the phone

* NEW* Received message can now be decrypted by the phone

Sending from IMP
----------------------------------------
Sent message can by decrypted by IMP

Received message can be decrypted by IMP

Sent message CANNOT by decrypted by the phone: "The S/MIME message 
can't be opened because it isn't valid"

Received message CANNOT be decrypted by phone. I get the MIME 
Encrypted message attachment which can't be viewed

Sending from Phone
---------------------------------------
Sent message CANNOT by decrypted by IMP: Here is what's shown in IMP:
"smime.p7m (10 KB)
The data in this part has been encrypted via S/MIME.
application/x-pkcs7-mime X-pkcs7-mime (4 KB)
The data in this part has been encrypted via S/MIME.
Could not decrypt S/MIME data."

Received message CANNOT be decrypted by IMP: "Could not decrypt S/MIME data."

Sent message CANNOT by decrypted by the phone: The attachment is named 
smime.p7m and there is no viewer for it on the device.

Received message CANNOT be decrypted by phone: The attachment is named 
smime.p7m and there is no viewer for it on the device.


All messages can be decrypted by Thunderbird, so it seems the messages 
are correctly assembled. Some are just not properly retrieved by 
either IMP or the phone.

The changelog for IMP 6.1.7 mentions " Improved support for broken 
S/MIME messages.". If you feel BlackBerry's implementation is breaking 
RFCs or common practice, let me know and I'll pass along any feedback 
you have.

2014-02-12 18:13:31 software-horde (at) interfasys (dot) ch Comment #6 Reply to this comment
I've looked at the debug logs

The problems with signature verification were due to an open_basedir 
restriction since the OpenSSL CA certs were not in the path.

When IMP fails to decrypt a message, there is nothing at all in the logs.
2014-02-12 17:12:00 software-horde (at) interfasys (dot) ch Comment #5 Reply to this comment
Headers from TB
Content-Type: application/pkcs7-mime; name="smime.p7m"; 
smime-type=enveloped-data
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="smime.p7m"
Content-Description: S/MIME Encrypted Message

Headers from BB
Content-Type: application/x-pkcs7-mime; name=smime.p7m;
  smime-type=enveloped-data
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7m

I notice a different content type, the lack of quotes and the carriage 
return in the middle of the Content-Type header in the BB version

Messages themselves are presented differently. It's a block in the TB 
message, it's one line in the BB message.
2014-02-12 16:59:00 software-horde (at) interfasys (dot) ch Comment #4 Reply to this comment

[Show Quoted Text - 12 lines]
The device is managed through BlackBerry's new BES Cloud solution 
which supports SMIME.

I could provide a test account which works with clients on BlackBerry, 
Android and iOS or you could try registering for a trial since you're 
developing software which BES can connect to.

2014-02-12 15:47:53 Michael Rubinsky Comment #3 Reply to this comment
On BlackBerry 10 device via ActiveSync
- None of the messages are identified as SMIME as far as I can tell
- Encrypted message contains an attachment which is detected as a   
"MIME Encrypted Message" and there is a green "tick" indicating it's 
valid, but when tapping on it, the device indicates that there is no 
viewer for it on the device.
Is the BB10 managed through a BDS profile, or just pure ActiveSync 
connected to Horde? If the latter, SMIME is not available, as it is 
only available, as SMIME is only available when it's a managed device 
through BES, AFAIK. If the former, I really don't know, as I don't 
have access to BES to test.
2014-02-12 14:18:04 software-horde (at) interfasys (dot) ch Comment #2 Reply to this comment
I'll try to add some debug messages from the logs later on and will 
compare raw messages to see if I can find differences.
2014-02-12 14:15:44 software-horde (at) interfasys (dot) ch Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ Problems with S/MIME messages when sent to or received from a BlackBerry 10 device using BES
Queue ⇒ Horde Framework Packages
Milestone ⇒
Patch ⇒ No
Reply to this comment
With the latest release of all the core modules, I did 4 tests:
#1 Send a S/MIME signed message from Thunderbird
#2 Send a S/MIME encrypted message from Thunderbird
#3 Send a S/MIME signed message from a BlackBerry 10 device
#4 Send a S/MIME encrypted message from a BlackBerry 10 device

I then used Thunderbird, IMP and a BlackBerry 10 device to check the messages.

On Thunderbird
No problem with any of the messages. They are identified as signed or 
encrypted and are successfully verified/decrypted.

On IMP
- Signed message #1 shows this error message: "Message verified 
successfully but the signer's certificate could not be verified". The 
certificate is in the addressbook and the public key is stored in IMP 
though.
- Encrypted message #2 is successfully decrypted.
- Signed message #3 shows this error message: "Verification failed - 
an unknown error has occurred.". The public key is not in the keyring 
and IMP doesn't offer to install it (but that could be because of a 
problem with Turba's default addressbook)
- Encrypted message #4 shows: "Could not decrypt S/MIME data.". No 
error in the logs.

On BlackBerry 10 device via ActiveSync
- None of the messages are identified as SMIME as far as I can tell
- Encrypted message contains an attachment which is detected as a   
"MIME Encrypted Message" and there is a green "tick" indicating it's 
valid, but when tapping on it, the device indicates that there is no 
viewer for it on the device.

Saved Queries