Skip to content
  • There are no suggestions because the search field is empty.

How to setup OneDrive integration for Webmail users

With OneDrive integration configured, MDaemon Webmail can present users with options to save message attachments directly to their Microsoft OneDrive Work or School accounts and to edit and work with documents stored there.

In order to enable OneDrive access, a Client ID and Client Secret are required, which are obtained directly from Microsoft by creating an App using Microsoft's Azure Active Directory.

An OAuth 2.0 authentication component is part of this app, which allows your Webmail users to sign-in to OneDrive and then authorize access to their OneDrive Work or School account through MDaemon.

Once authorized, users can view their folders and files that are in OneDrive. Further, they can upload, download, move, copy, rename, and delete files, as well as copy/move files to and from the local document folders. If the user wants to edit a document, clicking the option to view the file in OneDrive will allow the user to make edits to it in accordance with their permissions set in OneDrive. 

Creating and Linking Your OneDrive OAuth App
Follow the steps below to create a Microsoft Azure application to allow Webmail to authenticate using OAuth 2.0 when connecting your users to OneDrive.

  1. Go to the Microsoft Azure Active Directory page at the Azure Portal and click App Registrations in the left pane (you must sign-up for a free or pay-as-you-go Azure account if you don't have one already).
  2. Click + New Registration
  3. Enter an application name in the Name field (e.g. "OneDrive OAuth for Webmail").
  4. For "Supported account types" select Accounts in any organizational directory (Any Azure AD directory - Multitenant).
  5. For "Redirect URI" select Web and then enter your OneDrive Redirect URI. The Redirect URI displayed on the OneDrive screen is an example built from your Default Domain's SMTP host name, which should work for that domain's users when signing in to Webmail. You should add additional Redirect URIs to your app for any additional MDaemon domains your users go to when signing in to Webmail.
    • For example, https://mail.company.test/WorldClient.dll?View=OAuth&AuthRequest=OneDrive would work for any of your users who go to mail.company.test when signing in to Webmail.
  6. Click Register
  7. Make note of the Application (Client) ID (there is a copy to clipboard button beside it). You can find this ID later by clicking Overview in the left pane.
  8. If you need to add additional Redirect URIs, click the Redirect URIs: 1 web link on the right. Click Add URI and enter the URI, repeating as necessary, and click Save.
  9. Click API Permissions in the left pane.
  10. Click + Add a permission
  11. Click Microsoft Graph
  12. Click Delegated Permissions
  13. Under OpenId permissions, select offline_access.
  14. Scroll down to Files and select all the permissions listed.
  15. Scroll down to User and select User.Read.
  16. Click Add permissions
  17. Make sure to click Grant admin consent for %DOMAIN%.
  18. In the left pane, click Certificates & Secrets.
  19. Click + New Client Secret
  20. Enter a description (e.g. "Client secret for OneDrive OAuth app").
  21. Select how long before the client secret expires.
  22. Click Add
  23. Make note of the generated client secret in the Value field (there is a copy to clipboard button beside it).
    • NOTE: the client secret will not be viewable again on this page.
    • There will be a Delete icon beside the entry so that you can delete it and create a new client secret when necessary.

OneDrive setup in MDaemon Remote Administration

  1. Login to MDaemon Remote Administration.
  2. Select Main
  3. Select Webmail Settings
  4. Select OneDrive
  5. Check the Enable OneDrive Integration checkbox.
  6. Enter the OneDrive Client ID
  7. Enter the OneDrive Client Secret
  8. Click Edit text of privacy policy (optional)
  9. Click Save
    Screenshot 2025-09-22 125632

 

Using OneDrive in Webmail

Once you have created your OneDrive app and configured MDRA's OneDrive page according to the instructions above, each user who wishes to access their Work/School Microsoft OneDrive account in Webmail must first authorize access to do so.

Microsoft does not allow personal accounts to connect to OneDrive through this setup. Only work/school accounts can be used here. 

To authorize MDaemon to access your Work or School OneDrive account:

  1. Sign-in to Webmail's Pro theme.
  2. Click the Settings icon in the top right corner.
  3. Click Cloud Apps
  4. Click Setup OneDrive
  5. This will open an OAuth 2.0 dialog.
  6. Click Connect to OneDrive
  7. If you are not signed in, Microsoft OneDrive will ask for your sign-in information.
  8. Once you are signed in, Microsoft OneDrive will ask if you want to grant MDaemon access to your Microsoft OneDrive account.
  9. When you close the OAuth 2.0 dialog, this page will reload shortly thereafter.

Connecting your MDaemon account to your Microsoft OneDrive account allows you to:

  • Save message attachments to Microsoft OneDrive
  • Upload files to Microsoft OneDrive.
  • View a list of Microsoft OneDrive Folders in the folder list.
  • Delete and Download files located in Microsoft OneDrive Folders.
  • Copy files from MDaemon Document folders to Microsoft OneDrive Folders.
  • Copy and move files from Microsoft OneDrive Folders to MDaemon Document folders.

OneDrive Limitations:

  • Drag and Drop is not available for the OneDrive folders.
  • You cannot copy/move from OneDrive to Google Drive or Dropbox, or vice versa.
  • You cannot create/delete OneDrive folders.