Commit graph

11562 commits

Author SHA1 Message Date
Enrique J. Hernández Blasco dd32c659f6 oc-calendar: Add edit/delete own and Folder Contact/Owner sharing perm
By storing these custom MAPI roles in the ACL.

The extension field 'X-SOGO-COMPONENT-CREATED-BY' is used to store the
event creator when it is done from Outlook. It is the same field SOGo
uses when an event is created from a shared folder in the webmail.

The creator and the organizer/owner of the event can be different and it can
be used from external sources by checking the organizer field. This matches
the specification from [MS-OXOCAL] Section 1.1 which defines the organizer
as the owner or creator of the event.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 12ac1d30de oc: Implement edit own and delete own in GCSFolders
And returning back PidTagCreatorName.

This is done by checking the owner of the resource if the given
permission is restricted to edit/delete own items.

This requires a52bc3b to work in calendar folders as it requires to store and retrieve
the MAPI custom permissions in the ACL.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 8b45ee886b oc: Use the same permission set original from MAPIStoreDBFolder
To keep backwards compatibility.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 1ca1a273d9 oc-notes: Implement edit own and delete own permissions
By storing the PidTagCreatorName on creation and checking when
trying to edit or delete an specific message.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 76e586deca oc: Added custom MAPI permissions
This set is only available at sogo-openchange library scope but
they are useful to provide all permissions set from any MAPI client
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco a9f336c69d oc: Check permissions on read opening a shared folder
This is a security issue that allowed a user to read the number
of messages and its subjects when it does not have any permission to read.

Now the user cannot see other's folder without asking for me to the owner.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco b92ca092ed oc: Remove specialised PidTagAccess and PidTagAccessLevel
As the generic one from MAPIStoreMessage applies here since
we use subscriberCan* protocol to know the values from these
properties.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco dcb1d2f574 oc: API to know if a message can be deleted by a subscriber
Instead of asking general container. This gives the possibility to
perform the deletion depending on the data from the message, for instance,
the user creator.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco bcf94c5b43 oc: Check FolderOwner right to modify permissions
As specified by [MS-OXCPERM] Section 3.2.5.2, the ModifyPermissions ROP
is only possible to users which have this right.

After this changeset, we check the active user can modify permission
list. This is a security fix.
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 8c8ad301b4 oc: Check FolderVisible permission to show permission list
When the active user is not the owner of the resource as specified
by [MS-OXCPERM] Section 3.2.5.1
2016-02-16 14:55:21 +01:00
Enrique J. Hernández Blasco 026c37709a oc: Mimetise PidTagRights behaviour to PidTagMemberRights
As specified by [MS-OXCFOLD] Section 2.2.2.2.2.8 we exclude
FreeBusySimple and FreeBusyDetailed right flags.
2016-02-16 14:55:20 +01:00
Enrique J. Hernández Blasco c45baad188 oc: Read FAI messages from shared folder must be possible
At least, to be able to read a shared folder using Online mode.
It requests the folder to know if the message can be read by
current active user.
2016-02-16 14:55:06 +01:00
Enrique J. Hernández Blasco e86e3b2481 oc: Get new change numbers using resource's owner
Instead of using the connected active user.

Although this provides no changes in the result, it could be depending
on changes from the backend so it'd better have it accurated to what
the OpenChange DB API offers.
2016-02-16 14:54:58 +01:00
Enrique J. Hernández Blasco 967cc29c4e oc: Query for fmids in behalf of owner's resource
Instead of using connected active user because the fmids are related
to the root folder (context) owner. This avoids returning back incorrect
identifiers which mostly collide with already associated URLs.
2016-02-16 11:43:21 +01:00
Jesús García Sáez 0e49f7ed87 Merge pull request #251 from zentyal/ejhernandez/mapistore-error
oc: Use enum mapistore_error instead of int
2016-02-15 20:55:13 +01:00
Jesús García Sáez b62d58d4d7 Merge pull request #249 from zentyal/ejhernandez/proper-fix-user-many-groups-calendar-sharing
Keep all roles in calendar folder ACLs
2016-02-15 20:53:14 +01:00
Jesús García Sáez c99fd1d93c Merge pull request #248 from zentyal/ejhernandez/groups-domain-based-uid
Support for groups using EnableDomainBasedUID configuration
2016-02-15 20:18:51 +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
Enrique J. Hernández Blasco 15779c2cfb Keep all roles in calendar folder ACLs
Instead of keeping only the highest access roles. This reverts
2c678101 to fix handling of ACLs with multiple groups.

This is done because OpenChange library stores other roles/permissions
in the ACLs that have limited scope to the MAPI protocol and it
maintains an homogeneous returned data with other folders by returning
the actual data is stored in the DB.

By sorting the roles, we give the ability to callers to validate
permissions more efficiency (less loops) and keep the right highest
access level. As an example, check
[SOGoApppointmentFolder:roleForComponentsWithAccessClass:forUser]
for details.
2016-02-11 16:54:49 +01:00
Enrique J. Hernández Blasco 3b0cfa00f7 Support for groups using EnableDomainBasedUID conf
Using LDAP as source, the group entry must have a valid
group objectClass such as posixGroup or group and have a
valid UIDField which does not include the domain.

With this changeset, SOGo is aware of these groups when it has
an email and you can share a component such as a calendar with
the member of the group.
2016-02-11 15:59:54 +01:00
Enrique J. Hernández 0de07acb16 Merge pull request #234 from zentyal/jag/multipart-support
sogo-openchange: Support for multipart/mixed and multipart/alternative
2016-02-03 11:01:30 +01:00
Enrique J. Hernández 27fb035f34 Merge pull request #242 from zentyal/jag/rtf-parser-charset-in-plain-rtf-text
RTFHandler: fixed problem with plain chars from no-ascii charset
2016-02-03 09:53:42 +01:00
Jesús García Sáez 8749028e1d Merge pull request #244 from zentyal/ejhernandez/fix-contacts-no-email
oc-contacts: Return not found when there is no information
2016-02-01 20:16:35 +01:00
Javier Amor García e5f15f69df RTFHandler: protect against CR and bad hexadecimal sequence
In RTF is possible to specify characters with the sequence \'XX being
XX an hexadecimal number.
With this changeset we guard against incorrect hexadecimal numbers which
will be ignored.

The other change added is to ignore carriadge returns in plain text.
2016-02-01 16:55:20 +01:00
Javier Amor García 8e80b57d31 RTFHandler: support charsets in plain text
Allow to switch charset in RTF plain text parts.
2016-02-01 11:48:15 +01:00
Enrique J. Hernández Blasco 75ffdd2ee1 oc-contacts: Return not found when there is no information
In _getElement which match many properties and in both
PidLidAddressBookProviderEmailList and PidLidAddressBookProviderArrayType.

As it is specified in [MS-OXOCNTC] Section 2.2.1, each property
must be stored when the user needs it. So we can assume we can avoid
returning them if we don't have it.

This fix a Sync Issue which make it impossible to sync a contact
folder where some contact object does not any email. The sync issue
message is as follows:

   Error synchronizing folder
       [80070057-30FFFFFF-0-560]
2016-01-28 23:21:46 +01:00
Jesús García Sáez 46bffaa449 Merge pull request #241 from zentyal/fail-on-broken-imap
Allow exception raising when connecting to IMAP
2016-01-28 11:57:33 +01:00
Carlos Pérez-Aradros Herce 061244a0a5 Allow exception raising when connecting to IMAP
By setting `SoIMAP4ExceptionsEnabled` config key to YES

Enabled for OpenChange by default, it will ensure no action is taken
when IMAP connection is not valid.
2016-01-27 15:30:27 +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
Enrique J. Hernández 13a82826f8 Merge pull request #240 from zentyal/jgarcia/set-log-level
Setting log level on backend initialization
2016-01-25 23:29:59 +01:00
Jesús García Sáez 3d9466df45 Setting log level on backend initialization
Get the current openchange log level (actually is the samba's log level)
2016-01-25 20:18:45 +01:00
Carlos Pérez-Aradros Herce aac9cd7c07 Merge pull request #237 from zentyal/jgarcia/contacts-all-2
Fix contact listing properly
2016-01-25 17:17:57 +01:00
Jesús García Sáez a7c04187a2 Merge pull request #238 from zentyal/ejhernandez/fix-tz-def-start-display
oc-calendar: Fix typo setting or operator
2016-01-25 11:08:44 +01:00
Enrique J. Hernández Blasco 359da78d81 oc-calendar: Fix typo setting or operator
For PidLidAppointmentTimeZoneDefinitionStartDisplay.

It is a typo introduced by 376e717.
2016-01-24 01:13:00 +01:00
Jesús García Sáez 1bae41e127 Request all contacts no longer needs value=.
This reverts 1c8b693 and it's possible thanks to removing
listRequiresDot option 6b2ec7a

Listing contacts didn't work for sources with listRequiresDot
set to YES (LDAPSource, by default, had this option that way)
2016-01-20 11:03:04 +01:00
Jesús García Sáez 6b2ec7a2e7 Remove listRequiresDot option from *Source classes
This option is not needed. SQLSource was not using it
and LDAPSource will transform the filter to (UIDField=*) when
there is nothing set as filter, before this patch it was needed
to either insert '.' as filter or set listRequiresDot to NO
2016-01-20 11:01:27 +01:00
Enrique J. Hernández 169356b8a0 Merge pull request #236 from zentyal/jgarcia/test-sope-subject-qp
Jgarcia/test sope subject qp
2016-01-20 09:41:19 +01:00
Jesús García Sáez bad7fd4532 Unit test encode qp text: long of second line
This will fail without sope commit 361178217156177a2a40c327a64f70716b30ae3a
2016-01-19 19:51:41 +01:00
Jesús García Sáez cb3959d991 Unit test encode qp text
This will crash without sope commit 0c9b08d18f07205b4de58bb700ad15a4a4649e53
2016-01-19 19:51:06 +01:00
Jesús García Sáez 65670027cb Merge pull request #231 from zentyal/ejhernandez/calendar-perm
Calendar folder permission roles
2016-01-18 13:49:39 +01:00
Enrique J. Hernández Blasco 57fad470fb oc-calendar: Detail limitations on setting permissions
As MAPI permission flags are much more detailed that SOGo ones.
2016-01-13 17:52:49 +01:00
Enrique J. Hernández Blasco e0b7efbbbf oc-calendar: Set simple and Detailed Free/Busy permission level
By restricting when FolderVisible right is set to the following rights:

* ReadAny
* EditAny
* DeleteAny

This goes beyond what specs says about when FolderVisible right is
mandatory but there is no more information stored in SOGo
(no possibility to set FolderVisible specific right)

See [MS-OXCPERM] Section 2.2.6 for more details
2016-01-13 17:52:48 +01:00
Enrique J. Hernández Blasco 4278e417a7 oc-calendar: Enable editor role
When Outlook sets the editor role, the FreeBusyDetailed and FreeBusySimple
right flags are set as Full Details are available.

When we store this information in SOGo, the SOGoCalendarRole_PublicModifier,
SOGoCalendarRole_PrivateModifier and SOGoCalendarRole_ConfidentialModifier
are stored as well as the free busy related roles, but as
[SOGoAppointmentFolder aclsForUser:forObjectAtPath] only returns the highest
access rights, we have to set as well the FreeBusy flags.

More details on [MS-OXCPERM] Section 2.2.6
2016-01-13 17:52:48 +01:00
Enrique J. Hernández 9bb2473c8e Merge pull request #233 from zentyal/jgarcia/delete-attach-after-fail
Do not include failure attachments (really long filenames)
2016-01-13 12:08:58 +01:00
Jesús García Sáez 2d5995a8f4 Merge pull request #213 from zentyal/jamor/unittest-merge
Add RTFHandler unittest
2016-01-12 18:35:43 +01:00
Jesús García Sáez cee83df085 Merge pull request #232 from zentyal/ejhernandez/junit-output
Give support to JUnit output format for sogo-tests
2016-01-12 18:29:49 +01:00
Enrique J. Hernández Blasco 0c5f4edb36 Give support to JUnit output format for sogo-tests
To integrate with CI system.

sogo-tests now accepts a flag (-f) to determine the output format:

  * text : Current behaviour and default value
  * junit: XML output suitable for CI system such as Jenkins
2016-01-12 16:14:30 +01:00
Jesús García Sáez 90378b76eb draft: remove attachment on failure
Attachment creation can succeed and attachment mime file could fail

This can happen, e.g., when the filename's length is close to the maximum
allowed but your filesystem and then mime file will exceed that limit
(because it has a prefix).
2016-01-12 16:10:39 +01:00
Enrique J. Hernández 6aeb13ba65 Merge pull request #227 from zentyal/jgarcia/qp-encode-subjects
Fix encoding of subjects of emails with non-ascii characters
2016-01-12 16:04:42 +01:00
Jesús García Sáez 5927d3303c Merge pull request #230 from zentyal/ejhernandez/debug-rc
oc: Print retval on high debug for library interface
2016-01-11 09:33:29 +01:00