WebMail Pro 8 documentation

Configuring DAV server

Introduction

WebMail Pro 8 uses DAV server internally, for storing data and syncing it with mobile and other clients. Typically, it will work out of the box, but you might need to perform additional reconfiguration, depending on your needs and specific environment.

By default, URL used for DAV sync is not supplied in product configuration. Standard URL would look like http://www.yourdomain.com/aurora/dav.php/ (with the trailing slash required), where http://www.yourdomain.com/aurora/ is URL pointing to WebMail Pro 8 installation. For this to work with Apache, you might need to recheck that AcceptPathInfo is not disabled in Apache configuration.

It is strongly advised to configure your web server so that URLs are rewritten and easier to enter from, say, mobile device.

Configuring Apache

For Apache web server, URL rewriting is ensured by adding virtual host with the following configuration:

<VirtualHost>
DocumentRoot /var/www/aurora/
RewriteEngine On
RewriteRule ^/(.*)$ /dav.php [L]
</VirtualHost>

DocumentRoot should point to root directory of WebMail Pro 8 installation location. Standard port 80 is used. Many applications, however, treat port 8008 as a default one, configuration would look a bit different in this case:

NameVirtualHost *:8008
Listen 8008
<VirtualHost>
DocumentRoot /var/www/aurora/
RewriteEngine On
RewriteRule ^/(.*)$ /dav.php [L]
</VirtualHost>

Also, you need to make sure http methods required by DAV server are not blocked in web server configuration. If there are LimitExcept directives used in VirtualHost or Directory containers, those should be removed.

Configuration for nginx

For nginx webserver, add the following rule to your current location:

root aurora;
index dav.php;
if ( !-d $request_filename) {
    rewrite ^(.*) /dav.php last;
}

In the above configuration sample, aurora stands for WebMail Pro 8 installation location.

To make sure all the http methods required by DAV server are allowed, the following configuration is performed:

if ($request_method ~ ^(OPTIONS|GET|HEAD|DELETE|PROPFIND|PUT|PROPPATCH|COPY|MOVE|MKCOL|REPORT)$) {
    fastcgi_pass 127.0.0.1:1028;
}

It should point to existing PHP backend or another web server where PHP backend runs.

Typical host configuration would look like:

location / {
    include fastcgi_params;
    fastcgi_read_timeout 600s;
    fastcgi_pass  unix:/opt/afterlogic/tmp/php5-fpm.sock;
    fastcgi_param  SCRIPT_FILENAME  $document_root/dav.php;
    fastcgi_split_path_info ^(.+\.php)(/[^?]*).*$;
    fastcgi_param  SCRIPT_NAME      $fastcgi_script_name;
    fastcgi_param  PATH_INFO        $fastcgi_path_info;
}

However, if you choose to use a separate domain or subdomain for DAV access, configuration will be different:

location = / {
    try_files @dav @dav;
}
location / {
    try_files $uri $uri/ @dav;
}
location ~* \.php$ {
    return 404;
}
location @dav {
    include fastcgi_params;
    fastcgi_read_timeout   180s;
    fastcgi_pass    unix:/opt/afterlogic/tmp/php5-fpm.sock;
    fastcgi_index   dav.php;
    fastcgi_param   SCRIPT_FILENAME $document_root/dav.php;
}

Troubleshooting

In general case, DAV access should work right away. However, in some cases, you might need to reconfigure your web server additionally.

If it looks like the connection to DAV server is established, but your account credentials are not accepted, you can try logging into DAV server via your web browser. That feature is disabled by default, you can enable it by setting UseBrowserPlugin to true in data/settings/modules/Dav.config.json file.

Upon changing the setting, enter your DAV URL in address bar of web browser and enter credentials for any WebMail Pro 8 account. If they're rejected and prompt appears again, that means there's a configuration issue with your web server.

In case if you use IIS, or your system is configured to use PHP through CGI or FastCGI, you'll probably need to perform additional configuration. Check Webservers page of DAV server documentation for details on this.

You may also need to recheck ModSecurity configuration which could be blocking some of HTTP methods required by DAV.