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

Timezone problem in PHPMailer RFCDate() Function

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 1.8.4, 1.9, 2.0
    • 1.7.3, 1.8.3
    • 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

      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

            skodak Petr Skoda
            leogaggl Leo Gaggl (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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