Moodle

Timezone problem in PHPMailer RFCDate() Function

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor 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

Activity

Hide
Petr Škoda (skodak) added a comment -

tested and committed into cvs, thanks for the report and patch

link to sf report: http://www.nabble.com/small-bug-in-timezone-code-to13320733.html#a13320733

Show
Petr Škoda (skodak) added a comment - tested and committed into cvs, thanks for the report and patch link to sf report: http://www.nabble.com/small-bug-in-timezone-code-to13320733.html#a13320733

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: