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.
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.
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.
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.
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.
* 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
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.
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.
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.
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`.
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.
SOGo does not create BYDAY mask in weekly recurrence, so
we have to guess it from the start date's day of week.
In other case, the event is not exported to Outlook and it
says that is corrupted.
According to [MS-OXICAL] Section 2.1.3.1.1.20.13, the EXDATE property
must be written only if there are ocurrences from the series that have
been deleted and before this commit ModifiedInstanceDates were also
included.
We check against every ExceptionInfo from exception ocurrences of the series
to know if the ocurrence was deleted or only modified.
This makes sent mails are not longer automatically copied
to Drafts folder.
Reasoning:
When Outlook sends a mail, OpenChange submits the message and
copy the message to Drafts folder. Afterwards, the client asks
to move this message using SyncImportMessageMove ROP from
Drafts to Sent. During this movement, the message is unregistered
from the indexing database. If the client has updated Drafts
folder before that movement, then the client will keep this
message as the MID is not returned in oxcfxics download sync
as deleted. Setting the message as soft deleted, make it work.
In this way, we do not modify the flags (\Seen) on preloading.
The IMAP server returns the content without .peek section so
it is removed.
This also performs the modification intended by the following
Pull Request:
https://github.com/Zentyal/sogo/pull/50
That tried to avoid set \Seen flag when preloading message bodies
on synchronisation. But in this case we are not incrementing the
modseq as we are not modifying any messages flags.
As required by [MS-OXWSMSHR] Section 3.1.1 to display the share
object message correctly and be able to open the shared calendar
directly from the message.
It acts as a proxy of MAPIStoreMailMessage and it manages the properties
defined in [MS-OXSHARE] Section 2.2 by storing them in the mail message
as eXtensible MIME headers which starts with X-MS-Sharing.
get_AppointmentRecurrencePattern() can fail to parse the input data, added a check to avoid setup the recurrence pattern in that case. This should only happen when input data is incorrect.
As described in [MS-OXCICAL] Section 2.1.3.11.20.4 by using
access CLASS iCal field.
Although Outlook does not support confidential level, it is properly
exported and imported.
It wasn't being called because the proxy (AppointmentWrapper) is not
being called as there is a base implementation for these properties
in MAPIStoreMessage making them impossible to be shared between
Outlook profiles.
Now that message headers can be set dynamically, we can
set the body-related headers using `setHeader` selector.
This fixes emails sent using this sope version are all in plain text.
The path attribute from SOGoCacheGCSFolder is properly updated
in the database but not when returning from path message as
the container is the old one.
Two different indexing entries were created on move operation making
impossible to restore old folder position in the original parent folder.
This was due to cleanupCaches message calls to objectId which requires
to have the indexing entry available.
Use case:
* Restore a folder from "Deleted items" folders
The URL was incorrectly set when any of ;/?:@&=+$,# was used
in the folder name.
We have to mimetise what it is done in createFolder message selector.
That is, perform the IMAP4 encoding + URL encoding without CSS
encoding. The IMAP4 + CSS encoding (without URL encoding) is used to store the folder
in SOGo and OpenChange Indexing database as we do right now.
This is happening when importing a PST file.
From -> PidTagSenderEntryId
To -> PidTagOriginalDisplayTo
CC -> PidTagOriginalDisplayCc
The tested EntryID are the local users and OneOffEntries
when the users are not from the directory.
It requires https://github.com/openchange/openchange/pull/175 to work.
We activate the user for the context using the root folder
context as there are times where the active user is not
matching with the one stored in the application context
and SOGo object is storing cached data with the wrong user
leading to create folders in wrong mailboxes, etc.
As this application is single-threaded, no problems are expected.
Indeed, the same code is available at getting the root folder (ie INBOX).
By getting the root folder/container whose properties
are stored in OpenChange DB.
This makes the synchronisation of sub-folders faster as
when we evaluate restrictions for this folder, we are able
to get the modseq from where to get the latest messages
unseen by the client.
This may happen if between sync cache and setChangeKey a modSeq
is making synchroniseCache not retrieve the newly stored message.
This should fix the following crash:
https://tracker.zentyal.org/issues/2673
Valgrind crafted report:
=40967== 128,927 (53,750 direct, 75,177 indirect) bytes in 383 blocks are definitely lost in loss record 10,104 of 10,179
==40967== at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==40967== by 0x86EDE3D: talloc_strndup (talloc.c:613)
==40967== by 0x34D2BB9E: _i_NSString_MAPIStoreDataTypes_asUnicodeInMemCtx_ (in /usr/lib/GNUstep/SOGo/SOGoBackend.MAPIStore/SOGoBackend)
==40967== by 0x34D2025B: _i_MAPIStoreMailMessage__getPidTagNormalizedSubject_inMemCtx_ (in /usr/lib/GNUstep/SOGo/SOGoBackend.MAPIStore/SOGoBackend)
==40967== by 0x34CFCD40: _i_MAPIStoreObject__getProperty_withTag_inMemCtx_ (in /usr/lib/GNUstep/SOGo/SOGoBackend.MAPIStore/SOGoBackend)
==40967== by 0x34CFBE21: _i_MAPIStoreMessage__getPidTagSubject_inMemCtx_ (in /usr/lib/GNUstep/SOGo/SOGoBackend.MAPIStore/SOGoBackend)
==40967== by 0x34CFBEB6: _i_MAPIStoreMessage__getPidTagOriginalSubject_inMemCtx_ (in /usr/lib/GNUstep/SOGo/SOGoBackend.MAPIStore/SOGoBackend)
==40967== by 0x34CFCD40: _i_MAPIStoreObject__getProperty_withTag_inMemCtx_ (in /usr/lib/GNUstep/SOGo/SOGoBackend.MAPIStore/SOGoBackend)
==40967== by 0x34CFD07E: _i_MAPIStoreObject__getProperties_withTags_andCount_inMemCtx_ (in /usr/lib/GNUstep/SOGo/SOGoBackend.MAPIStore/SOGoBackend)
This is happening when the lastModSeq is greater than the modseq
from an old message and that message is not in cache.
This is used as last resort before crashing and it is only used
in objectVersion as it is the first place to call on sync. Other
related properties would work.
And remove that entry from the indexing table.
This avoids to crash getting properties from a no longer available message
in the IMAP server, for instance, the `PidTagPredecessorChangeList` attribute.
By keeping mid on moving messages by soft deleting and
only if srcMid is different from targetMid.
This makes restore/shared deleted items work.
It also requires to do the following to work smoothly:
* Do not add soft-deleted messages in ensureIDsForChildKeys
* Return soft-deleted messages on getDeletedFMIDs
* Do not register a new mid if the URL is matched with soft deleted messages
Furthermore, [MS-OXOCAL] Section 2.2.1.41.1 indicates:
The wDay field is set to indicate
the occurrence of the day of the week within the month
(1 to 5, where 5 indicates the final occurrence during
the month if that day of the week does not occur 5 times).
[rule firstOccurrence] may return negative values according to iCal spec for
recurrent rules iCal 4.8.5.4 Recurrence Rule. For instance, for defining
a timezone whose recurrent rule is done using this rule:
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
This fixes the problem when editing a recurrent appointment in
Outlook were incorrectly shifted when SOGo provides back the event.