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

Port number not removed from host in Horde IMAP with PHP 5.6

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.1, 3.0.5
    • Fix Version/s: 3.0.6, 3.1.2
    • Component/s: Other
    • Labels:
    • Testing Instructions:
      Hide
      1. Configure message inbound with server details in each of the following forms:
        1. example.server.fqdn
        2. example.server.fqdn:portno
      2. Run the messageinbound pickup task:

        php admin/tool/task/cli/schedule_task.php --execute="\tool_messageinbound\task\pickup_task"
        

        1. Confirm that there were no errors
      Show
      Configure message inbound with server details in each of the following forms: example.server.fqdn example.server.fqdn:portno Run the messageinbound pickup task: php admin/tool/task/cli/schedule_task.php --execute="\tool_messageinbound\task\pickup_task" Confirm that there were no errors
    • Affected Branches:
      MOODLE_29_STABLE, MOODLE_30_STABLE
    • Fixed Branches:
      MOODLE_30_STABLE, MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-51242-master

      Description

      I'm unsure if this is a Moodle bug or a Horde bug. I'm just not familiar enough with the call sequence to know where the variable is getting changed.

      Steps to reproduce:

      1. Moodle 2.9.1 running on PHP 5.5.3 with incoming mail functioning. (Gmail, if that matters)
      2. Change PHP version to 5.6 (May also happen on 5.6 install)

      Expected behavior:
      Incoming mail continues to work

      Actual behavior:
      Incoming mail in cron fails with "error connecting to mail server"

      Research
      In 'lib/horde/framework/Horde/Socket/Client.php' the function _connect is receiving the host as "imap.gmail.com:993" and the port as "993", resulting in a final url of ssl://imap.google.com:993:993, which fails. Manually overriding $host and $port corrects the problem.

      Next steps
      I have no idea where _connect is being called from, and honestly I'm not sure how to research it myself. I'd assume it's part of the incoming mail portion, but I don't know the module well enough to know where, and I don't have a stack trace available.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                12/Sep/16