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

Inbound E-Mail MIME Parsing Issues

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.5 regressions
    • Tasks

      When using Inbound Message Processing (tool_messageinbound), Moodle 4.5 encounters fatal errors while parsing certain emails that:

      • Have incomplete MIME body structures, where expected array keys (e.g., $partstructure[2], $partstructure[5]) are missing.
      • Do not specify a CHARSET in their MIME headers.

      Proposed Solution:

      Missing MIME Structure Keys: Use defensive checks to ensure safe defaults:
      admin/tool/messageinbound/classes/manager.php
      Line 755:

      $attributes = isset($partstructure[2]) && is_array($partstructure[2]) ? $partstructure[2] : [];
      $parameters = $this->process_message_body_structure_parameters(
          attributes: $attributes,
          parameters: $parameters,
      );

       

       

      Missing CHARSET: Default to 'UTF-8' when CHARSET is not provided:

      admin/tool/messageinbound/classes/manager.php
      Lines 779 and 786

      charset: $parameters['CHARSET'] ?? 'UTF-8',

            Unassigned Unassigned
            scits Romeo Sulzer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

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