From:             php dot time dot bug at aaronoff dot com
Operating system: W2K SP4
PHP version:      4.3.8
PHP Bug Type:     Date/time related
Bug description:  mail() provides incorrect message time header

Description:
------------
I'm using the mail() function to send a message from my home SMTP server
to my domain's SMTP server via my installation of MS IIS 5.0 SMTP under
W2K SP4.

The time zone for my home PC is GMT +0200 in summer (with DST), +0100 in
winter (w/o DST). In Windows Control Panel, Date/Time Properties, Time
Zone tab, the time zone shows as +0100 and "Automatically adjust time for
daylight saving changes" is checked. DST, then, increases the offset on my
PC from +0100 to +0200.

The e-mail message retrieved by my e-mail client from my domain's SMTP
server has a message header Date field set to the right hour but at GMT
offset +0100 -- this is the wrong time. Since my e-mail client displays
messages with time sent corrected to my local time, it adds an hour and
the message shows with a time one hour *ahead* of the time it was actually
sent.

Ex: message sent by mail() at 16:10 +0200
    Date field in message header on home SMTP server shows 16:10 +0100 <--
this is the wrong time!
    message sent by home SMTP server at 16:10 +0200
    message received by e-mail client from domain at 16:11 +0200
    e-mail client shows sent message time of 17:10 +0200

If a text message with just From:, To: and Subject: headers is dropped
into the home SMTP "Queue" folder, the home SMTP server adds the local
time with the correct GMT offset to the message header Date field. This
shows that the problem is not coming from the home SMTP server itself, but
from the program that's providing it with date information.

IMHO, mail() is not using the correcting the GMT offset for DST.

I've been unable to find any mention of an INI-file parameter for this,
Googling results were meager, and I found no open bugs.

HTH.

regards, Andy

Reproduce code:
---------------
mail($dest,$subject,$body)

Expected result:
----------------
The Date: field in the message's header should show the correct hour and
GMT offset.

Actual result:
--------------
The Date: field in the message's header shows the correct hour but the
wrong GMT offset -- it's not corrected for DST.

-- 
Edit bug report at http://bugs.php.net/?id=29334&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29334&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29334&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29334&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29334&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29334&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29334&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29334&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29334&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29334&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29334&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29334&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29334&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29334&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29334&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29334&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29334&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29334&r=float

Reply via email to