Uploaded image for project: 'Moodle QA'
  1. Moodle QA
  2. MDLQA-17933 Moodle 4.3 QA
  3. MDLQA-18415

CLONE - Admins can enable Gmail XOauth2 for outgoing and incoming mail

    XMLWordPrintable

Details

    Description

      This requires admin access, Google credentials

      OAuth setup

      1. Follow OAuth 2 Google service to get the Client Id and Client secret.
      2. Enable Gmail API in the Google Developer console.
      3. Login as admin.
      4. Navigate to Site Administrator > Server >  OAuth 2 services
      5. Create a new Google service called: Gmail - OAUTH2.
      6. Set the Client id and Client secret.
      7. Set the Scopes included in a login request value to: "openid profile email https://mail.google.com" (Without the quote).
      8. Set the Scopes included in a login request for offline access value to: "openid profile email https://mail.google.com" (Without the quote).
      9. Save changes.
      10. Click Connect to a system account and finish it.

      Initial setup - SMTP

      1. Navigate to Site Administrator > Server > Email > Outgoing Mail Configuration.
      2. Set the following value:
        • SMTP hosts: smtp.gmail.com:587
        • SMTP Security: TLS
        • SMTP Auth Type: XOAUTH2
        • OAuth 2 Service: Gmail - OAUTH2
        • SMTP username: The username that was used to connect to Google Developer Console.
      3. Save changes

      Outgoing mail testing

      1. Navigate to Site Administrator > Server > Email > Outgoing Mail Configuration -> Test outgoing mail configuration
      2. To email address: Your email address to receive the test email.
      3. Additional subject: Test email using XOAUTH2
      4. Press Send a test message.
      5. Verify that you will see:  This site has successfully sent a test message to the mail server.
      6. Open your email inbox.
      7. Verify that you will see an email with:
        • Title: [Your site name]: test message. Test email using XOAUTH2
        • Content: This is a test message to confirm that you have successfully configured your site's outgoing mail.

      Initial setup - IMAP

      1. Navigate to Site Administrator > Server > Email > Incoming Mail Configuration.
      2. Set the following value:
        1. Enable incoming mail processing: Checked
        2. Mailbox name: the name before @ sign of your email address (Ex: Your email is abc@gmail.com, the Mailbox name will be: abc)
        3. Email domain: the name after @ sign of your email address. In this case, it will be: gmail.com
        4. Incoming Mail Server: imap.gmail.com
        5. OAuth 2 Service: Gmail - OAUTH2
        6. Username: The username that was used to connect to the Google Developer Console.
      3. Save changes.
      4. Navigate to Site Administrator > Server > Email > Message handlers.
      5. Enable the Email to Private files.

      Incoming mail testing

      1. Create a new tab on your browser called Tab 1.
      2. On Tab 1, click on the User Profile menu > Profile.
      3. Observe the Email address of the admin user. (Example: xyz@gmail.com)
      4. Create a new tab on your browser called Tab 2.
      5. On Tab 2, open the webmail of the Admin's email (Example: https://mail.google.com)
      6. On Tab 1, click on the User Profile menu > Private files.
      7. Verify that you will see: You can also e-mail files as attachments straight to your private files space. 
      8. Copy the email address.
      9. On Tab 2, compose a new email with the following value:
        1. To: The copied email address.
        2. Subject: Test attachment
        3. Content: Attached
        4. Attachment: Attach an image on your machine.
      10. Send the email.
      11. Go to Site administration > Tasks > Scheduled tasks, locate Incoming email pickup task and click "Run now" link
      12. On Tab 1, click on the User Profile menu > Private files.
      13. Verify that you will see the image that you have sent via email.

      Attachments

        1. qa18415_attached.png
          qa18415_attached.png
          60 kB
        2. qa18415_emailaddress.png
          qa18415_emailaddress.png
          41 kB
        3. qa18415_emailprivatefiles.png
          qa18415_emailprivatefiles.png
          45 kB
        4. qa18415_oauth2.png
          qa18415_oauth2.png
          97 kB
        5. qa18415_runtask.png
          qa18415_runtask.png
          103 kB
        6. qa18415_sent.png
          qa18415_sent.png
          41 kB
        7. qa18415_imap.png
          qa18415_imap.png
          146 kB
        8. qa18415_smtp.png
          qa18415_smtp.png
          133 kB

        Issue Links

          Activity

            People

              meirza.arson@moodle.com Meirza
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.