WebMail Pro documentation

Configuring DAV server


WebMail Pro 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 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. Some DAV clients (iOS and MacOS X, for example) won't work with DAV URLs ending with /dav.php/ so you need to ensure a dedicated subdomain or port is used for DAV access. And we recommend setting up SSL on web server so the URLs are accessed via https rather than http. Upon reconfiguring your web server accordingly, be sure to specify the correct URL in "Mobile sync" tab of admin interface.

Configuring Apache

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

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

DocumentRoot should point to root directory of WebMail Pro 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
DocumentRoot /var/www/aurora/
RewriteEngine On
RewriteRule ^/(.*)$ /dav.php [L]

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 installation location.

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


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;

Configuration for IIS

In case of IIS on Windows, you can define the list of allowed methods under Handler Mappings > PHP_via_FastCGI > Request Restrictions... > Verbs tab. Try supplying the following list there: OPTIONS,GET,HEAD,DELETE,PROPFIND,PUT,PROPPATCH,COPY,MOVE,MKCOL,REPORT

One of our customers reported that, to make things work, they needed to supply the following list: GET,HEAD,POST,DEBUG,PUT,DELETE,PATCH,OPTIONS,PROPFIND, COPY,LOCK,MKCOL,MOVE,PROPPATCH,UNLOCK,TRACE,REPORT

Configuring .well-known access

Another good way of ensuring proper mobile sync setup is to use .well-known access. Various clients, including the one used in iOS, attempt to determine correct DAV URL by sending request to a special subdirectory name, and we can handle those requests to redirect to DAV server.

In case of Apache, configuration would look like:

RewriteEngine on
RewriteRule .* - 
Redirect 301 /.well-known/carddav /webmail/dav.php/
Redirect 301 /.well-known/caldav /webmail/dav.php/

or just supply the following in .htaccess file:

Redirect 301 /.well-known/carddav /webmail/dav.php/
Redirect 301 /.well-known/caldav /webmail/dav.php/

For nginx, the following configuration should help:

location / {
   rewrite ^/.well-known/carddav /webmail/dav.php/ redirect;
   rewrite ^/.well-known/caldav /webmail/dav.php/ redirect;

NB: With configuration settings supplied that way, you'll need to use your WebMail Pro installation URL as DAV URL, without any suffixes etc.

Using DAV on cPanel

In case when WebMail Pro was installed via cPanel installer using direct embedding approach, using DAV is not an option as it conflicts with webmail authentication layer of cPanel.

If you'd like to use Mobile Sync, consider using alternative installation method which essentially means setting up regular product package.

To allow for using DAV, create .htaccess file in WebMail directory and place the following content there:

        RewriteEngine on 
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L] 

If this still doesn't work for you, you might need to recheck ModSecurity configuration which could be blocking some of HTTP methods required by DAV.

Username VS email as login

If your WebMail Pro installation and your mail server are configured to accept usernames as login, rather than full email address, you'll need to adjust DAV server accordingly as well. Check data/settings/modules/Dav.config.json configuration file:

    "UseFullEmailForLogin": [
    "DomainForLoginWithoutEmail": [

Set UseFullEmailForLogin to false and supply your email domain as DomainForLoginWithoutEmail parameter.


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 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.

By default, DAV server of WebMail Pro is configured for Basic authentication. If a particular client requires Digest auth, you can enable it by setting UseDigestAuth to true in data/settings/modules/Dav.config.json file.