1234

How to setup Webmail, ActiveSync, CalDav, CardDav, and AutoDiscover services in IIS10

The following procedure details how to setup Webmail, ActiveSync, CalDAV, CardDAV, and AutoDiscover to run under IIS10 for Windows 2016 with the 64-bit version of MDaemon installed.

Note: The setup of these services under IIS is not supported by MDaemon Technologies' technical support team.  Those who choose to run any MDaemon related protocol or service under IIS must be aware of all security issues and ramifications of running any applications under IIS.

    1. Install the Web Server Role with ISAPI support (for exact steps please consult your Operating System documentation)
    2. Close Internet Information Services (IIS) Manager if it's open
    3. Install Microsoft's IIS URL Rewrite 2.0 (Required for ActiveSync and CalDAV/CardDAV protocols)
      1. Navigate to http://www.iis.net/download/URLRewrite in a web browser
      2. Run the installer to install the extension
    4. Open the IIS Manager 
      To do this:
      1. Click Start
      2. Click All Programs
      3. Click Administrative Tools
      4. Click Internet Information Services (IIS) Manager
    5. On the Connections pane, expand the [Machine_name] node
    6. Right click on Sites
    7. Click Add Web Site

    8. Enter a Site name (i.e. Webmail). This will also create an Application Pool by the same name as the web site (do not manually create an Application Pool).
    9. Click the browse button (the button with '...') by Physical path and browse to the 'MDaemon\WorldClient\HTML' directory
    10. Set up the bindings as desired in the Binding section
    11. Click OK

    12. Click on the Webmail site in the Connections pane. 
    13. Double click on Default Document 
    14. Verify the default document is worldclient.dll
    15. Remove any existing Default Documents other than worldclient.dll
    16. Click Add and enter 'worldclient.dll' if the entry does exist
    17. Click on the Webmail site in the Connections pane 
    18. Double click on Handler Mappings 
    19. Click Edit Feature Permissions on the Actions pane. 
    20. Verify the boxes for Read and Script are selected (checked), and select (check) the box for Execute
    21. Click OK 
    22. Double click ISAPI-dll under the Enabled column 
    23. Change the value for the Request Path field from '*.dll' to 'WorldClient.dll'
    24. Set Module as IsapiModule
    25. Under Executable, click the browse button (the button with '...')
    26. Browse to 'MDaemon\WorldClient\HTML\WorldClient.dll' (on the C:\ drive by default)
    27. Click OK 
    28. Click Yes on the dialog that asks 'Do you want to allow this ISAPI extension...'


    29. MDaemon versions 19.5 and above will need to perform additional steps to utilize the updated Mobile theme.
        1. Edit the Default Document of the Webmail folder
          1. Select the Webmail folder (not to be confused with the Webmail site name in this example)
          2. Double click Default Document
          3. Select the WorldClient.dll default document
          4. Click Remove

          5. Click Add
          6. Enter index.html
          7. Click OK

        2.  Redirect WorldClientAPI requests to the worldclient.dll
          1. Select the Webmail website
          2. Double click on Handler Mappings
          3. Select Add Script Map...

          4. Enter WorldClientAPI in the Request Path
          5. The Executable Path is the worldclient.dll in the \MDaemon\WorldClient\HTML directory
          6. Enter WorldClientAPI for the name
          7. Click Request Restrictions

          8. Remove the check mark in the Invoke handler only if request is mapped to:
          9. Select the Verbs tab and verify All verbs is selected
          10. Select the Access tab and select Execute

          11. Click OK
          12. Click Yes
        3. Create URL Rewite
          1. Select the Webmail folder (not to be confused with the Webmail site name in this example)
          2. Double Click URL Rewrite
          3. Select Add Rules from the Actions menu
          4. Select Blank rule
          5. Click OK
          6. Enter a name for the Inbound Rule
          7. Select Matches the Pattern in the Requested URL
          8. Select Regular Expressions in the Using drop down
          9. Enter .* in the Pattern text box
          10. Expand the Conditions section
          11. Click Add in the Condition section
          12. Select Is Not a Directory in the Check if input string section
            This changes the Condition to {REQUEST_FILENAME}
          13. Click OK
          14. Click Add in the Condition section
          15. Select Is Not a File in the Check if input string section
            This changes the Condition to {REQUEST_FILENAME}
          16. Click OK
          17. Select Rewrite for the Action Type
          18. Enter index.html in the Action Properties
          19. Check Append query string
          20. Check Log rewritten URL
          21. Click Apply to apply the Inbound rule

    30. Add the MDAirSync.dll mapping.
      1. On the Handler Mappings Actions menu on the right, click on 'Add Script Map...' 
      2. In the Request Path field, enter 'MDAirSync.dll'
      3. Under Executable, click the browse button (the button with '...')
      4. Browse to 'MDaemon\WorldClient\HTML\MDAirSync.dll' (on the C:\ drive by default)
      5. In the Name field, enter 'MDAirSync.dll'
      6. Click the Request Restrictions button 
      7. Under the Access tab, select Execute

      8. Click OK
      9. Click OK 
      10. Click Yes on the dialog that asks 'Do you want to allow this ISAPI extension...'

    31. Add the MDAutoDiscover.dll mapping.
      1. On the Handler Mappings Actions menu on the right, click on 'Add Script Map...' 
      2. In the Request Path field, enter 'MDAutoDiscover.dll'
      3. Under Executable, click the browse button (the button with '...')
      4. Browse to 'MDaemon\WorldClient\HTML\MDAutoDiscover.dll' (on the C:\ drive by default)
      5. In the Name field, enter 'MDAutoDiscover.dll'
      6. Click the Request Restrictions button
         
      7. Under the Access tab, select Execute

      8. Click OK
      9. Click OK 
      10. Click Yes on the dialog that asks 'Do you want to allow this ISAPI extension...'

    32. Add the CalDAV service to IIS.
      1. Select the Webmail site from the Connections panel.
      2. Double click URL Rewrite

      3. Select Add Rule(s)...
      4. Select Blank rule
      5. Click OK

      6. Fill in the following information:
        1. Name: MDWebDAV.dll

        2. Requested URL: Matches the Pattern
        3. Using: Exact Match
        4. Pattern: .well-known/caldav
        5. Action Type: Redirect
        6. Redirect URL: webdav/caldav
        7. Redirect Type: Temporary (307)

    33. Add the CardDav service to IIS.
      1. Select the Webmail site from the Connections panel.
      2. Double click URL Rewrite
      3. Select Add Rule(s)...
      4. Select Blank rule
      5. Click OK
      6. Fill in the following information:
        1. Name: MDWebDAV.dll

        2. Requested URL: Matches the Pattern
        3. Using: Exact Match
        4. Pattern: .well-known/carddav
        5. Action Type: Redirect
        6. Redirect URL: webdav/carddav
        7. Redirect Type: Temporary (307)

    34. To configure the Microsoft ActiveSync protocol, complete these steps:
      1. Open the IIS Manage
        1. Press Start
        2. Select Administrative Tools
        3. Click Internet Information Services (IIS) Manager
      2. On the Connections pane, expand the [Machine_name] node
      3. Expand the Sites node
      4. Click on the Webmail site in the Connections pane
      5. Double click on URL Rewrite 
      6. On the Actions pane, click Add Rule(s)...
        1. Under Inbound Rules, select Blank Rule and click OK 
        2. Name the rule: MDAirSync.dll
        3. Under Match URLset these settings:
          1. Requested URL: Matches the Pattern (default)
          2. Using: Regular Expressions (default)
          3. Pattern: ^Microsoft-Server-ActiveSync
          4. Ignore Case: Enabled (default) 
        4. Under Action set these settings:
          1. Action type: Rewrite (default)
          2. Rewrite URL: mdairsync.dll
          3. Append query string: Enabled (default) 
        5. In the Actions pane, click Apply 
        6. In the Actions pane, click Back to Rules


    35. If using Windows Server 2008 64-bit or Windows Server 2008 R2, configure the Webmail Application Pool:
      1. Double-click on Application Pools on the Connections pane
      2. Select the Webmail application pool 
      3. On the Actions pane, click Advanced Settings... 

      4. In the General section, locate 'Enable 32-bit Applications'
      5. Select the field and choose False 
      6. In the Process Model section, set Identity to Network Service
      7. Click OK

    36. Next, update the NTFS permissions of the MDaemon directory:
      1. Open Windows Explorer
      2. Navigate to the MDaemon directory (by default, 'C:\MDaemon'
      3. Right click on the MDaemon directory
      4. Choose Properties 
      5. Choose the Security tab
      6. Click Edit 
      7. Click Add 
      8. Type 'IUSR'
      9. Click OK to close the Select Users or Groups dialog 
      10. Enable Full control under Allow for IUSR 
      11. Click Add... 
      12. Type 'Network Service'
      13. Click OK to close the Select Users or Groups dialog 
      14. Enable Full Control under Allow for Network Service
      15. Click OK to close the Permissions for MDaemon dialog and wait for the changes to take effect 
      16. Click OK to close the MDaemon Properties dialog 

Disable MDaemon's own native web server:

      1. Open the MDaemon console
        1. Click Start
        2. Click All Programs
        3. Click MDaemon
        4. Click Start MDaemon
        5. Open the Setup menu
        6. Click Web & IM Services... 
        7. Select WorldClient runs using external webserver (IIS, Apache, etc)

        8. Click OK