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

Add a mail filtering and mutation api

XMLWordPrintable

    • MOODLE_310_STABLE, MOODLE_400_STABLE
    • MDL-69724-email-mutation-m
    • Hide

      Prerequisites:

      Have a local mail setup installed, such as mailcatcher, to inspect email.

      Install a test tool that will verify the API extension:

       

      git clone git@github.com:Peterburnett/MDL-69724-tester.git admin/tool/emailtester
      

       

      Testing Instructions:

      1) Set the default email settings for messages between users to online and offline here: /admin/tool/message.php

      2) Create a test user to send messages to, which we will use as a test email.

      3) Send a message to this user.

      4) Verify that the email is received in mailcatcher.

      5) Verify that the subject, from and contents all appear as they should.

      6) Edit config.php and add a line to override the mail factory to one that inserts an extra header:

      $CFG->alternative_email_manager_class = '\tool_emailtester\email\manager';
      

      7) Send another message to the test user.

      8) Verify that the mail is received and everything looks the same as in Step 5.

      9) Now inspect the source of the mail, and confirm there is an extra header in the mail: X-mail-testing: test. This confirms that the API extension is working.

       

      Show
      Prerequisites: Have a local mail setup installed, such as mailcatcher, to inspect email. Install a test tool that will verify the API extension:   git clone git @github .com:Peterburnett/MDL- 69724 -tester.git admin/tool/emailtester   Testing Instructions: 1) Set the default email settings for messages between users to online and offline here: /admin/tool/message.php 2) Create a test user to send messages to, which we will use as a test email. 3) Send a message to this user. 4) Verify that the email is received in mailcatcher. 5) Verify that the subject, from and contents all appear as they should. 6) Edit config.php and add a line to override the mail factory to one that inserts an extra header: $CFG->alternative_email_manager_class = '\tool_emailtester\email\manager' ; 7) Send another message to the test user. 8) Verify that the mail is received and everything looks the same as in Step 5. 9) Now inspect the source of the mail, and confirm there is an extra header in the mail: X-mail-testing: test. This confirms that the API extension is working.  
    • 10

      Very closely related to MDL-69513 where we add DKIM signing. By moving signing back to the application layer there are a bunch of things traditionally done at the MTA which now need to be done before email signing and so also need to be in the application layer.

      So we need a nice simple api to:

      • potentially filter and turn off certain emails based on their properties (and independent of all the existing
      • opportunity to mutate all emails like conditionally add more header
      • opportunity to change emails
      • opens the door to more use cases like email queueing and logging

      eg we've had a really nice email log / queue / tool which is kinda like mail catcher for a while and makes email a ton nicer and I'll like to make this compatible with Moodle with a clean api:

      https://github.com/catalyst/moodle-local_maillog/tree/TOTARA_12_STABLE

       

            Unassigned Unassigned
            brendanheywood Brendan Heywood
            Dan Marsden Dan Marsden
            Andrew Lyons Andrew Lyons
            Votes:
            5 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 7 hours, 10 minutes
                7h 10m

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