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.
Fetching a body[text] property using IMAP makes IMAP server set seen flag.
This commit fetches the flag beforehand to restore the previous state
once the body has been fetched.
This avoids to crash on this example:
\f0\fibi \fcharset0
-------^
Or:
\f0 \fibi\fcharset0
--^
Take into account that I found lots of RTF documents with this format:
\f0\fbidi \froman\fcharset0
\f0\froman\fprq2 \fcharset0
Which are not unsupported by this handler.
Map: FreeBusySimple -> PublicDAndTViewer
FreeBusyDetailed -> ConfidentialDAndTViewer
Although SOGo is not really used AFAIK, we can now keep it and
keep Calendar permission issues consistent.
We have a cache with user contexts (objc) which have mapping contexts (objc)
where we store the indexing context (c) which will be freed by openchange
code once the connection is closed.
Right now all indexing context created for an user are the same,
independently when in time was created or by which connection, etc...
So this is a valid workaround, but this has to be refactored to used the
indexing context of the current connection that is performing the
call to SOGo backend.
This was causing to parse a single space as an empty control
word with length 0, which was the source of several crashes.
Example:
\f0\fbidi \fcharset0
--------^
font index is 0, font family is bidi but when parsing charset we were
assuming control word was '' instead of 'charset0'.
This only fixes the crashes, the parseFontTable function works quite
awful right now.