Commit Graph

123 Commits (459b183a42314d99d4a9a20bd17fa46e6ed2fe4c)

Author SHA1 Message Date
Ludovic Marcotte 18a300ca5b (fix) appplied fix from Zentyal - PR#102
Original commit: 33a1d2c397
2015-09-09 08:22:33 -04:00
Ludovic Marcotte f515106bcc (fix) added patch from PR93 2015-08-03 09:16:55 -04: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 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
Julien Kerihuel d4930a7960 oc: Remove deprecated notification code. 2015-04-16 16:04:47 +02: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 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 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
Julio García 3b0b43f28f Merge branch 'ejhernandez/peek-preload-bodies-for-real' 2015-03-18 09:28:57 +01:00
Enrique J. Hernández Blasco 9f3f2aebe4 oc-mail: Register source message as soft deleted on movement
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.
2015-03-18 00:42:01 +01:00
Enrique J. Hernández Blasco 1c1a75d2c1 oc-mail: Use body.peek to preload message bodies
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.
2015-03-13 10:54:57 +01:00
Enrique J. Hernández Blasco f048860729 Revert "oc-mailfolder: Avoid setting seen flag on preloading message bodies"
This reverts commit 7e0cddc06b.
2015-03-13 00:00:40 +01:00
Enrique J. Hernández Blasco 6d6053865f Revert "oc-mailfolder: Get seen flag directly from message in preloading"
This reverts commit d076e04ad4.
2015-03-13 00:00:29 +01:00
Enrique J. Hernández Blasco dc8012e3d3 oc-mail: Implement move a mail subfolder to root
By moving at IMAP level the mailbox and update the indexing DB
and local db path.
2015-02-05 23:48:46 +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 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
Jesús García Sáez f9550b9181 oc: several uninitialized variables 2015-01-19 15:35:44 +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 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 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
Jesús García Sáez 973ab78761 oc: synchronize folders ChangeNumber <-> modseq 2014-11-19 17:12:32 +01:00
Enrique J. Hernández Blasco d076e04ad4 oc-mailfolder: Get seen flag directly from message in preloading
To avoid a loop and a server-call.

We are not using body.peek[text] directly because bodyContentPart message
is explicitly avoiding it.
2014-11-19 17:12:30 +01:00
Enrique J. Hernández Blasco 7e0cddc06b oc-mailfolder: Avoid setting seen flag on preloading message bodies
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.
2014-11-19 17:12:30 +01:00
Kamen Mazdrashki dc8b73b12b oc/MailFolder: Add more logging so we can trace invalid message kyes 2014-11-19 17:12:28 +01:00
Kamen Mazdrashki 18acdf20a6 oc: Make sure we always use NSString keys in 'messages' dictionary
Different types for keys in Dictionaries leads to not finding
expected entry - we should make sure that everythime we set/get
entry from a dictionary, key object type is same
2014-11-19 17:12:27 +01:00
Ludovic Marcotte 5f9fb4e1c4 Big refactor for new caching mechanism. 2014-05-13 21:06:59 -04:00
Ludovic Marcotte 41e6fb89d3 Renamed constants in preparation for the big cache cleanup 2014-05-13 17:54:02 -04:00
Ludovic Marcotte a24d809e40 Minor code/copyright/authors cleanups 2014-01-09 21:06:31 -05:00
Ludovic Marcotte 29eed182a7 Updated the OpenChange code related to UTF-7 changes for IMAP folders 2013-09-25 10:41:07 -04:00
Ludovic Marcotte 93f9a7273e Now handle mem context when saving messages and removed useless debugging. 2013-03-13 15:04:11 -04:00
Ludovic Marcotte 4f38b5cf3f Alse use hex-formatted keys for deleted mails. 2013-02-14 15:59:19 -05:00
Ludovic Marcotte 4804337a01 Now pass the memory context when copying/moving folders. 2012-12-07 13:30:50 -05:00
Ludovic Marcotte 2017536beb move_copy_messages now uses the openchange's memory context.
This fixes strange crashes when dealing with invitations and
other stuff. More work will need to be done in this regard. Also
kept the old code just in case for now. Will be cleaned up shortly
after more people test it.
2012-12-03 09:18:17 -05:00
Wolfgang Sourdeau ef5119f765 crash: do not attempt to store nil body part keys, for emails having no text body 2012-10-15 08:04:26 -04:00
Wolfgang Sourdeau 526f83d3c9 synchroniseCache: register new mail message ids and version numbers in batch with the new methods in MAPIStoreFolder and MAPIStoreMapping 2012-10-12 23:29:38 -04:00
Wolfgang Sourdeau dd1a8e9285 only preload message bodies of normal messages, ignore FAI ones 2012-10-10 10:38:50 -04:00
Wolfgang Sourdeau 5b7cbb6350 Use NSString instances as keys rather than NSNumber, to work around a performance issue with GNUstep < 1.24 2012-10-09 16:39:24 -04:00
Wolfgang Sourdeau a549773554 Implemented a mechanism to preload body parts for email messages 2012-10-06 13:02:39 -04:00
Wolfgang Sourdeau 37ccb0875c Check whether the "INBOX" folder has the "noinferiors" flag set before declaring that it accepts subfolder creation 2012-09-26 11:50:28 -04:00
Wolfgang Sourdeau fc62d76b1f Monotone-Parent: 7c8fce0426b2ec4def5226f16a9bcf2cff5dcfb9
Monotone-Revision: 1cc99cc487a5bfdb791d4067042b904d7eb47795

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-09-07T16:46:18
Monotone-Branch: ca.inverse.sogo
2012-09-07 16:46:18 +00:00