Commit graph

1228 commits

Author SHA1 Message Date
Enrique J. Hernández 4c7bd6dd76 Merge pull request #208 from zentyal/jgarcia/wocontext-fun
User context activation when cached
2015-11-18 06:56:16 +01:00
Javier Amor García 88a74bcb5c Do not save IPM.DistList messages 2015-11-16 13:56:31 +01:00
Enrique J. Hernández 0751c51b89 Merge pull request #204 from zentyal/jvalles/event-invitation-subjects
oc-calendar: Make invitation/update mails have the event name as subject
2015-11-09 23:35:22 +01:00
Jesús García Sáez 5f5b5d9273 oc: activate user context on initialization (for real)
Even with cached ones (completes cfab18e1b8)
2015-11-09 19:56:05 +01:00
Javier Amor García 08f05ac2ef sogo-openchange: Avoid compile warnings after changes in exchange.idl
The changes in the exchange.idl file from OpenChange has changed
some string pointers from 'const char *' to 'uint8_t *'.
This changeset cast them to avoid compilation warnings.
2015-11-09 19:08:51 +01:00
Juan Vallés 946665ff49 oc-calendar: Make invitation/update mails have the event name as subject
SOGo event notification mails add information to the event name in their
subject (e.g. _Event invitation: "foo"_). The client uses the mail
subject to create a copy of the event on the attendee's calendar, so we
need to strip out that extra information if we want the event to have
the proper name.
2015-11-09 10:28:46 +01:00
Enrique J. Hernández Blasco e0d49d2407 oc-mail: Check the number of uids fetched on synchroniseCache
Equals to the number of uids requested.

There are corner-cases when this is not happening, we don't know yet
why this is happening but IMAP server log should do the trick.

This avoids to launch a NSException trying to access an element
outside the array bounds.
2015-10-29 23:04:42 +01:00
Jesús García Sáez c8d05d41a5 Merge pull request #201 from zentyal/ejhernandez/sync-expunged-msgs-first-sync
oc-mail: Sync expunged messages on first cache sync
2015-10-26 19:37:01 +01:00
Jesús García Sáez 2937ba7f30 Merge pull request #200 from zentyal/ejhernandez/always-increase-cn-set-message-read-flag
oc-mail: Always increase the CN when setting the message read flag
2015-10-26 14:38:29 +01:00
Enrique J. Hernández Blasco 6f5bb3882c oc-mail: Sync expunged messages on first cache sync
There is a use case where this has caused crashes:

A message was hard-deleted using an IMAP client, this is the first
message you deleted in that folder and you have cleared offline
items in the client so a full sync is asked by upper layer.

In that situation, the SyncLastDeleteChangeNumber version property
is not set and return 0 in [getDeletedKeysFromChangeNumber:andCN:inTableType]
making OpenChange to crash while it is asking for deleted fmids
since a given change number.

This is a regression from 18d7070c4a.
2015-10-21 11:24:14 +02:00
Juan Vallés 8800cdf641 oc-calendar: force cache synchronisation for a message before aborting
Sometimes we're trying to get the `objectVersion` of a calendar message,
but this message's entry is not in the cache. The method
`synchroniseCache` won't work in this case, so we try to force the
synchronisation of that particular message in order to get the change
number before aborting.
2015-10-20 11:33:10 +02:00
Enrique J. Hernández Blasco d998786ea6 oc-mail: Always increase the CN when setting the message read flag
And perform the real IMAP operation on save method as described by
[MS-OXCFXICS] and [MS-OXCMSG] Section 2.2.3.3, these operations must be
committed when SaveChangesMessage is called.

As it is expected by Outlook to increase the change number when
performing the `SetMessageReadFlag` ROP, if it is not done, the client
tries indefinitely to store that.
2015-10-20 09:56:11 +02:00
Enrique J. Hernández a8e02b94d4 Merge pull request #193 from zentyal/jag/attach-has-content-id
oc-mail: Fixed false positive in [MAPIStoreAttachment hasContentId]
2015-09-29 19:24:41 +02:00
Javier Amor García c01b21e402 oc-mail: Fixed false positive in [MAPIStoreAttachment hasContentId]
This method does not longer returns true if the content id
was a empty string.
In some case the old false positive triggered the removal of
attachments when sending messages.
2015-09-28 13:06:30 +02:00
Jesús García Sáez bea2415fad Merge pull request #184 from zentyal/jvalles/double-digit-folders
Make folderKey encoding consistent
2015-09-23 18:30:18 +02:00
Enrique J. Hernández Blasco deca6e383a oc: Include 0x683d0040 as another unknown FAI message property
And returning right type.

We have sorted the FAI properties by number and set the available
name as a comment to ease the tracking afterwards.
2015-09-18 21:45:00 +02:00
Enrique J. Hernández Blasco f3ac7b8334 oc: Return FAI available properties on instance method as well
The operation RopFastTransferSourceCopyTo calls the available
properties for a message using the instance method. It seems the
preferred method by Outlook to synchronise a FAI message. OpenChange
calls the message to get the available properties, so the instance
method is called. As it is specialised to return the custom hack
FAI properties, we have to call that class method instead of using
generic one available at NSObject (MAPIStoreProperties) class.

This avoids crashing the Outlook client after we synchronise the
calendar folder after changing the timeframe view (eg from day view
to month view).
2015-09-18 21:40:01 +02:00
Juan Vallés ba68bd8935 Make folderKey encoding consistent
The folder names are encoded through the `asCSSIdentifier` and
`stringByEncodingImap4FolderName` functions when we store them as folder
keys. In addition, the prefix "folder" is added to the key.

The order in which these operations were done when storing the folder
keys (and reverted when retrieving them) wasn't consistent trough the
code. This led to problems such as creating twice a folder with a digit
at the beginning of its name.

The folder name goes now through the following operations when being
stored as a key (the retrieval reverts these in the reverse order):

 * `stringByEncodingImap4FolderName`
 * `asCSSIdentifier`
 * Add "folder" prefix
2015-09-15 09:57:30 +02:00
Enrique J. Hernández Blasco b075a306c6 oc-task: Save tasks from Outlook
It was not working because we try to save as component the
full calendar and its parent was nil. We have to save the calendar
itself to save the task in the personal calendar.
2015-09-10 17:26:41 +02:00
Javier Amor García 1fdb44b0a7 Fix some compilation warnings
The warnings were introduced in the fix for attachment with used
the filename extended parameter.

Also removed trailing whitespaces.
2015-09-08 15:39:59 +02:00
Jesús García Sáez 3868ce0fb1 Merge pull request #169 from zentyal/ejhernandez/increase-cn-setting-seen-flag
oc-mail: Increase Change Number after modifying seen flag
2015-09-07 18:46:18 +02:00
Jesús García Sáez fc82eb79f6 Merge pull request #175 from zentyal/ejhernandez/versions-msg-reload-if-needed
oc: load versionsMessage on setting up
2015-09-07 16:48:55 +02:00
Enrique J. Hernández Blasco 6280e4ded6 oc: Implement setReadFlag for MAPIStoreDBMessage
This is an utility for testing as I don't see any added value
for real scenario but according to [MS-OXCMSG] all messages
can have PidTagMessageFlags.
2015-09-04 16:16:00 +02:00
Enrique J. Hernández Blasco f19074334c oc: Use enum mapistore_error as returned value for setReadFlag 2015-09-04 16:15:05 +02:00
Enrique J. Hernández Blasco b702e40ebb oc: load versionsMessage on setting up
versionsMessage object could have outdated version in a root folder
in the following case:

* Download latest contents using FXBuffer
  * versionsMessage is updated by synchroniseCache
* OpenMessage from last FXBuffer
  * Setup versions message as root folder
* Get Predecessor Change List from that message

We could just reload if needed the versions message if something
is missing but I don't know if that situation fixes more than this
one.
2015-09-03 23:01:21 +02:00
Jesús García Sáez 24e3071e24 Merge pull request #170 from zentyal/jag/attachments-nolatin-filename
sogo-openchange: Support attachments with filename extended parameter
2015-08-26 15:15:15 +02:00
Jesús García Sáez 1f29198495 Merge pull request #172 from zentyal/ejhernandez/save-draft-right-change-key
oc-mail: Return right change key after saving a draft mail
2015-08-26 13:37:42 +02:00
Enrique J. Hernández Blasco 47859b76d6 oc-mail: Return right change key after saving a draft mail
After saving a draft mail (this is done automatically by Outlook)
a GetProps call is done checking the PidTagChangeKey has been
updated properly. Without this patch, it returned MAPI_E_NOT_FOUND.

With this patch, we addressed that problem and we have updated
the Predecessor Change List metadata for the draft mail with the
change key provided by the client to avoid conflicting messages
whenever it is possible.
2015-08-24 23:42:38 +02:00
Enrique J. Hernández Blasco 3a60b6e38e oc-mail: Implement ChangeNumber >= restriction
And warn when other operator than > or >= is used.

This allows OpenChange to query for change numbers starting from
a given point.
2015-08-24 15:39:05 +02:00
Javier Amor García ae3ac0a09a oc-mail: Support attachments with filename extended parameter
The attachments which used a extended parameter for their filename
('filename*=') where silently dropped.
This was because MAPIStore was only looking for no-extended filename
parameter.
The solution is using the 'filename' from the
SOGOExtension of the NSDictionary interface.
2015-08-24 14:19:47 +02:00
Enrique J. Hernández Blasco 27b9b7bfa7 oc-mail: Increase Change Number after modifying seen flag
It is required when you are using SynchronizeImportReadStateChanges ROP
to update the MetaTagCnsetRead meta property.

See [MS-OXCFXICS] Section 3.2.5.9.4.6

This could lead to sync issues.
2015-08-10 18:38:39 +02:00
Enrique J. Hernández Blasco 321672e2c3 oc: Update predecessor change list on saving
There were cases where only the change key was updated (GCS) or
others were the change key was updated with wrong info.

This changeset has as goal to update the predecessor change list
and, change key if required, on saving taking into account the latest information
given by the client in high level ROPs such as ImportMessageMove
or SetProperties, and merge it with information provided by the server
backend (IMAP server, SOGo DB) using `synchroniseCache`.

For more details about `PidTagChangeKey` and `PidTagPredecessorChangeList`
property values check [MS-OXCFXICS] Section 2.2.1.2
2015-08-04 08:41:38 +02:00
Enrique J. Hernández Blasco 8d9b54815c oc: Receive new predecessor change list parameter on move copy op
This is to apply new API introduced by 85e2d7c commit in OpenChange
repository.
2015-08-04 08:41:38 +02:00
Enrique J. Hernández Blasco 1dbfc18379 oc: Update to new XID structure definition
From ede986f commit from OpenChange repository.
2015-08-04 08:41:38 +02:00
Enrique J. Hernández Blasco 2aba083147 oc: Update ChangeNumber after setting folder properties
As required by operations like SynchronizationImportHierarchyChanges
a new change number must be generated when a change in a folder
is set. This affects to subfolders.

See [MS-OXCFXICS] Section 3.2.5.9.4.3 for details.
2015-07-30 10:07:55 +02:00
Jesús García Sáez e38b0ac64f Merge pull request #163 from Zentyal/ejhernandez/subject-fallback
oc-mail: Fallback to PidTagSubject unicode when creating new mail
2015-07-28 17:16:11 +02:00
Enrique J. Hernández Blasco 10ac445f7c oc-mail: Fallback to PidTagSubject unicode when creating new mail
Some clients such as OpenChange client does not send the following
properties PidTagNormalizedSubject or PidTagSubjectPrefix as
suggested by [MS-OXCMAIL].
2015-07-27 11:18:14 +02:00
Enrique J. Hernández Blasco c5b5a4243d oc: Fix compilation warning in MAPIStoreContext 2015-07-25 09:56:21 +02:00
Jesús García Sáez 7bde181d3f oc: check ret value get_new_folderID
On [MAPIStoreContext idForObjectWithKey: key inFolderUrl: url] check the ret value
of mapistore_indexing_get_new_folderID. This should never happen (oh my...) but
if this happens it will be reported
2015-07-21 19:47:17 +02:00
Jesús García Sáez 1336a1d5a8 oc: remove useless mapistore_indexing call
[mapping registerURL ...] will insert the mappingId in indexing database
there is no need to call, again, mapistore_indexing_record_add_mid
2015-07-21 19:47:17 +02:00
Jesús García Sáez c9f2fe2f85 oc-folder: user context activation on rootFolders
Several fixes related with userContext activation
2015-07-21 11:08:03 +02:00
Jesús García Sáez 10bc15d41d oc-folder: activate user context when needed
Before creating sogo objects
2015-07-21 11:08:02 +02:00
Jesús García Sáez 393b6d5128 oc-folder: simplify lookupFolder method
use activate and no need to set wocontext, it's already set properly
2015-07-21 11:08:02 +02:00
Jesús García Sáez 68ae978b13 oc-mail: activate user context needed
Before creating new sogo objects
2015-07-21 11:08:02 +02:00
Jesús García Sáez f4e3b98042 Nothing changed: format and hoarding code removed 2015-07-21 11:08:02 +02:00
Jesús García Sáez cfab18e1b8 oc: activate user context on initialization 2015-07-21 11:08:02 +02:00
Jesús García Sáez 7d2f96e96b oc: use activate instead of activateWithUser
100% of the times the user is the one that MAPIStoreUserContext
already has, so no need to have it as an argument.
2015-07-15 11:26:05 +02:00
Jesús García Sáez 3bf7afdfb7 oc: remove and disable userContext after each call
This adds [MAPIStoreUserContext activate] method to use
it instead of activateWithUser.

A cleanup operation is executed after each public function
so there won't be any conflicts with future calls.

In practice, this will deactivate the current user context set on
MAPIApp, this means two things: (1) set nil as current user context
on MAPIApp and (2) remove woContext from current thread dictionary
2015-07-15 11:25:45 +02:00
Jesús García Sáez 503a70118f oc: remove tabs and unused code 2015-07-14 19:19:58 +02:00
Jesús García Sáez 928b6b596e oc: OC_DEBUG inside macros
These macros are used before and after every performed
operation
2015-07-14 19:19:51 +02:00
Enrique J. Hernández Blasco 62b16f4ef3 oc: Check PidTagObjectType before dereferencing on ModifyRecipients
This is crashing when the PidTagObjectType property is set for
some recipient and not for others.

If the property is missing, then no object type for the recipient
is assumed.
2015-06-29 23:53:12 +02:00
Jesús García Sáez c1b0fd53dc Merge pull request #100 from Zentyal/jag/recipient-from-client-call
mapistore: can use client data to get recipient address
2015-06-08 14:32:31 +02:00
Javier Amor García 7540cc3e33 oc: can use client data to get recipient address
Before this change, the recipient address was only extracted from the sogo
user object. This made mail to groups undeliverable.
Now if we do not have mail addresses from user object,
we try to use parameters from the client call.
2015-06-02 15:07:50 +02:00
extrafu 30103532ae Merge pull request #84 from Zentyal/master
sogo-openchange fixes
2015-05-21 08:46:21 -04:00
Enrique J. Hernández Blasco e2ef0103c4 oc-calendar: Fix regression on AppointmentTimeZoneDefinitionStartDisplay
Introduced by ebe2a466e7 in PR #132 when the event is not
all day neither recurrent one.

The fix is just to initialise to nil when it is a normal event
and it returns NOT_FOUND for this property.
2015-05-19 00:26:42 +02:00
Julio J. García Martín e6d1a00928 Merge pull request #135 from Zentyal/jvalles/reply-requested-return-values
oc-calendar: Fix property values of invitation responses
2015-05-18 12:48:37 +02:00
Juan Vallés 0a285eedec oc-calendar: Fix property values of invitation responses
The value of `PidTagResponseRequested` property in the invitation mail
wasn't being set properly, while the `PidTagReplyRequested` property
wasn't being set at all. This caused invitation response mails not to be
sent. Both properties are expected to be `true`.
2015-05-11 12:58:06 +02:00
Julio J. García Martín 582c24afc5 Merge pull request #133 from Zentyal/ejhernandez/flush-cache
oc-mail: Flush IMAP hierarchy cache to update Outlook folders
2015-05-07 09:53:49 +02:00
Enrique J. Hernández 92ab267db5 Merge pull request #131 from Zentyal/ejhernandez/set-restriction-on-name-for-mail-folders
oc-mail: Support restricitions on name for MAPIStoreMailFolderTable
2015-05-07 02:03:39 +02:00
Enrique J. Hernández Blasco 15f95c4956 oc-mail: Support restricitions on name for MAPIStoreMailFolderTable
This allows us to search for a subfolder in a mail
folder successfully. This is happening, for instance, on folder creation.
2015-05-05 23:34:09 +02:00
Enrique J. Hernández Blasco 2d65b75b56 oc-mail: Flush IMAP hierarchy cache to update Outlook folders
This fixes two scenarios:

* An IMAP subfolder has updated its hierarchy when it is asked
  to be synchronised
* An IMAP root folder is created on Outlook when you logon. OpenChange
  changes are required to be refreshed on synchronisation.
2015-05-05 23:30:12 +02:00
Juan Vallés ebe2a466e7 oc-calendar: Compute PidLidAppointmentDefinitionStartWhole for all-day events 2015-05-05 10:29:24 +02:00
Juan Vallés 7e89c43919 oc-calendar: Compute time offset in floating time in all-day recurring events 2015-05-05 10:29:24 +02:00
Julio J. García Martín dc5237e92e Merge pull request #123 from Zentyal/ejhernandez/no-mapping-creation-root-folder
oc: Do not create indexing entry for a root folder
2015-05-04 11:10:47 +02:00
Ludovic Marcotte f2b5f5917b Fixed dot notation 2015-04-27 15:02:00 -04:00
Ludovic Marcotte dfb960eac4 Disabled -Werr for now 2015-04-27 14:57:44 -04:00
Julio García 08501dacaa Merge branch 'master' into contribute-back
Conflicts:
	NEWS
2015-04-24 16:53:05 +02:00
Jesús García Sáez b7907d654d Merge pull request #127 from Zentyal/jkerihuel/asynchronous-notifications
[oxcnotif] Delete deprecated notification code
2015-04-22 12:45:20 +02:00
Julio García 78f5f60b16 Revert "oc: monkeypatched NGImap4Connection class from sope"
This reverts commit 24e35103ff.
2015-04-20 13:15:22 +02:00
Julio García 255b3d2d00 Revert "oc: NGImap4Connection:fetchUids don't delete RawResponse"
This reverts commit c410a9fc3f.
2015-04-20 13:15:13 +02:00
Julio García 1d9e085658 Revert "oc: NGImap4Connection:fetchUids changed error messages"
This reverts commit 41320a4813.
2015-04-20 13:15:04 +02:00
Enrique J. Hernández Blasco 8fce211172 Merge pull request #125 from Zentyal/jgarcia/multidomain-outlook-entryId
All this basically is to make it work on multidomain environment
the Reply all functionality of emails but I'm sure there are more use cases
as an Outlook client that don't work nowadays without this patch.

More info on commit message but basically it was that we were using user
instead of user@domain.com in several places.
2015-04-17 11:33:21 +02:00
Enrique J. Hernández Blasco 030d343432 oc: Do not create indexing entry for a root folder
This is done by OpenChange after this patchset is merged:

https://github.com/openchange/openchange/pull/273
2015-04-16 23:23:32 +02:00
Jesús García Sáez 58449076a3 Merge branch 'jacalvo/fix-optional-rec-type' 2015-04-16 19:55:19 +02:00
José Antonio Calvo 539060d252 oc-calendar: Fix recipient type for invitations
Take into account optional attendees setting the recipient
type to MAPI_CC when they have the iCal role set to OPT-PARTICIPANT
instead of harding always MAPI_TO (required) as was done before.

This is a complementary fix for: https://github.com/Zentyal/sogo/pull/108
2015-04-16 19:47:47 +02:00
Jesús García Sáez d3bf3dcd8f Merge pull request #122 from Zentyal/ejhernandez/enforce-mapping-subfolder
oc: Enforce the folder creation mapping when the FID exists
2015-04-16 18:05:29 +02:00
Julien Kerihuel d4930a7960 oc: Remove deprecated notification code. 2015-04-16 16:04:47 +02:00
Jesús García Sáez 49ee0850e1 Merge pull request #118 from Zentyal/ejhernandez/return-sorted-events
oc: return last modified messages when sorted by PidMessageTagDeliveryTime

This change is required as oxcfxics is asking for sorting
using this property.

We fake this property on GCS folders (Tasks, Calendar, Contacts)
using c_lastmodified column.
2015-04-16 12:50:20 +02:00
Jesús García Sáez 0f432b654f oc: Fix internal EntryIds properties on multidomain
PidTag*EntryId properties were not being generated (which contain
the email address and so on). Functionality on Outlook clients like
"Reply All" were not working because of this (probably a lot more
stuff related with email addresses).

With multidomain support enabled outlook clients will use full email
address (e.g. user@domain.com) as login.

This change is needed because we were performing ldap queries on samdb
using (sAMAccountName=UIDFieldName), being UIDFieldName the parameter
configured in sogo.conf for that source. In multidomain environment
this field could be `sAMAccountName` but it could not. Actually the
more logical scenario will be to use `uid` field here (which will be
just `user`, without the `@domain.com` part).

SOGoUserManager will return `sAMAccountName` if the contact has it
(in Outlook environment that means always) so it can (and must) be
used to query samdb in MAPIStoreSamDBUtils properly.

TL;DR: use sAMAccoutName instead of uid to query samdb
2015-04-16 11:32:24 +02:00
Jesús García Sáez 1d6f1a83af use full login for sogo_cache_folder tables
So when multidomain is enabled we will have tables like
sogo_cache_folder_user_A_domain_D_com instead of just
sogo_cache_folder_user

If multidomain is disabled the folders will still be like
sogo_cache_folder_user
2015-04-14 13:18:23 +02:00
Enrique J. Hernández Blasco bddd67fb93 oc: Enforce the folder creation mapping when the FID exists
We believe the folder ID OpenChange is sending us is new
and we keep the indexing database properly updated.

Although the solution is not elegant, this could avoid
inconsistencies between what the client stores and the
relation in the MAPIStore backend.
2015-04-13 11:48:42 +02:00
Julio García 479bbce7d0 Merge pull request #116 from Zentyal/ejhernandez/soft-deleted-sync
Soft deleted mail messages sync
2015-04-10 10:27:48 +02:00
Julio J. García Martín 69b06d3c7a Merge pull request #113 from Zentyal/jag/show-internet-headers
Support for PidTagTransportMessageHeaders property
2015-04-10 10:02:00 +02:00
Enrique J. Hernández Blasco 95a8a9316a oc: Use new OC_DEBUG macro
Avoiding the usage of __FUNCTION__ and __LINE__
and more related with the logging system is being in place
for OpenChange.

As well as set the proper level to some debug messages.
2015-03-27 11:12:40 +01:00
Enrique J. Hernández Blasco 1ee47b1ee2 oc: return last modified messages when sorted by PidMessageTagDeliveryTime
This change is required as oxcfxics is asking for sorting
using this property.

We fake this property on GCS folders (Tasks, Calendar, Contacts)
using c_lastmodified column.
2015-03-27 10:27:16 +01:00
Enrique J. Hernández Blasco dfde498b7c oc-mail: Include Deleted flagged messages on syncing cache
This gives an accurate value for SyncLastDeletedMessage
2015-03-26 22:45:13 +01:00
Enrique J. Hernández Blasco 06476abdf7 oc-mail: return soft-deleted mails while syncing
As well as hard deleted

As explained in [MS-OXCFXICS] Section 2.2.1.3.1, the
property MetaTagIdsetDeleted must include both types
of messages and this idset is filled with the return
value of this message.
2015-03-26 22:05:43 +01:00
Jesús García Sáez dc869ce106 oc-mail: Support for PidTagTransportMessageHeaders property
This property is needed to show the 'Internet Headers' in Outlook.
Outlook 2010 shows them in the properties dialog of a message.
Outlook 2007 show them in message options section from context menu
of a mail message.

The property is defined in [MS-OXOMSG] section 2.2.1.61.

The property is formed concatenating the mail message headers
properly mime encoded.

The headers are appended in no defined order.
2015-03-26 19:26:48 +01:00
Enrique J. Hernández Blasco a47f1de607 oc-mail: Update place for Sharing Flavour prop values
It has been moved in OpenChange
2015-03-26 14:18:34 +01:00
Jesús García Sáez 09aed26f10 Merge pull request #114 from Zentyal/ejhernandez/fix-interleaving-creating-folder
As it happened with dba17fb if we interleave requests
from different users while creating a folder we can
create the folder in other user's mailbox as latest
activeUser is the one from latest sogo_context_get_root_folder
call.

This is for me a lack of right design and a workaround
only fixing this issue but not the root cause.
2015-03-25 17:15:05 +01:00
Enrique J. Hernández Blasco 82fb03b67b oc-mail: Ensure we are creating folder to the right user
As it happened with dba17fb if we interleave requests
from different users while creating a folder we can
create the folder in other user's mailbox as latest
activeUser is the one from latest sogo_context_get_root_folder
call.

This is for me a lack of right design and a workaround
only fixing this issue but not the root cause.
2015-03-25 16:53:42 +01:00
Enrique J. Hernández Blasco f9c8661fe6 oc-mail: Use constant names in props value
This gives to the developer more information about
the property values for PidLidSharingFlavor and
PidLidSharingCapabilities.
2015-03-25 10:12:15 +01:00
Enrique J. Hernández Blasco 661b6694af oc-mail: Fix several sharing properties managing
* PidNameXSharingFlavor is used by Outlook 2010 so we have
  to store it
* 0x5100 is used although it is not in spec as Sharing Flavour
  value when the request is denied from a message where
  Request + Invitation was sent.
* Return properly PidNameXSharingCapabilities and PidNameXSharingFlavor
  as it is an string representation of a hex number
* Try to guess proper sharing flavour value when it is missing
2015-03-25 10:12:15 +01:00
Enrique J. Hernández Blasco 514b1c03be oc-mail: Store request properties
Save them in extra properties from folder container.

This is required because the client once a request is accepted
or denied sets these two properties and save the message again.
As we cannot modify an IMAP message, we use this utility.

See [MS-OXSHARE] Section 3.1.4.3 for details.
2015-03-25 10:12:15 +01:00
Enrique J. Hernández Blasco a663fdd260 oc-mail: Give support to store extra properties in versions message
This is handy when you want to store properties once a mail
has hit the server and thus cannot be changed.
2015-03-25 10:12:15 +01:00
Jesús García Sáez 0db16aedb1 Merge pull request #112 from Zentyal/ejhernandez/fix-crash-invalid-ics
A failure in parsing an ICS makes return a nil calendar
object. Instead of creating an appointment with nil
information which can lead to crashes like the one
generated creating PidLidCleanGlobalObjectId property.

We return an empty message with no information which is
taken into account in Outlook but not displayed like
in SOGo webmail does.
2015-03-24 19:15:05 +01:00
Enrique J. Hernández Blasco 6204aebf2c oc-calendar: do not crash with invalid events
A failure in parsing an ICS makes return a nil calendar
object. Instead of creating an appointment with nil
information which can lead to crashes like the one
generated creating PidLidCleanGlobalObjectId property.

We return an empty message with no information which is
taken into account in Outlook but not displayed like
in SOGo webmail does.
2015-03-23 23:57:33 +01:00
Enrique J. Hernández Blasco 8ee2303e78 oc: Empty ACL from a folder works with several users
The `[SOGoFolder:aclUsers]` returns a reference to a `NSArray`
which is being modified in the `for` loop making fail when
more than one user is in the ACL with `NSRangeException`.
2015-03-19 00:06:14 +01:00
José Antonio Calvo 2668bc313c oc-calendar: Fix event invitations for optional attendees
Outlook sets recipient type of Required attendees as MAPI_TO and
optional ones as MAPI_CC, so the fix is just to not only iterate
over the "to" list of recipients but also the "cc" one. We're
also setting the proper iCal value for this case (OPT-PARTICIPANT
instead of REQ-PARTICIPANT)

In [MS-OXOCAL] Section 2.2.4.10.7 says the recipient type is 0x01
as Required and 0x02 as Optional and other documents such as
[MS-OXCMSG] 2.2.3.1.2 indicates that MAPI_TO is 0x01 and MAPI_CC
is 0x02, that's why is stored in 'to' and 'cc' respectively.
2015-03-18 18:18:46 +01:00
Jesús García Sáez 637ac1e98a oc-rtf: no color table definition
Be able to parse rtf files without color table defined
\colortbl
2015-03-18 18:06:49 +01:00