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

Timezone problem in PHPMailer RFCDate() Function

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.7.3, 1.8.3
    • Fix Version/s: 1.8.4, 1.9, 2.0
    • Component/s: Administration
    • Labels:
      None
    • Environment:
      Redhat Enterprise 4.0, Apache2, PHP5.1
    • Database:
      Any
    • Affected Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_20_STABLE

      Description

      We have been alerted that some of our users e-mails (sign-up) were not being delivered. After hours of investigating the problem we found that the problem was an incorrect timezone header in the e-mail that was generated by Moodle (it inserted +1080 as the UTC offset which is illegal). Because of the illegal header the SPAM and AV Gateway was dropping the e-mail as SPAM.

      After working our way through the code it looks like there is a problem with the PHPMailer code (lib/phpmailer/class.phpmailer.php) that will effect half hour time-zones (such as Central Australian Standard Time Australia/Adelaide +1030 or Indian Standard Time India/Mumbai +0530).

      The line:

      $tz = ($tz/3600)*100 + ($tz%3600)/60;

      in function RFCDate() should be replaced with

      $tz = (($tz - ($tz%3600) )/3600)*100 + ($tz%3600)/60;

      It seems that this has been already discussed at the PHPMailer mailinglist on SourceForge, however I could not see if a patch has been released.

      I have currently patched our Moodle Installations with this patch.

      Cheers,

      Leo

        Attachments

          Activity

            People

            • Assignee:
              skodak Petr Skoda
              Reporter:
              leogaggl Leo Gaggl
              Tester:
              Nobody
              Participants:
              Component watchers:
              Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                11/Jan/08