Commit graph

87 commits

Author SHA1 Message Date
Enrique J. Hernández 7f0c5a86f8 Merge pull request #256 from zentyal/jag/multipart-nested-2
oc-mail: Better management of nested multipart types
2016-02-23 17:40:55 +01:00
Javier Amor García f388d180ae oc-mail: Better management of nested multipart types
Instead of treating all the message either as alternative or mixed with
this changeset the MIME type of the parent part is used.
This allows a correct disposition of the message in the cases when
nested multiparts elements are used.
Also in mixed parts we convert between plain text and HTML as needed.
2016-02-22 17:19:44 +01:00
Jesús García Sáez 8d04a83731 Merge pull request #245 from zentyal/jag/html-part-not-assume-charset
oc-mail: Use UTF-8 when there are parts with multiple charsets
2016-02-18 18:15:27 +01:00
Javier Amor García e1b1812364 oc-mail: Use UTF-8 when they are parts with multiple charsets
If we have multiple parts with different encodings we recode
all HTML parts to UTF-8 and we use it as message charset.
This is neccesary because Outlook assummessa single charset
for all the message.

Also we convert the end of line in text/plain to <br/> tag
when showing them as HTML in multipart/mixed parts.
2016-02-17 19:02:14 +01:00
Enrique J. Hernández Blasco e08ee9a265 oc: Use enum mapistore_error instead of int
This specifies a little the scope of the variable to make it
more realistic with the actual values it may have. We do have
a static typed compiled language, why don't we use it?
2016-02-15 15:44:14 +01:00
Javier Amor García dee7b4be1a oc-mail: Support for multipart/mixed and multipart/alternative
With multipart messages only one of the parts was displayed as message body.
This changeset supports both mixed and alternative multipart types.
2016-01-27 09:14:45 +01:00
Juan Vallés 376e717f45 oc-calendar: Use the calendar's time zone if it is present
If the event was created by the MAPI client, the client's time zone (if
present) is assigned to the event's calendar in iCalEvent+MAPIStore.
This way, we can use it to deliver the event's properties correctly.
2015-12-23 17:27:10 +01:00
Carlos Pérez-Aradros Herce 9554e92c8b Adapt to new safe_ldb_search function 2015-11-23 17:01:35 +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 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
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
Enrique J. Hernández Blasco f19074334c oc: Use enum mapistore_error as returned value for setReadFlag 2015-09-04 16:15: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
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
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
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 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 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 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 6d6053865f Revert "oc-mailfolder: Get seen flag directly from message in preloading"
This reverts commit d076e04ad4.
2015-03-13 00:00:29 +01:00
Jesús García Sáez 8031f066dc Merge pull request #98 from Zentyal/ejhernandez/calendar-sharing-invitation
Give support to calendar sharing invitation
2015-03-11 13:07:36 +01:00
Enrique J. Hernández Blasco ae7ac1be29 oc-mail: Return sharing properties on sharing object mail message
When it is asked for available properties for an specific message.
2015-03-05 00:02:19 +01:00
Enrique J. Hernández Blasco 316ade13f8 oc: Implement Sharing Message Object
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.
2015-03-04 18:49:17 +01:00
Carlos Pérez-Aradros Herce 3b2cbb945c oc: Free headerEncoding variable 2015-03-04 10:10:32 +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
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 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
Jesús García Sáez 445a1fb2d6 oc: MailMessages return correct codepage 2014-11-19 17:12:29 +01:00
Ludovic Marcotte 4c97d54939 Fix for bug #2119 2013-06-20 09:10:09 -04:00
Ludovic Marcotte 93f9a7273e Now handle mem context when saving messages and removed useless debugging. 2013-03-13 15:04:11 -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 2711e0a0db Retrieve the displayName rather the address part of the email address 2012-09-26 17:07:19 -04:00
Wolfgang Sourdeau 0af7547b8a Monotone-Parent: d37b05310d38d5954711085cdeecbc2ffc7e8d82
Monotone-Revision: b6e0c5de869a2a15ff75f7dd4850ede790373285

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-09-05T20:07:17
Monotone-Branch: ca.inverse.sogo
2012-09-05 20:07:17 +00:00
Wolfgang Sourdeau 8670c3c561 Monotone-Parent: 289c3552a8d15a19943bfe3a54272bf413087c4f
Monotone-Revision: 30720cd63a96f71fe1ddecf048357f4063f4a056

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-21T20:38:43
Monotone-Branch: ca.inverse.sogo
2012-08-21 20:38:43 +00:00
Wolfgang Sourdeau bde4b22ba7 Monotone-Parent: 572391072fa416635b9921d39ed76478ed762097
Monotone-Revision: 105b571703ff5c4cc1024854ef8a1d987aef2bf1

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-08-17T19:04:57
Monotone-Branch: ca.inverse.sogo
2012-08-17 19:04:57 +00:00
Wolfgang Sourdeau 7bb437021a Monotone-Parent: d6049f3e55fa0ac4385db63c3777aa1d84d5511c
Monotone-Revision: 3fdbf80f4c1de08138ff9435f54fd9f663ef5b8f

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-07-20T14:13:56
Monotone-Branch: ca.inverse.sogo
2012-07-20 14:13:56 +00:00
Wolfgang Sourdeau 95a443d89a Monotone-Parent: 3f8608c82d9c379cc9e0fea6ffe853cc1949a24b
Monotone-Revision: 905276f295d6f28a6946297f6a7af9ad60f71842

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-06-29T17:59:38
Monotone-Branch: ca.inverse.sogo
2012-06-29 17:59:38 +00:00
Wolfgang Sourdeau b4d8609236 Monotone-Parent: c8921f898d8810ab70f86851a0449a28dc34eb89
Monotone-Revision: ccc94ebd9d872963c33041a7cac766343762bef2

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-06-01T15:15:30
Monotone-Branch: ca.inverse.sogo
2012-06-01 15:15:30 +00:00
Wolfgang Sourdeau 2adcb276b2 Monotone-Parent: 4899b773e21bd6c56bae726bf720e184b8ef9ec0
Monotone-Revision: cb7b77723f765942d950c5620150b720f5d0c5b1

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-03-30T15:33:47
Monotone-Branch: ca.inverse.sogo
2012-03-30 15:33:47 +00:00
Wolfgang Sourdeau c4292714b5 Monotone-Parent: 1e532558ba17916d33138e4c65d283faf4d0e929
Monotone-Revision: 3d21b0780b7affb529a020d89dcbf84325264c7d

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-03-02T20:44:24
Monotone-Branch: ca.inverse.sogo
2012-03-02 20:44:24 +00:00
Wolfgang Sourdeau 4b81cb167d Monotone-Parent: 4e23e038f2b0b7eddf8b30700b8c9a8910768f98
Monotone-Revision: 9235e5dc4d151a3cba8ad842ac39e1b2d18c8201

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2012-01-29T19:55:21
Monotone-Branch: ca.inverse.sogo
2012-01-29 19:55:21 +00:00
Wolfgang Sourdeau cb4341db75 Monotone-Parent: 12ff4c07aa1f796a3312a4e79566255dbd94aece
Monotone-Revision: dd0644b62704e75dfed8a39a7e286d593f0014e0

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-11-17T18:39:42
Monotone-Branch: ca.inverse.sogo
2011-11-17 18:39:42 +00:00
Wolfgang Sourdeau 6f13029d21 Monotone-Parent: e38c570559610854b85c2c517053417779a76964
Monotone-Revision: 419d3afdcfcc1cddf8eef1f0311d418b03b0d1a0

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-11-17T16:15:38
Monotone-Branch: ca.inverse.sogo
2011-11-17 16:15:38 +00:00
Wolfgang Sourdeau ecfd582a33 Monotone-Parent: 171272a94b2a2daabc128a7bb2a2787ca40ba489
Monotone-Revision: 1e8c7259f7ef4e643e8c4d7691e6d7b69faa65c3

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-11-01T14:30:20
Monotone-Branch: ca.inverse.sogo
2011-11-01 14:30:20 +00:00
Wolfgang Sourdeau 2110fba1a3 Monotone-Parent: 9488bb1220eb58936dc8d649bae5b7ecf2fe01fc
Monotone-Revision: 119b17733c942a5a103bfac69d069f4162241916

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-11-01T01:00:33
Monotone-Branch: ca.inverse.sogo
2011-11-01 01:00:33 +00:00
Wolfgang Sourdeau 4da013c4e3 Monotone-Parent: 55595f6ee3aaa33db773a4eb60c184519b6f18fd
Monotone-Revision: 9488bb1220eb58936dc8d649bae5b7ecf2fe01fc

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-10-31T19:29:37
Monotone-Branch: ca.inverse.sogo
2011-10-31 19:29:37 +00:00
Wolfgang Sourdeau 1ba0d4daa1 Monotone-Parent: a1f0f7f1bc0ae64c5342d0d87ffd1ff8e7e3272c
Monotone-Revision: 4ce6162defbc430cacd1a414c9d9b8a3d7e9940e

Monotone-Author: wsourdeau@inverse.ca
Monotone-Date: 2011-10-28T13:10:47
Monotone-Branch: ca.inverse.sogo
2011-10-28 13:10:47 +00:00