Follow the steps below to create a Google application to allow users to access their Google Drive within Webmail on the Documents page.
1.Sign in to MDaemon Remote Administration and go to the Google Drive page (located under Main » Webmail Settings), and turn on the Enable Google Drive Integration option.
2.In a separate browser tab, sign in to your Google Account and go to the Google Cloud console.
3.If on the Project List, click NEW PROJECT, or if on the Manage Resources page, click (+) CREATE PROJECT.
4.Type a Project name, such as "Google Drive for MDaemon", then click Edit if you wish to edit the Project ID, or leave it set to the default value. Note: the Project ID cannot be changed after the project is created.
5.If you have an Organization Resource, choose it in Location. Otherwise, leave it set to "No organization."
6.Once loaded, click + ENABLE APIS AND SERVICES.
7.In the search field, type "Google Drive", select Google Drive API, and click Enable.
8.In the left pane, under APIs & Services, click Credentials.
9.Click + Create Credentials at the top of the page, and select API Key in the drop-down menu.
10.Copy Your API key (there is a Copy to Clipboard icon beside it).
11.Switch to your browser's MDaemon tab and paste it into the Google Drive API Key field on the Google Drive page in MDaemon (or save it somewhere else if you wish to do that later).
12.In the left pane, under APIs & Services, click OAuth consent screen, and then click Get started.
13.Under App Information, enter the App name (e.g. Google Drive for Webmail) and a User support email address for users to contact, and click Next. Note: This info is used for the consent screen that will be presented to users for authorizing Webmail to access the user's Google Drive. Depending on your particular organization or verification requirements, you can later also enter your company logo and links to your Terms of Service and Privacy Policy (see above) on the Branding page.
14.Under Audience, select External, and click Next. Note: if you have an Organization Resource, or depending on your app's Publishing Status, choosing Internal might be a better choice. See the Publishing Status note below for more information.
15.Under Contact Information, enter an Email address for Google to contact you about changes to your project, and click Next.
16.Under Finish, agree to the Google API Services: User Data Policy, click Continue, and then click Create.
17.In the left pane, click Data Access, and then click Add or Remove Scopes. Copy/paste the URIs below (you can copy/paste them all at once) into the box under "Manually add scopes", click Add to table, and then click Update.
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/documents
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.readonly
https://www.googleapis.com/auth/drive.metadata
https://www.googleapis.com/auth/drive.photos.readonly
https://www.googleapis.com/auth/drive.activity.readonly
https://www.googleapis.com/auth/spreadsheets
18.Click Save.
19.In the left pane, click Audience. Under Test users, click Add users, enter each Google account whose Google Drive MDaemon will be accessing through this app, and click Save (see the note below about your app's Publishing Status).
20.In the left pane, click Clients, and then click Create Client.
21.In the "Application type" drop-down box, select Web application, and under "Authorized redirect URIs", click Add URI. Enter the Redirect URI. The Redirect URI displayed on the Google Drive page in MDaemon 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.example.com/WorldClient.dll?View=OAuth&AuthRequest=GoogleDrive" would work for any of your users who go to mail.example.com when signing in to Webmail. If you also host a domain called "mail.company.test", then you would also need to enter a Redirect URI for that domain, i.e. "https://mail.company.test/WorldClient.dll?View=OAuth&AuthRequest=GoogleDrive".
22.Click Create.
23.Copy the Client ID and Client secret to the Google Drive Client ID and Google Drive Client Secret boxes on the Google Drive page in MDaemon. Note: Google shows the client secret only once, when you create the client. If you lose it, you must add a new secret to the client. You can also enter your Google Drive API Key if you didn't do that earlier.

|
Publishing Status — These instructions are for creating a Google app with the Publishing Status set to "Testing". This requires you to add each specific Google account that will be using the app to access their Google Drive, and it is limited to 100 users. Further, in Webmail when your users are asked to authorize MDaemon to access Google, a warning message will be displayed "to confirm the user has test access to your project but should consider the risks associated with granting access to their data to an unverified app." Also, authorization expires after seven days, therefore each user would be required to reauthorize Google access every week.
If you wish to remove these requirements and limitations then you must change your status to "In Production", which may or may not require you change your User Type from external to internal, to go through an app verification process, or both. For more information on app verification and publishing status, see the following Google articles: Setting up your OAuth consent screen and OAuth API verification FAQs.
|
Authorizing Google Drive in Webmail
Once you have created your Google Drive app and configured MDaemon's Google Drive page according to the instructions above, each user who wishes to access their Google Drive in Webmail must first authorize access to do so. To do this, each user should:
1.Sign in to Webmail.
2.Click the Options icon in the top right corner, and click Cloud Apps.
3.Click Setup Google Drive (this will open an OAuth 2.0 page).
4.Click Connect to Google Drive.
5.If not signed in, Google Drive will ask them for sign-in information or to choose an account.
6.They may be presented with a warning message that says, "Google hasn’t verified this app. You’ve been given access to an app that’s currently being tested. You should only continue if you know the developer that invited you." Click Continue.
7.Select which Google Drive features Webmail will be able to access, click Continue.
8.A final page will display stating that MDaemon is now connected to Google Drive. They can then close this window.
9.They can then access Google Drive from their Documents page in Webmail. |