Commit graph

1045 commits

Author SHA1 Message Date
Enrique J. Hernández Blasco 68ebc9e0ff oc: Use dlinklist from samba for now
Due to https://github.com/openchange/openchange/pull/204.

Until it is published by OC or dismissed.
2015-02-10 23:37:40 +01:00
Enrique J. Hernández Blasco 96986812f4 oc-mail: Set content type for a message after upgrading sope 2.2.15
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.
2015-02-07 00:22:45 +01:00
Julio García 12b159a6c0 Merge branch 'master-upstream' into jjgarcia/merge-from-upstream 2015-02-02 12:53:49 +01:00
Jesús García Sáez 6cfa6b9952 Merge pull request #82 from Zentyal/jgarcia/appointments-alarms
oc-appointments: ignore alarms already triggered
2015-01-28 18:57:36 +01:00
Jesús García Sáez 0a198ccb05 Merge pull request #81 from Zentyal/ejhernandez/fix-move-db-folder
oc: Set right container in dbFolder when moving a folder
2015-01-28 16:34:27 +01:00
Jesús García Sáez 5258ee2e76 oc-appointments: ignore alarms already triggered 2015-01-28 12:56:27 +01:00
Enrique J. Hernández Blasco 57d591c427 oc: Set right container in dbFolder when moving a folder
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.
2015-01-28 11:26:56 +01:00
Enrique J. Hernández Blasco b01de763da oc: Move back and forth folders now are in sync
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
2015-01-27 18:27:11 +01:00
Enrique J. Hernández 2dcb8fa732 Merge pull request #75 from Zentyal/ejhernandez/move-mail-folder-with-reserved-chars
oc-mail: Move mail folders with reserved chars
2015-01-26 23:39:15 +01:00
Enrique J. Hernández Blasco 0e8bf0d239 oc-mail: Move mail folders with reserved chars
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.
2015-01-26 15:55:22 +01:00
Jesús García Sáez 312084243b oc: improve modseqFromMessageChangeNumber to return an approximation.
Only for scenarios where we hadn't store the cn <-> modseq relationship
2015-01-23 18:19:24 +01:00
Jesús García Sáez 47be392d4f oc: avoid request change number until necessary
Minor changenumber leak, but avoid it anyway
2015-01-23 18:18:25 +01:00
Jesús García Sáez 34efcfee4e oc: synchroniseCache store modseq for last delete change number.
This will be the more frequent change number used to obtain updates
on the folder related with deleted messages
2015-01-23 18:17:45 +01:00
Jesús García Sáez 8e7f6d1aec oc: avoid change number leaking when refreshing folder.
Everytime a folder where its last operation was delete some email was
requesting change numbers that were not used.
2015-01-23 18:15:44 +01:00
Enrique J. Hernández Blasco 99a36be034 oc: Remove a source folder on move folder operation
Calling deleteFolder message to actually remove it from DB/IMAP
depending on the class.
2015-01-21 12:44:31 +01:00
Jesús García Sáez 8e41e5d665 Merge pull request #71 from Zentyal/ejhernandez/filetime-utc
Use PT_SYSTIME as absolute timestamp
2015-01-20 16:54:56 +01:00
Jesús García Sáez b1dfe47f01 Merge pull request #70 from Zentyal/jgarcia/working-encoding-parse
Outlook can view mails with non-ascii characters in their body (II)
2015-01-20 14:36:50 +01:00
Jesús García Sáez 014632fddb Merge pull request #72 from Zentyal/ejhernandez/wedding-anniversary
oc-contacts: Implement Wedding Anniversary
2015-01-20 14:36:14 +01:00
Enrique J. Hernández Blasco 8b44c08a32 oc-calendar: Remove unnecessary shifts on start,end and replace time props
As the data is sent in UTC, no shifts are longer required.
2015-01-20 14:35:32 +01:00
Enrique J. Hernández Blasco c893963da5 oc-tasks: Set right start, due and complete dates
As explained in [MS-OXOTASK], we have to shift the given date
to store the right point in time with the correct timezone.
2015-01-20 14:35:32 +01:00
Enrique J. Hernández Blasco c6b976a830 oc-mail: Remove unnecessary time shift in date for new mails
The MIME type can store the date in UTC and the clients are
responsible on showing correctly to the client as it does.
2015-01-20 14:35:32 +01:00
Enrique J. Hernández Blasco d5d97db8e8 oc: PT_SYSTIME is an absolute timestamp
As the epoch is in UTC timezone, we set this timezone for NSCalendarDate.
2015-01-20 14:35:32 +01:00
Carlos Pérez-Aradros Herce 00cef845b7 Restore multitenancy changes for OpenChange 2015-01-19 19:04:06 +01:00
Jesús García Sáez f9550b9181 oc: several uninitialized variables 2015-01-19 15:35:44 +01:00
Enrique J. Hernández Blasco b35fee8efc oc-contacts: Implement Wedding Anniversary
As specified by Microsoft using x-ms-anniversary custom vcard element
[MS-OXVCARD] Section 2.1.3.9.6
2015-01-16 01:34:16 +01:00
Jesús García Sáez 7e7d302165 oc: warning if codepage not found from headerCharset 2015-01-15 13:50:26 +01:00
Jesús García Sáez d052356724 oc: encoding names must be case insensitive 2015-01-15 13:27:37 +01:00
Jesús García Sáez 838ae8995f oc: ignore unhandled properties instead of abort
When setting a row with properties not handled right now, ignore them
like they were never there instead of abort()
2014-12-29 19:20:27 +01:00
Jesús García Sáez 3ef28b390d Merge pull request #66 from Zentyal/ejhernandez/guessing-recipients-from-import-PST
oc: Guess recipients from some properties while importing PST
2014-12-24 13:16:46 +01:00
Jesús García Sáez 501ee79766 oc-rtf: fix parse \pict tag with \bin data 2014-12-23 11:14:54 +01:00
Enrique J. Hernández Blasco a56fc93a9a oc: Guess recipients from some properties while importing PST
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.
2014-12-23 00:59:29 +01:00
Enrique J. Hernández Blasco dba17fbcbc Create child folder objects using parent context for real
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).
2014-12-16 23:43:57 +01:00
Jesús García Sáez ba79234ceb Merge pull request #64 from Zentyal/ejhernandez/store-change-number-subfolders-cache
Store changeNumber maps with modseq in cache for subfolders
2014-12-03 16:05:51 +01:00
Enrique J. Hernández Blasco 067809ef1c Store changeNumber maps with modseq in cache for subfolders
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.
2014-12-01 23:19:38 +01:00
Jesús García Sáez bdf12e5c01 Merge pull request #62 from Zentyal/ejhernandez/fix-space-temporal-crash-setChangeKey
Attempt to sync an UID in setChangeKey to avoid crashing
2014-12-01 19:45:51 +01:00
Jesús García Sáez 97201c56a4 abort if attemp to sync an UID in setChangekey fails 2014-12-01 10:47:16 +01:00
Enrique J. Hernández Blasco 7691d616a9 Attempt to sync an UID in setChangeKey to avoid crashing
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
2014-11-29 08:07:41 +01:00
Enrique J. Hernández Blasco f4e15e2db8 Fix memory leak on getPidTagSubject
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)
2014-11-28 10:04:10 +01:00
Enrique J. Hernández Blasco a8b716fbaa oc: sync old messages as last resort if there are not in cache
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.
2014-11-19 17:16:45 +01:00
Enrique J. Hernández Blasco ef7b919175 Return MAPISTORE_ERR_NOT_FOUND when a mail is indexed but not in IMAP server
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.
2014-11-19 17:12:32 +01:00
Jesús García Sáez 973ab78761 oc: synchronize folders ChangeNumber <-> modseq 2014-11-19 17:12:32 +01:00
Jesús García Sáez 41320a4813 oc: NGImap4Connection:fetchUids changed error messages 2014-11-19 17:12:32 +01:00
Jesús García Sáez c410a9fc3f oc: NGImap4Connection:fetchUids don't delete RawResponse 2014-11-19 17:12:31 +01:00
Jesús García Sáez 24e35103ff oc: monkeypatched NGImap4Connection class from sope
To improve fetchUids method so we can retrieve uids in batches.
Otherwise we will face an error 'too long request' kind
2014-11-19 17:12:31 +01:00
Enrique J. Hernández Blasco 616f2abbb2 Fix compilation when samba file is not others readable
This happens when any smb.conf or included file is not others readable,
thus we are fallbacking to the default installation path.
2014-11-19 17:12:31 +01:00
Enrique J. Hernández Blasco 3910769ae8 oc-folder: Uniform call to deleteMessageWithMID
To make sure flags argument is used accordingly with the specs
and not working by chance.
2014-11-19 17:12:31 +01:00
Enrique J. Hernández Blasco b67e1deda5 oc-folder: Make deleted items synched when shared
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
2014-11-19 17:12:31 +01:00
Enrique J. Hernández Blasco 35ca313c37 oc-calendar: Fix PidLidClipStart on recurrent events
The midnight value must be in user's timezone and returned back in UTC.
2014-11-19 17:12:31 +01:00
Enrique J. Hernández Blasco c631689975 oc-calendar: getPidLidClipEnd now follows [MS-OXOCAL]
On recurrent events when there is no end, the time to set is
31 August 4500, 11:59 P.M ([MS-OXOCAL] Section 2.2.1.15)
2014-11-19 17:12:30 +01:00
Enrique J. Hernández Blasco cd64ca199a oc-calendar: wDay field cannot be negative
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.
2014-11-19 17:12:30 +01:00