Giter Club home page Giter Club logo

sabre-zarafa's Introduction

Note: Maintenance of Zarafa was ceased in 2017 in favor of Kopano. Therefor this repository is no longer maintained. There is a fork available which was created for Kopano specifically: https://github.com/markVnl/kopano-sabre.

Sabre-Zarafa

The aim of this project is to provide a full CardDav backend for SabreDAV to connect with Zarafa groupware.

Tarballs and zipfiles of the source can be downloaded here. See below for installation instructions, you will also need to download and install SabreDAV and log4php. For an overview of the changes, see the ChangeLog.

Sabre-Zarafa is a backend for the SabreDAV server. SabreDAV is a generic DAV server that processes CardDAV, CalDAV and WebDAV requests. It handles all the intricate parts of the DAV protocols and client communication, but doesn't know anything about databases or stores. It defers the responsibility for providing abstract objects like "cards" and "address books" to backend software like Sabre-Zarafa, which is free to implement retrieval and storage however it likes.

Sabre-Zarafa knows nothing about DAV, but does know how to get data from the Zarafa server and convert it to VCard format. Together, the SabreDAV frontend and the Sabre-Zarafa backend combine to form a Zarafa-based CardDAV server.

Sabre-Zarafa is pretty useable, but it's not all the way there yet. Patches and improvements are welcome.

This particular repository is a continuation of the original Sabre-Zarafa project, which is hosted at Google Code, and which has not been maintained for a while. This repository is not really a fork, but is intended to be the new mainline tree. Work on Sabre-Zarafa was sponsored by 1A First Alternative.

License

Sabre-Zarafa is licensed under the terms of the GNU Affero General Public License, version 3.

Install

Introduction

This installs as any SabreDAV server. Unpack the source into a directory. This readme will assume that /var/www/htdocs/sabre-zarafa is the root directory of the install.

Download and install Composer

Composer is required to install Sabre-Zarafa's dependencies. Installation instructions can be found on the Composer website.

After installation is done, run the following two commands:

# cd /var/www/htdocs/sabre-zarafa
# composer install

Configure permissions and logging

The webserver needs to write to the data directory, since it is used by SabreDAV to store DAV locks. (NB, the author is not convinced that CardDAV actually uses locking.) The log file, called debug.txt, should also be writable. If your server runs as the user apache:

# chown apache:apache /var/www/htdocs/sabre-zarafa/data
# chmod 0750 /var/www/htdocs/sabre-zarafa/data
# chown apache:apache /var/www/htdocs/sabre-zarafa/debug.txt
# chmod 0640 /var/www/htdocs/sabre-zarafa/debug.txt

Sabre-Zarafa logs using log4php. To configure logging you need to edit log4php.xml. Default setup is to log WARN, ERROR and FATAL messages to debug.txt with a maximum size of 5MB for logfile and 3 backup indexes (debug.txt.1). If you want to log to some other file, insert the proper filename here. (The default config file uses debug.txt in the application dir, which is probably not what you want.) To disable debugging simply set the root appender to noDebug. Optionally, choose a max logging level to observe. In order from less to more logging, you can specify FATAL, ERROR, WARN, INFO, DEBUG, and TRACE.

Example config for logging all errors at or higher than INFO to /var/log/sabrezarafa.log:

<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://logging.apache.org/log4php/">
	<appender name="fileAppender" class="LoggerAppenderRollingFile">
		<layout class="LoggerLayoutPattern">
			<param name="conversionPattern" value="%d{Y-m-d H:i:s} %-5p %c %x - %m%n" />
		</layout>
		<param name="file" value="/var/log/sabrezarafa.log" />
		<param name="maxFileSize" value="5MB" />
		<param name="maxBackupIndex" value="3" />
	</appender>
	<root>
		<appender_ref ref="fileAppender" />
		<level value="INFO" />
	</root>
</configuration>

Example config for suppressing all logging by specifying the null appender:

<?xml version="1.0" encoding="UTF-8"?>
<configuration xmlns="http://logging.apache.org/log4php/">
	<appender name="noDebug" class="loggerAppenderNull" />
        <root>
		<appender_ref ref="noDebug" />
	</root>
</configuration>

Sabre-Zarafa configuration

Sabre-Zarafa needs additional configuration in config.inc.php. You must set CARDDAV_ROOT_URI to the proper value. This is the path from the root of the webserver to Sabre-Zarafa. If Sabre-Zarafa is installed in the webserver root, then use /. If Sabre-Zarafa is installed in /var/www/htdocs/sabre-zarafa and /var/www/htdocs is the server root, then put /sabre-zarafa. If you're not using mod_redirect to redirect requests to server.php, use /sabre-zarafa/server.php.

You can also adjust other settings, some are highly experimental (non-UTF8 vcards for instance) and should be used only for testing.

If you prefer to only use read operations and not make any edits to the database, set READ_ONLY to true.

Running from the root of the webserver

According to the SabreDAV documentation, you get the least issues if you run the service straight from the root of the webserver. You can run it on a standard port like 80 or 443, but for CardDAV, it makes some sense to use port 8843, since that's what OSX Addressbook uses by default. Always enable SSL in production environments, since Sabre-Zarafa uses Basic authentication, and that's only secure when used over an encrypted connection.

To configure Apache to listen to port 8843 and use a virtual host to serve Sabre-Zarafa, put something like the following configuration in httpd.conf:

Listen 8843

<VirtualHost *:8843>

    # ...general server options, enable PHP parsing, SSL setup, etc...

    DocumentRoot /var/www/htdocs/sabre-zarafa
    <Directory /var/www/htdocs/sabre-zarafa>
        DirectoryIndex server.php
        RewriteEngine On
        RewriteBase /

        # If the request does not reference an actual plain file or
        # directory (such as server.php), interpret it as a "virtual path"
        # and pass it to server.php:
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteRule ^.*$ /server.php

        # If you're getting 412 Precondition Failed errors, try stripping the ETag headers:
        # RequestHeader unset If-None-Match
        # Header unset ETag
        # FileETag None
    </Directory>

    # Files and directories writable by the server should never be public:
    <Directory /var/www/htdocs/sabre-zarafa/data>
        Deny from all
    </Directory>
    <Files /var/www/htdocs/sabre-zarafa/debug.txt>
        Deny from all
    </Files>

    # Deny access to application directories:
    <Directory /var/www/htdocs/sabre-zarafa/lib>
        Deny from all
    </Directory>
    <Directory /var/www/htdocs/sabre-zarafa/vendor>
        Deny from all
    </Directory>
</VirtualHost>

Don't forget to edit config.inc.php and change CARDDAV_ROOT_URI to /.

Running from a subdirectory

You can also run Sabre-Zarafa in a subdirectory of your webserver. In that case, use a variant of this configuration:

<Directory /var/www/htdocs/sabre-zarafa>
    DirectoryIndex server.php
    RewriteEngine On
    RewriteBase /sabre-zarafa

    # If the request does not reference an actual plain file or directory
    # (such as server.php), interpret it as a "virtual path" and pass it to
    # server.php:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^.*$ /sabre-zarafa/server.php

    # If you're getting 412 Precondition Failed errors, try stripping the ETag headers:
    # RequestHeader unset If-None-Match
    # Header unset ETag
    # FileETag None
</Directory>

# Files and directories writable by the server should never be public:
<Directory /var/www/htdocs/sabre-zarafa/data>
    Deny from all
</Directory>
<Files /var/www/htdocs/sabre-zarafa/debug.txt>
    Deny from all
</Files>

# Deny access to application directories:
<Directory /var/www/htdocs/sabre-zarafa/lib>
    Deny from all
</Directory>
<Directory /var/www/htdocs/sabre-zarafa/vendor>
    Deny from all
</Directory>

Edit config.inc.php and change CARDDAV_ROOT_URI to /sabre-zarafa.

Testing and troubleshooting

Before testing with a CardDAV client, surf to the Sabre-Zarafa URL with a browser and check that you can log in and get a listing of your contacts. Pointing a web browser at Sabre-Zarafa is the easiest way to check that the install works; only then should you try real CardDAV clients. If things don't work in the browser, start there first.

If you're not seeing any output on the screen, check your PHP error logs. Maybe your PHP does not have all the required extensions enabled. SabreDAV uses quite a few extensions, such as ctype and dom. Googling any error messages should shed light on the problem.

If you're still fairly certain that things should be working but they don't, try changing the error output statements in server.php to:

ini_set('display_errors', true);
ini_set('html_errors', true);

PHP should now complain loudly when something goes wrong. Also, make sure log4php is installed and enable very verbose logging by setting the log level to INFO, DEBUG or even TRACE in log4php.xml. You will get very chatty logs that should point out any problems.

Problems with OS X Contacts.app can often be diagnosed by running the program from a terminal; it prints quite a lot of helpful output when things aren't working. Type this command in a terminal to launch Contacts.app:

/Applications/Contacts.app/Contents/MacOS/Contacts

Filing bugs, getting support

Bugs and issues can be filed at GitHub on the Sabre-Zarafa project page. You'll need a GitHub account. Alternatively, you can post to the Sabre-Zarafa thread at the Zarafa forums; the author checks it regularly.

If you want to request support for certain VCard properties, be sure to include a traffic dump that shows the exact format of the field.

If your client is having trouble talking to Sabre-Zarafa, please include a traffic dump that shows the network conversation, if at all possible. Seeing what goes wrong "on the wire" is indispensable for debugging.

In general, if you get any errors, be as specific as possible about what is going wrong and how to reproduce the problem. Include as much relevant logs as possible (both from PHP and Sabre-Zarafa). Bug reports such as "I tried it on a Mac and it doesn't work" are good to know (the author can perhaps try to reproduce the problem), but are not directly actionable.

Authentication

Please note that the authentication backend uses Basic authentication exclusively. It is not possible to use Digest authentication, because Sabre-Zarafa needs the user's plaintext password to log in to the Zarafa server. Some clients will only work with Basic auth if the host uses SSL. You should always enable SSL on the server, since sending plaintext passwords over an unencrypted connection is a security risk.

Some detailed information about SabreDAV setup are available in SabreDAV documentation. Do not hesitate to read it!

Upgrading

0.22 to 0.23

Sabre-Zarafa now depends on SabreDAV 2.1. Run composer update to update the dependencies.

0.21 to 0.22

Sabre-Zarafa is now installed completely by running Composer in the toplevel directory. Run composer update to update the dependencies (such as SabreDAV). If you visit the application in a browser, you'll notice a new design. Internally, the file and class structure of Sabre-Zarafa received a thorough reworking, but that should be invisible from the outside.

0.20 to 0.21

Sabre-Zarafa 0.21 is written for SabreDAV 1.8.6 and Sabre-VObject 3.0.0 (the production release, not the alpha or beta versions). You must install at least those versions of both packages, or newer. Some small API changes have been introduced between Sabre-VObject 3.0.0-alpha4 and the 3.0.0 release (as well as many internal fixes), so you must upgrade. The old SabreDAV 1.8.5 can apparently not handle the Sabre-VObject 3.x branch and must also be updated to version 1.8.6, which has support for both 2.x and 3.x branches.

This version introduces a new config option, called FOLDER_RENAME_PATTERN. This variable allows you to define a rename pattern for folders. You can define certain formatting variables; refer to the comments in the config file for particulars. Updating the config file to set this variable is not required; if the option is not specified, the previous behaviour is used (folder names are not rewritten).

0.19 to 0.20

Sabre-Zarafa 0.20 is written against the Sabre-VObject 3.x branch, which isn't yet included in SabreDAV and must be installed manually. Please refer to the installation instructions above. Because Sabre-VObject 3.x is in its early days, it's possible that some things don't quite work. Please report any bugs and issues you find.

0.18 to 0.19

Sabre-Zarafa 0.19 adds the ETAG_ENABLE config variable to config.inc.php. This variable controls the optional generation of ETags. If Sabre-Zarafa notices that the variable is not set, it will default to true. So users with an existing config file don't absolutely need to update their config, though it is advised.

Sabre-Zarafa 0.19 no longer requires log4php; it will run without logging if log4php is not installed. This makes it a little bit easier for new users to get Sabre-Zarafa up and running (less moving parts).

Other improvements in version 0.19 are all "under the hood" and should require no special action on the administrator's part.

PHP < 5.4

As of version 0.22, Sabre-Zarafa requires SabreDAV 2.0, which requires PHP 5.4.

As of version 0.18, Sabre-Zarafa requires SabreDAV 1.8, which in turn requires PHP 5.3.

Debugging

Log4Php

Starting with release 0.10 log4php is used for debugging. Release 0.19 made the installation of log4php optional: logging is done by the SabreZarafa\Logger class, and if it can't find log4php, it will silently discard all log messages.

sabre-zarafa's People

Contributors

aklomp avatar erwint avatar evert avatar mpietruschka avatar rdevroede avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sabre-zarafa's Issues

Class 'SabreZarafa\\VCard\\DateTime' not found

Hello,

I've found an error message in my apache log when I was trying to sync zarafa with contacts.app on Yosemite/Mavericks (using latest 0.22.2 sabre-zarafa with zarafa running on 14.04 LTS, latest stable community edition)

Sun Nov 16 20:07:46.441848 2014] [:error] [pid 10143] [client 172.16.21.139:57152] PHP Fatal error: Class 'SabreZarafa\VCard\DateTime' not found in /var/www/html/sabre-zarafa/lib/SabreZarafa/VCard/Parser.php on line 216

I'm not very much into php, but putting a '' in front of the DateTime functions in Parser.php in line 216 and 220 seems to fix the problem.

server.php has a small mistake

I have found a mistake in the server.php
There is a missing ')' at line 53.

$logger->trace(sprintf('Initializing Sabre-Zarafa version %s, revision %s', SABRE_ZARAFA_VERSION, SABRE_ZARAFA_REV));

VCardProducer mixing VCard versions 3 and 4

Reported on the Zarafa forum:

[...] but there is one remaining issue with the producer: the EMAIL tag is now a mixup of vcard versions 3.1 and 4.0.
vcard 3.1 specifies TYPE=INTERNET[,PREF] whereas 4.0 specifes TYPE=INTERNET,PREF=NN - therefore the parser in SOGO connector cannot handle the vcards by default.

I think staying 3.1 compatible should be the default.

Since the VCard version is a config option, the Producer should adhere to it.

Encode '@' in URLs as '%40' to make more compatible

We use our email address as our login names (this is also default with Zarafa Multi Tenant).
When we try to sync our contacts with Thunderbird + Sogo connector using sabre-zarafa, no contacts are synced. Only when I encode the '@' in the addres URL as '%40', I can sync. So:

Doesn't sync: https://URL:8843/addressbooks/[email protected]/Contactpersonen/
Dows sync: https://URL:8843/addressbooks/test%40example.com/Contactpersonen/

An CardDav-util on my Android phone (CardDav-Sync free) doesn't have this problem with an '@' in the URL.

I see this in v0.21 and with the latest code I just checked out.
Is there any way to have sabre-zarafa make less sensitive to this behaviour?

This is with Zarafa 7.1 + Centos 6 (httpd 2.2 + php 5.3).

change contact details fail since 0.19

Since upgrading to 0.19 (from 0.18) I can not change contact details any more with Evolution. Creating new contacts does work but if I try e.g. to add an additional email it will fail with returncode 500:

evo-change-contact

Stack trace from apache error log

Stack trace:
#0 /usr/share/sabre-zarafa-0.19/vcard/VCardParser.php(256): DateTime->__construct('"3939d905ee7352...')
#1 /usr/share/sabre-zarafa-0.19/ZarafaBridge.php(355): VCardParser->vObjectToProperties('BEGIN:VCARD??VE...')
#2 /usr/share/sabre-zarafa-0.19/class.zarafafolder.php(277): Zarafa_Bridge->vcardToMapiProperties('BEGIN:VCARD??VE...')
#3 /usr/share/sabre-zarafa-0.19/ZarafaCardDavBackend.php(242): Zarafa_Folder->update_contact('771C209A-3C1496...', 'BEGIN:VCARD??VE...')
#4 /usr/share/sabre-zarafa-0.19/lib/SabreDAV/lib/Sabre/CardDAV/Card.php(95): Zarafa_CardDav_Backend->updateCard('????l???S?L|??M...', '771C209A-3C1496...', 'BEGIN:VCARD??VE...')
#5 /usr/share/sabre-zarafa-0.19/lib/SabreDAV/lib/Sabre/DAV/Server.php(885): Sabre\CardDAV\Card->put('BEGIN:VCARD??VE...')
#6 [in in /usr/share/sabre-zarafa-0.19/vcard/VCardParser.php on line 256```

![debug log of failing with 0.19](https://gist.github.com/Germar/5681863#file-debug-0-19-txt)
![debug log of successful changing details with 0.18](https://gist.github.com/Germar/5681863#file-debug-0-18-txt)

Not all contacts are provided

With zarafa-server-7.0.13-1.el6 (on RHEL-6, no I would prefer not to update to 7.1) and sabre-zarafa@2a0360c9 I don't get all contacts when I sync with either Android CardDAV sync or Thunderbird w/SoGo addon I get just some contacts synced.

Zarafa web interface claims I have 304 contacts, Thunderbird receives only 237 contacts (and I am not sure how to count number of contacts in the Android).

This is the part of the debug.txt log when I called “Synchronize” in THunderbird.

tail -f /var/log/httpd/luther.ceplovi.cz-*_log /var/www/sabre-zarafa/debug.txt
2013-03-21 11:11:59 INFO  server  - SabreDAV version 1.6.1-stable
2013-03-21 11:11:59 INFO  server  - Producer: -//SabreDav/ZarafaBackend/0.15
2013-03-21 11:11:59 INFO  server  - Revision: 1 - $Format:%ci$
2013-03-21 11:12:00 INFO  Zarafa_Principals_Backend  - getPrincipalByPath(principals/matej)
2013-03-21 11:12:00 INFO  Zarafa_Principals_Backend  - getPrincipalsByPrefix(principals)
2013-03-21 11:12:00 DEBUG Zarafa_Bridge  - User email address: [email protected]
2013-03-21 11:12:00 INFO  Zarafa_CardDav_Backend  - getAddressBooksForUser(principals/matej)
2013-03-21 11:12:00 DEBUG Zarafa_CardDav_Backend  - Address books:
Array
(
    [0] => Array
        (
            [id] => xz|^�yN��������&��[�n�%�@���7K��}�
            [uri] => Contacts
            [ctag] => 1298743245
            [description] => 
            [principaluri] => principals/matej
            [displayname] => Contacts
            [{urn:ietf:params:xml:ns:carddav}addressbook-description] => 
            [{http://calendarserver.org/ns/}getctag] => 1298743245
            [{urn:ietf:params:xml:ns:carddav}supported-address-data] => Sabre_CardDAV_Property_SupportedAddressData Object
                (
                    [supportedData:protected] => Array
                        (
                            [0] => Array
                                (
                                    [contentType] => text/vcard
                                    [version] => 3.0
                                )

                            [1] => Array
                                (
                                    [contentType] => text/vcard
                                    [version] => 4.0
                                )

                        )

                )

        )

)

2013-03-21 11:12:00 INFO  Zarafa_Principals_Backend  - getPrincipalByPath(principals/matej)
2013-03-21 11:12:00 INFO  Zarafa_Principals_Backend  - getPrincipalsByPrefix(principals)
2013-03-21 11:12:00 DEBUG Zarafa_Bridge  - User email address: [email protected]
2013-03-21 11:12:00 INFO  Zarafa_CardDav_Backend  - getAddressBooksForUser(principals/matej)
2013-03-21 11:12:00 DEBUG Zarafa_CardDav_Backend  - Address books:
Array
(
    [0] => Array
        (
            [id] => xz|^�yN��������&��[�n�%�@���7K��}�
            [uri] => Contacts
            [ctag] => 1298743245
            [description] => 
            [principaluri] => principals/matej
            [displayname] => Contacts
            [{urn:ietf:params:xml:ns:carddav}addressbook-description] => 
            [{http://calendarserver.org/ns/}getctag] => 1298743245
            [{urn:ietf:params:xml:ns:carddav}supported-address-data] => Sabre_CardDAV_Property_SupportedAddressData Object
                (
                    [supportedData:protected] => Array
                        (
                            [0] => Array
                                (
                                    [contentType] => text/vcard
                                    [version] => 3.0
                                )

                            [1] => Array
                                (
                                    [contentType] => text/vcard
                                    [version] => 4.0
                                )

                        )

                )

        )

    [1] => Array
        (
            [id] => xz|^�yN��������&��[�n�%�@���7K��}�
            [uri] => Contacts
            [ctag] => 1298743245
            [description] => 
            [principaluri] => principals/matej
            [displayname] => Contacts
            [{urn:ietf:params:xml:ns:carddav}addressbook-description] => 
            [{http://calendarserver.org/ns/}getctag] => 1298743245
            [{urn:ietf:params:xml:ns:carddav}supported-address-data] => Sabre_CardDAV_Property_SupportedAddressData Object
                (
                    [supportedData:protected] => Array
                        (
                            [0] => Array
                                (
                                    [contentType] => text/vcard
                                    [version] => 3.0
                                )

                            [1] => Array
                                (
                                    [contentType] => text/vcard
                                    [version] => 4.0
                                )

                        )

                )

        )

)

2013-03-21 11:12:00 INFO  Zarafa_Principals_Backend  - getPrincipalByPath(principals/matej)
2013-03-21 11:12:00 INFO  Zarafa_Principals_Backend  - getPrincipalsByPrefix(principals)
2013-03-21 11:12:00 DEBUG Zarafa_Bridge  - User email address: [email protected]
2013-03-21 11:12:00 INFO  Zarafa_Principals_Backend  - getGroupMembership(principals/matej)
2013-03-21 11:12:00 INFO  Zarafa_Principals_Backend  - getPrincipalByPath(principals/matej)
2013-03-21 11:12:00 INFO  Zarafa_Principals_Backend  - getPrincipalsByPrefix(principals)
2013-03-21 11:12:00 DEBUG Zarafa_Bridge  - User email address: [email protected]

Only private contacts shown in Mac OS X when both private and public contacts exist

I can only access the private contacts in Mac OS X when both private and public contacts exist and define('FOLDER_RENAME_PATTERN', '%p'); is set in config.inc.php. Things work fine when I try it on other platforms, but the Mac OS X Contacts app always seem to use the first contacts folder(?)
Is this a known issue with their implementation maybe? I'm not really impressed by their software anyway, but my boss uses a MacBook... I can provide a debug log if that helps, I see a "Zarafa_CardDav_Backend - Address books:" message followed by an array that contains references to both the private and public folders but that doesn't really help.

exposed password in log if login failed

I'm not sure if this was because of the wrong permissions for the debug.txt but when I recently logged in and accidental typed a wrong password I found that password in my apache log (XXXXXX in the log below). I think it would be good to add an exception handler so this will not expose in the log.

error.log:

[Wed May 08 18:02:58 2013] [error] [client 192.168.0.165] PHP Warning:  fopen(/usr/share/sabre-zarafa/debug.txt): failed to open stream: Permission denied in /usr/share/sabre-zarafa-0.18/lib/log4php/appenders/LoggerAppenderFile.php on line 99
[Wed May 08 18:02:58 2013] [error] [client 192.168.0.165] PHP Warning:  log4php: [LoggerAppenderRollingFile:fileAppender]: Failed opening target file. Closing appender. in /usr/share/sabre-zarafa-0.18/lib/log4php/LoggerAppender.php on line 283
[Wed May 08 18:02:58 2013] [error] [client 192.168.0.165] PHP Fatal error:  Uncaught exception 'ErrorException' with message 'mapi_logon_zarafa(): 
Unable to setup service for provider' in /usr/share/sabre-zarafa-0.18/ZarafaBridge.php:91
Stack trace:
#0 [internal function]: exception_error_handler(2, 'mapi_logon_zara...', '/usr/share/sabr...', 91, Array)
#1 /usr/share/sabre-zarafa-0.18/ZarafaBridge.php(91): mapi_logon_zarafa('USER', 'XXXXXXX', 'file:///var/run...')
#2 /usr/share/sabre-zarafa-0.18/ZarafaAuthBackend.php(44): Zarafa_Bridge->connect('USER', 'XXXXXXX')
#3 /usr/share/sabre-zarafa-0.18/lib/SabreDAV/lib/Sabre/DAV/Auth/Backend/AbstractBasic.php(77): Zarafa_Auth_Basic_Backend->validateUserPass('USER', 'XXXXXXX')
#4 /usr/share/sabre-zarafa-0.18/lib/SabreDAV/lib/Sabre/DAV/Auth/Plugin.php(108): Sabre\\DAV\\Auth\\Backend\\AbstractBasic->authenticate(Object(Sabre\\DAV\\Server), 'Zarafa SabreDAV...')
#5 [internal function]: Sabre\\DAV\\Auth\\Plugin->beforeMethod('PROPFIND', 'addressbooks/ge...')
#6 /usr/share/sabre-zarafa-0.18/lib/SabreDAV/lib/Sabre/DAV/Server.php(433): c in /usr/share/sabre-zarafa-0.18/ZarafaBridge.php on line 91

server:

Debian 6 Squeeze

$ /usr/sbin/apache2 -v
Server version: Apache/2.2.16 (Debian)
Server built:   Mar  3 2013 11:36:05
$ /usr/bin/php5 -v
PHP 5.3.3-7+squeeze15 with Suhosin-Patch (cli) (built: Mar  4 2013 14:05:25) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with XCache v1.3.0, Copyright (c) 2005-2009, by mOo
    with Suhosin v0.9.32.1, Copyright (c) 2007-2010, by SektionEins GmbH
$ /usr/bin/zarafa-admin -V
Product version:    7,0,13,41388
File version:       41388
$ tail -n 2 /usr/share/sabre-zarafa-0.18/version.inc.php
    define ('SABRE_ZARAFA_REV', '6c07b68');
    define ('SABRE_ZARAFA_DATE', '2013-04-22 13:55:49 +0200');

client:

Ubuntu Quantal 12.10

$ evolution -v
evolution 3.6.2

Error message with SabreDAV-1.8.6.zip

I have SabreDAV-1.8.6.zip and sabre-zarafa from c420b57 and when I enable display_errors and html_errors I get this:

Warning: Missing argument 1 for Sabre\VObject\Component::__construct(),
called in /var/www/carddav/vcard/VCardProducer.php on line 56 and
defined in
/var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Component.php
on line 78
Notice: Undefined variable: name in
/var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Component.php on line 80
Fatal error: Uncaught exception 'InvalidArgumentException' with message
'The value argument must be scalar or null' in
/var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Property.php:122
Stack trace: #0 /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Property.php(100):
Sabre\VObject\Property->__construct('N', Array, Array)
#1 /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Component.php(182):
Sabre\VObject\Property::create('N', Array, Array)
#2 /var/www/carddav/vcard/VCardProducer.php(159): Sabre\VObject\Component->add('N', Array)
#3 /var/www/carddav/ZarafaBridge.php(476): VCardProducer->propertiesToVObject(Resource id #130, Array)
#4 /var/www/carddav/class.zarafafolder.php(89): Zarafa_Bridge->getContactVCard(Array, Resource id #99)
#5 /var/www/carddav/class.zarafafolder.php(121): Zarafa_Folder->contact_to_dav(Array)
#6 /var/www/carddav/ZarafaCardDavBackend.php(176): Zarafa_Folder->get_dav_cards()
#7 /var/www/carddav/lib/SabreDAV/lib/Sabre/CardDAV/AddressBook.php in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Property.php on line 122

My configuration is http://paste.fedoraproject.org/73611/62519139/

MAC OSX contacts fails with following error: "The operation couldn't be completed (CoreDAV ErrorDomain error 1)".

Issue copied from Zarafa Forum

I have downloaded the latest version sabre-zarafa-0.18 and installed with zarafa 7.14. I can access my contacts through the web browser fine with https://servername:8008. But my MAC OSX contacts fails with following error: "The operation couldn't be completed (CoreDAV ErrorDomain error 1)". I am using OSX 10.8.3(12D78) and MAC Contacts 7.1(1169). Does anyone has this working with versions?

Connection is via SSL and SSL is enabled.

Following from Apache SSL access log:
23/Apr/2013:19:56:45 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND /.well-known/carddav HTTP/1.1" 126 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:19:56:45 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND /.well-known/carddav HTTP/1.1" 127 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:19:56:45 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND / HTTP/1.1" 126 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:19:56:45 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND / HTTP/1.1" 127 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:19:56:46 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND /principals/ HTTP/1.1" 127 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:20:02:21 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND /.well-known/carddav HTTP/1.1" 126 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:20:02:22 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND /.well-known/carddav HTTP/1.1" 127 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:20:02:23 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND / HTTP/1.1" 126 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:20:02:23 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND / HTTP/1.1" 127 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:20:02:23 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND /principals/ HTTP/1.1" 127 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:20:03:05 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND /.well-known/carddav HTTP/1.1" 126 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:20:03:06 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND /.well-known/carddav HTTP/1.1" 127 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:20:03:06 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND / HTTP/1.1" 126 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:20:03:06 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND / HTTP/1.1" 127 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169"
[23/Apr/2013:20:03:06 +1000] 10.211.55.2 TLSv1 AES128-SHA "PROPFIND /principals/ HTTP/1.1" 127 "-" "Mac OS X/10.8.3 (12D78) AddressBook/1169

Reply With Quote Reply With Quote

Missing argument 1 for Sabre\\VObject\\Component::__construct()

Running sabre-zarafa@c420b5710a3890753a9fc79cab9a80043e5faed4 on RHEL-6 with Zarafa 7.1.7 I get these error messages in /var/log/httpd/*_error_log file and my Evolution cannot read any contacts.

[Mon Jan 20 20:17:14 2014] [error] [client 192.168.0.6] PHP Warning:  Missing argument 1 for Sabre\\VObject\\Component::__construct(), called in /var/www/carddav/vcard/VCardProducer.php on line 56 and defined in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Component.php on line 78
[Mon Jan 20 20:17:14 2014] [error] [client 192.168.0.6] PHP Notice:  Undefined variable: name in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Component.php on line 80
[Mon Jan 20 20:17:14 2014] [error] [client 192.168.0.6] PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with message 'The value argument must be scalar or null' in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Property.php:122\nStack trace:\n#0 /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Property.php(100): Sabre\\VObject\\Property->__construct('N', Array, Array)\n#1 /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Component.php(182): Sabre\\VObject\\Property::create('N', Array, Array)\n#2 /var/www/carddav/vcard/VCardProducer.php(159): Sabre\\VObject\\Component->add('N', Array)\n#3 /var/www/carddav/ZarafaBridge.php(476): VCardProducer->propertiesToVObject(Resource id #86, Array)\n#4 /var/www/carddav/class.zarafafolder.php(89): Zarafa_Bridge->getContactVCard(Array, Resource id #58)\n#5 /var/www/carddav/class.zarafafolder.php(121): Zarafa_Folder->contact_to_dav(Array)\n#6 /var/www/carddav/ZarafaCardDavBackend.php(176): Zarafa_Folder->get_dav_cards()\n#7 /var/www/carddav/lib/SabreDAV/lib/Sabre/CardDAV/AddressBook.php( in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Property.php on line 122
[Mon Jan 20 20:17:23 2014] [error] [client 192.168.0.6] PHP Warning:  Missing argument 1 for Sabre\\VObject\\Component::__construct(), called in /var/www/carddav/vcard/VCardProducer.php on line 56 and defined in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Component.php on line 78
[Mon Jan 20 20:17:23 2014] [error] [client 192.168.0.6] PHP Notice:  Undefined variable: name in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Component.php on line 80
[Mon Jan 20 20:17:23 2014] [error] [client 192.168.0.6] PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with message 'The value argument must be scalar or null' in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Property.php:122\nStack trace:\n#0 /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Property.php(100): Sabre\\VObject\\Property->__construct('N', Array, Array)\n#1 /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Component.php(182): Sabre\\VObject\\Property::create('N', Array, Array)\n#2 /var/www/carddav/vcard/VCardProducer.php(159): Sabre\\VObject\\Component->add('N', Array)\n#3 /var/www/carddav/ZarafaBridge.php(476): VCardProducer->propertiesToVObject(Resource id #86, Array)\n#4 /var/www/carddav/class.zarafafolder.php(89): Zarafa_Bridge->getContactVCard(Array, Resource id #58)\n#5 /var/www/carddav/class.zarafafolder.php(121): Zarafa_Folder->contact_to_dav(Array)\n#6 /var/www/carddav/ZarafaCardDavBackend.php(176): Zarafa_Folder->get_dav_cards()\n#7 /var/www/carddav/lib/SabreDAV/lib/Sabre/CardDAV/AddressBook.php( in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Property.php on line 122
[Mon Jan 20 20:17:33 2014] [error] [client 192.168.0.6] PHP Warning:  Missing argument 1 for Sabre\\VObject\\Component::__construct(), called in /var/www/carddav/vcard/VCardProducer.php on line 56 and defined in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Component.php on line 78
[Mon Jan 20 20:17:33 2014] [error] [client 192.168.0.6] PHP Notice:  Undefined variable: name in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Component.php on line 80
[Mon Jan 20 20:17:33 2014] [error] [client 192.168.0.6] PHP Fatal error:  Uncaught exception 'InvalidArgumentException' with message 'The value argument must be scalar or null' in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Property.php:122\nStack trace:\n#0 /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Property.php(100): Sabre\\VObject\\Property->__construct('N', Array, Array)\n#1 /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Component.php(182): Sabre\\VObject\\Property::create('N', Array, Array)\n#2 /var/www/carddav/vcard/VCardProducer.php(159): Sabre\\VObject\\Component->add('N', Array)\n#3 /var/www/carddav/ZarafaBridge.php(476): VCardProducer->propertiesToVObject(Resource id #86, Array)\n#4 /var/www/carddav/class.zarafafolder.php(89): Zarafa_Bridge->getContactVCard(Array, Resource id #58)\n#5 /var/www/carddav/class.zarafafolder.php(121): Zarafa_Folder->contact_to_dav(Array)\n#6 /var/www/carddav/ZarafaCardDavBackend.php(176): Zarafa_Folder->get_dav_cards()\n#7 /var/www/carddav/lib/SabreDAV/lib/Sabre/CardDAV/AddressBook.php( in /var/www/carddav/lib/SabreDAV/vendor/sabre/vobject/lib/Sabre/VObject/Property.php on line 122

Compatibility with PHP 7 on Ubuntu 16.04 (and kopano core)

sabre-zarafa crashes my apache on ubuntu 16.04 (segmentation fault, signal 11).

Culprit seems to be
// Disable MAPI exceptions;
// we handle errors by checking a function's return status (at least for now):
mapi_enable_exceptions(false);
in server.php.

If I remove this line, sabre-zarafa seems to work on ubuntu 16.04 with kopano core (8.2.0.441)
(had to change
// Zarafa server location
define ('ZARAFA_SERVER', 'file:///var/run/kopano/server.sock');
in config.inc.php as well).

From the sources of the php-mapi extension libraries of zarafa and kopano, it looks to me, that disabling mapi exception handling explicitly is not necessary. The function mapi_enable_exceptions(...) does nothing, if it does not get an exception class as parameter (see line 7773 and following here). So removing mapi_enable_exceptions(false); from server.php should be OK.

Emtpy addressbooks

Hi,
please, hopefully a quick fix, but when the contact book is empty in zarafa... the /addressbooks/user.name/Contacts/ doesn't exists.

Can it exist and be empty?

Thank you!

Great job mate!

Marco

User "seems" authenticated to client even if a wrong PW was submitted

I installed sabre-zarafa release 0.21 as described in README.md and it is working so far.

But if one submits a wrong password, the server won't be able to login to the Zarafa Backend, but in communication with the CardDAV client (i.e. Mac OS X Address Book) it looks like a "working" connection. Same if you try to an auth via browser, it looks "authenticated" with everything you type in as a password.

I think sabre-zarafa should drop a "401 Auth Required" to the client instead.

vCards contain PHP warnings

I am debugging a sabre-zarafa setup and found a curious situation: Due to relatively high log levels and display_errors=true, PHP writes warnings into the vCards.

This is a sample vCard opened via a GET request:

BEGIN:VCARD
VERSION:3.0
PRODID:-//SabreDav/ZarafaBackend/0.21
FN:Gustav Schmidt
N:Schmidt;Gustav;;;
SORT-STRING:Schmidt\, Gustav
REV:2014-01-24T12:39:12+01:00
EMAIL;PREF=1;X-CN="^'^'":
EMAIL;PREF=2;X-CN="^'^'":
EMAIL;PREF=3;X-CN="^'^'":
UID:36d413a5-ef92-731d-0964-97aac81a6b5f
END:VCARD
<br />
<b>Warning</b>:  filesize() [<a href='function.filesize'>function.filesize</a>]: stat failed for debug.txt in <b>/srv/www/htdocs/sabre-zarafa/lib/log4php/appenders/LoggerAppenderRollingFile.php</b> on line <b>223</b><br />

Not exactly something I wanted :-)

Kopano kdav as a potential alternative to sabre-zarafa

Hi everyone,

for those running sabre-zarafa and maybe experiencing some issues. We at Kopano have recently experimented with SabreDav as well and have just a few days ago made the code repository public for our implementation. In addition to only providing CardDAV kdav also provides CalDAV support through Sabredav. The mid to long term goal is that this will replace the current kopano-ical implementation (including proper packaging at al).

Code and install instructions can be found at https://stash.kopano.io/projects/KC/repos/kdav/browse

I'm looking forward to your feedback.

Wrong Birthdays in vcf prior 1956

Hi everybody,

came across this issue:

A contacts birthday is set prior 1956-10-01 (1956-04-12) per Zarafas WebApp. In the WebApp and synced via Z-Push to different devices, the birthday everywhere is correctly displayed as 1956-04-12.

When using sabre-zarafa the resulting BDAY in the .vcf is 19560411 one day before as one can see.

For debugging a little I changed the DateFormat in config.inc.php to :

define ('DATE_PATTERN', 'YmdHis');
for getting the complete resulting date including time in the .vcf.

For the wrong birthdate this gives:

BDAY:19560411230000

As one can see, the date is one hour before the correct date and so the day is wrong.

Assuming this has sth. to do with summertime calcs I changed the birthdate to 1956-10-01 in Zarafas WebApp (as can be read in Wikipedia, 1956 was the starting year for summertime changes till now).
With this date this is in the resulting .vcf:

BDAY:19561001000000

The hour is correctly set to "00:00:00" and so the day is correct, too.

Any idea what could be wrong here? (The timezone in the config.inc.php is correctly set to "Europe/Berlin" as everywhere else in the system)

Thx in advance!

Could we patch php-sabre-vobject 2.* to work?

I see

Updating to this brand new version is necessary because the Sabre-VObject 2.x library shipped with SabreDAV 1.8 does not properly escape multiline property values. This caused multiline notes to come out wrong, and the sync to fail with such clients as OS X Contacts.app.

We have in RHEL-EPEL 6 php-sabre-dav 1.8.7 which has (because that’s what they effectively have in composer.json) Require: php-sabre-vobject < 2.2. Would it be possible to indicate which commit would make php-sabre-vobject 2.1 compatible with sabre-zarafa if added as a patch, so that we can add it to our package (of course, only if that doesn’t change API)?

Contacts imported of VCF files through Mac OS X Contacts.app don't show addresses in Zarafa webapp

Im using Contacts.app (v 7.1 (1170)) on Mac OS X 10.8.4 to connect to Zarafa (ZCP 7.1.2-39121) via sabre-zarafa (0.21).

I've successfully set up sabre-zarafa as per instructions. sabre-zarafa is located in the subdirectory 'sabre-zarafa' and not the web root.

I can use Contacts.app to create addressbook entries on Zarafa by dragging cards in Contacts.app onto the CardDAV addressbook.

The created contacts show all information in Contacts.app but when looking at them in the Zarafa webapp the following information is missing:

  • address information
  • telephone number (cell phone number does show)

I observed that when an address is entered in webapp it will sync okay to Contacts.app but not the other way around.

Here's a test vCard which can be used to reproduce the issues:
BEGIN:VCARD
VERSION:3.0
ITEM1.X-ABLABEL:PROFILE
UID:b068ec40d8
REV:2013-03-19T20:52:21+00:00
PRODID:-//ownCloud//NONSGML Contacts 0.2.4//EN
ITEM1.URL:http://www.google.com/profiles/1234567890
TEL:+1 800 888888
FN:TestFirst TestLast
N:TestLast;TestFirst;;;
EMAIL;TYPE=INTERNET:[email protected]
TEL;TYPE=CELL:+1 800 77777777
ADR;TYPE=HOME:;;33 Test Ave;Test District,\nTestCity;;;TestCountry
END:VCARD

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /usr/local/share/sabre-zarafa/server.php on line 93

Hi.
I installed Sabre Zarafa v0.21 using SabreDAV 1.8.7, Sabre-VObject 3.1.3 and log4php 2.3.0 on a Debian Lenny 64bit system but I'm getting the following error when I try to access using a browser:

Warning: Unexpected character in input: '' (ASCII=92) state=1 in /usr/local/share/sabre-zarafa/server.php on line 93

Parse error: syntax error, unexpected T_STRING, expecting ')' in /usr/local/share/sabre-zarafa/server.php on line 93

I tried to install a second time, but I get the same error.

I cannot understand if it is a bug or a configuration error.

OS X Contacts.app re-creating vCards on every sync

I did install 3.2 of calendarserver (trac.calendarserver.org) to find the differences (if any). With calendarserver Contacts.app uses POST as REQUEST_METHOD and with sabre-zarafa it uses PUT. After digging through SabreDAV I realised that POST is not in the list of supported methods. On calendarserver the contact is created without a problem, if you like you can PM me and I'll put a recent version of calendarserver into a dedicated VM and give you access. Or if you want me to do some specific tests.

cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.