davmail
davmail copied to clipboard
Closes SourceForge #85 LDAP userCertificate
Implemented user certificate retrieval from GAL
First, thank you for your contribution.
I have a few questions:
- I noticed you forced ContactDataShape to AllProperties with retrieves all properties instead of only the supported list, are you sure there is no other way to retrieve just certificate fields in addition to current list ?
- Can you please confirm that msexchangecertificate value comes back as a single line value ? For photo support I had to take into account multiple lines
- Did you check both Carddav and LDAP support ?
- Can you please provide additional test cases ?
Regards,
Hello,
-
If I understand the process of user certificate retrieval correctly, from GAL are contact data retrieved via ResolveNames method. (
EwsExchangeSession.galFind(...), https://docs.microsoft.com/en-us/exchange/client-developer/web-service-reference/resolvenames-operation) ResolveNames method does not support in request additional attributes as e.g. FindItem method does. I've enhanced current method. -
Code updated - MSExchangeCertificate read via getElementText() to retrieve coalesced content. In my test cases MSExchangeCertificate is always one line.
-
I have tested LDAP only
-
My Test Case: Setup: thunderbird -> davmail -> Exchange Precondition: User certificate not stored in thunderbird Test Case: Write encrypted mail to user (choose Security -> Encrypt This Message), then View -> View Security Info Expected Result: Result window shows valid user certificate
Do you expect to write new tests in src/test?
I've experimented with FindPeople method, which has similar attributes as FindItem.
Result: I did not find the way, how to retrieve user certificate. Also Field URIs are different than in FindItem.
FindItem cannot be used to retrieve data from GAL, because FindItem does not support parameter <t:DistinguishedFolderId Id="directory"/>
Method GetPersona did not return user certificate too.
So it looks like, that method ResolveNames with ContactDataShape="AllProperties" is the only way how to retrieve user certificate from GAL via EWS.
Sorry for the delay, should be able to look into this again soon.
I will probably make it an optional feature first as I faced regressions during my initial tests
I can confirm that this patch fixes the certificate retrieval issue over LDAP for my exchange server which works over office365. Thanks @krutelp now i can send Mime encrypted mails easily