Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-79539

Errors encountered on email to private files feature while receiving incoming email

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE
    • MDL-79539-401
    • MDL-79539-402
    • MDL-79539-master
    • Hide

      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 - 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.
        If the "Run now" link is absent, specify it in the Path to PHP CLI at the Site Admin > Server > System Paths.
      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.
      Show
      This requires admin access, Google credentials OAuth setup Follow OAuth 2 Google service to get the Client Id and Client secret . Enable Gmail API in the Google Developer console. Login as admin. Navigate to Site Administrator > Server >  OAuth 2 services Create a new Google service called: Gmail - OAUTH2 . Set the Client id and Client secret . Set the Scopes included in a login request value to: "openid profile email https://mail.google.com " ( Without the quote ). Set the Scopes included in a login request for offline access value to: "openid profile email https://mail.google.com " ( Without the quote ). Save changes. Click Connect to a system account and finish it. Initial setup - IMAP Navigate to Site Administrator > Server > Email > Incoming Mail Configuration. Set the following value: Enable incoming mail processing: Checked Mailbox name: the name before @ sign of your email address (Ex: Your email is abc@gmail.com, the Mailbox name will be: abc) Email domain: the name after @ sign of your email address. In this case, it will be: gmail.com Incoming Mail Server: imap.gmail.com OAuth 2 Service: Gmail - OAUTH2 Username: The username that was used to connect to the Google Developer Console. Save changes. Navigate to Site Administrator > Server > Email > Message handlers. Enable the Email to Private files. Incoming mail testing Create a new tab on your browser called Tab 1 . On Tab 1, click on the User Profile menu > Profile. Observe the Email address of the admin user. (Example: xyz@gmail.com) Create a new tab on your browser called Tab 2 . On Tab 2 , open the webmail of the Admin's email (Example: https://mail.google.com) On Tab 1 , click on the User Profile menu > Private files. Verify that you will see: You can also e-mail files as attachments straight to your private files space.  Copy the email address. On Tab 2 , compose a new email with the following value: To: The copied email address. Subject: Test attachment Content: Attached Attachment: Attach an image on your machine. Send the email. Go to Site administration > Tasks > Scheduled tasks, locate Incoming email pickup task and click "Run now" link. If the "Run now" link is absent, specify it in the Path to PHP CLI at the Site Admin > Server > System Paths. On Tab 1, click on the User Profile menu > Private files. Verify that you will see the image that you have sent via email.
    • 2

      During the testing MDLQA-18415 and MDLQA-18203. We encountered problems while receiving the incoming email with IMAP.

      acorbi has kindly provided a patch that is worth checking https://github.com/moodle/moodle/compare/master...acorbier:moodle:MDLQA-18203-fixed-bug

      There is still one issue to address related to passing the null parameter at strtolower(). You can see the error has been marked by number 1 in the attachment.

      This error is caused by the regression of MDL-76356 at this line.

       

            meirza.arson@moodle.com Meirza
            meirza.arson@moodle.com Meirza
            Stevani Andolo Stevani Andolo
            Huong Nguyen Huong Nguyen
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 day, 3 hours, 38 minutes
                1d 3h 38m

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