|
SA Bugzilla – Full Text Bug Listing |
Summary: | When report_safe=1, timezone in Received: header in Win32 is syntactically invalid | ||
---|---|---|---|
Product: | Spamassassin | Reporter: | Dan Wing <dwing> |
Component: | SAProxy | Assignee: | Daniel Quinlan <quinlan> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | thorsten.walenzyk |
Priority: | P3 | Keywords: | backport |
Version: | 2.50 | ||
Target Milestone: | 2.50 | ||
Hardware: | PC | ||
OS: | Windows 2000 | ||
Whiteboard: | |||
Attachments: | proposed fix |
Description
Dan Wing
2003-02-24 12:46:17 UTC
Confirmed. The following snippet demonstrates the issue (I just cut the string from permsgstatus.pm) use POSIX qw(strftime); my $newmsg = "\t". strftime ("%a, %d %b %Y %H:%M:%S %z", localtime)."\n"; print $newmsg; Output is: Mon, 24 Feb 2003 15:33:27 Pacific Standard Time Workaround: If the TZ Environmental variable is defined as follows in Win32 environment before SA is run, stuff will work: (next bit snagged from MSDN). Note that the comments about the Date/Time control panel do not appear to be of any use with the Timezone name. Use the following syntax to set the TZ environment variable: set TZ=tzn[+ | –]hh[:mm[:ss] ][dzn] tzn Three-letter time-zone name, such as PST. You must specify the correct offset from local time to UTC. hh Difference in hours between UTC and local time. Optionally signed. mm Minutes. Separated from hh by a colon (:). ss Seconds. Separated from mm by a colon (:). dzn Three-letter daylight-saving-time zone such as PDT. If daylight saving time is never in effect in the locality, set TZ without a value for dzn. The C run-time library assumes the United States' rules for implementing the calculation of Daylight Saving Time (DST). For example, to set the TZ environment variable to correspond to the current time zone in Germany, you can use one of the following statements: set TZ=GST-1GDT set TZ=GST+1GDT These strings use GST to indicate German standard time, assume that Germany is one hour ahead of UTC, and assume that daylight savings time is in effect. If the TZ value is not set, _tzset attempts to use the time zone information specified by the operating system. Under Windows 98/Me and Windows NT/2000/XP, this information is specified in the Control Panel's Date/Time application. If _tzset cannot obtain this information, it uses PST8PDT by default, which signifies the Pacific Time zone. Setting target milestone to 2.50. I was able to reproduce the bug on Windows XP Home with ActivePerl 5.6. I will attach a patch to fix in a moment. strftime %z is not portable even on Unix. The workaround should be unnecessary if this fix is applied. I tested the fix on Windows XP Home with ActivePerl 5.6. Created attachment 675 [details]
proposed fix
Adding backport keyword. Not sure why this is a "backport" since I wrote it for the stable tree. Subject: Re: [SAdev] When report_safe=1, timezone in Received: header in Win32 is syntactically invalid On Mon, Feb 24, 2003 at 06:38:58PM -0800, bugzilla-daemon@hughes-family.org wrote: > Created an attachment (id=675) > proposed fix OKAY: looks good to me, especially since we already had a sub to do it. :) Note: fix committed to HEAD assign to me for backporting applying to branch OKAY fix applied to head and 2.50 branch, closing *** Bug 1867 has been marked as a duplicate of this bug. *** *** Bug 2587 has been marked as a duplicate of this bug. *** |