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

Timezone problem in PHPMailer RFCDate() Function

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7.3, 1.8.3
    • 1.8.4, 1.9, 2.0
    • Administration
    • None
    • Redhat Enterprise 4.0, Apache2, PHP5.1
    • Any
    • MOODLE_17_STABLE, MOODLE_18_STABLE
    • 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

            skodak Petr Skoda
            leogaggl Leo Gaggl
            Nobody Nobody
            David Woloszyn, Huong Nguyen, Jake Dallimore, Michael Hawkins, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              11/Jan/08