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

Add an inbound message handler for bounced emails and increment users bounce count

XMLWordPrintable

    • MOODLE_31_STABLE
    • MDL-53266-verp-bounces
    • Hide
      1. Setup inbound message processing
      2. Create a user with a working email address and send them an email
      3. Confirm that the Return-Path / noreply email has been overridden with a custom VERP email
      4. Create a user with a broken email address and confirm them manually (Real life use cases are: a user has changed email address, the inbox is full, the email host has gone away etc)
      5. Send an email to them and wait for the bounce to come back (ie watch the VERP mailbox)
      6. Run the pickup cron task and you should see something like this:

      Found 1 messages to parse. Parsing...
      - Parsing message 19
      -- Subject:	Undelivered Mail Returned to Sender
      -- From:	MAILER-DAEMON@smtp.catalyst-au.net
      -- Recipient:	moodle+AAAAAAAAAAQAAAAAAAA4RgAAAAA/mjZ/PA5UCaeWW2gZoQCQ@moodle.catalyst-au.net
      -- Processing the message as user 14406 (teacher).
      -- Validation completed. Fetching rest of message content.
      --> Passing to Inbound Message handler \tool_messageinbound\message\inbound\bounce_handler
      === Increment bounce count to 1 for breefwrwndan+willrogers@catalyst-au.net ===
      

      1. Repeat the above, but between sending the email and running the pickup task change the users email to something else (could be valid or not) and then run the pickup and confirm you see something like this:

      Found 1 messages to parse. Parsing...
      - Parsing message 20
      -- Subject:	Undelivered Mail Returned to Sender
      -- From:	MAILER-DAEMON@smtp.catalyst-au.net
      -- Recipient:	moodle+AAAAAAAAAAQAAAAAAAA4RgAAAAA/mjZ/PA5UCaeWW2gZoQCQ@moodle.catalyst-au.net
      -- Processing the message as user 14406 (teacher).
      -- Validation completed. Fetching rest of message content.
      --> Passing to Inbound Message handler \tool_messageinbound\message\inbound\bounce_handler
      === Bounce message ignored because users email has changed since sent. ===
      

      Show
      Setup inbound message processing Create a user with a working email address and send them an email Confirm that the Return-Path / noreply email has been overridden with a custom VERP email Create a user with a broken email address and confirm them manually (Real life use cases are: a user has changed email address, the inbox is full, the email host has gone away etc) Send an email to them and wait for the bounce to come back (ie watch the VERP mailbox) Run the pickup cron task and you should see something like this: Found 1 messages to parse. Parsing... - Parsing message 19 -- Subject: Undelivered Mail Returned to Sender -- From: MAILER-DAEMON@smtp.catalyst-au.net -- Recipient: moodle+AAAAAAAAAAQAAAAAAAA4RgAAAAA/mjZ/PA5UCaeWW2gZoQCQ@moodle.catalyst-au.net -- Processing the message as user 14406 (teacher). -- Validation completed. Fetching rest of message content. --> Passing to Inbound Message handler \tool_messageinbound\message\inbound\bounce_handler === Increment bounce count to 1 for breefwrwndan+willrogers@catalyst-au.net === Repeat the above, but between sending the email and running the pickup task change the users email to something else (could be valid or not) and then run the pickup and confirm you see something like this: Found 1 messages to parse. Parsing... - Parsing message 20 -- Subject: Undelivered Mail Returned to Sender -- From: MAILER-DAEMON@smtp.catalyst-au.net -- Recipient: moodle+AAAAAAAAAAQAAAAAAAA4RgAAAAA/mjZ/PA5UCaeWW2gZoQCQ@moodle.catalyst-au.net -- Processing the message as user 14406 (teacher). -- Validation completed. Fetching rest of message content. --> Passing to Inbound Message handler \tool_messageinbound\message\inbound\bounce_handler === Bounce message ignored because users email has changed since sent. ===

      This has been split out from MDL-53255 because it has lots of value by itself, and is a standalone task, and also because it helps implement MDL-53023 more easily for most setups.

      Proposal:

      • If inbound handling is turned on, and the email being sent is from a real user a customnoreply return path will be created.
      • move the existing logic in admin/process_email.php into the inbound handler: consume bounce emails from elsewhere and increment the users bounce count

      The old style bounce processing could happily stay around for a while and not be deprecated, dunno what the vibe is on that but I'd guess that very few instances have it set up.

            Unassigned Unassigned
            brendanheywood Brendan Heywood
            Votes:
            5 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:

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